1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test/Transforms/HotColdSplit/duplicate-phi-preds-crash.ll
Hans Wennborg f6eeeaf04e Revert "[PM/CC1] Add -f[no-]split-cold-code CC1 option to toggle splitting"
This broke Chromium's PGO build, it seems because hot-cold-splitting got turned
on unintentionally. See comment on the code review for repro etc.

> This patch adds -f[no-]split-cold-code CC1 options to clang. This allows
> the splitting pass to be toggled on/off. The current method of passing
> `-mllvm -hot-cold-split=true` to clang isn't ideal as it may not compose
> correctly (say, with `-O0` or `-Oz`).
>
> To implement the -fsplit-cold-code option, an attribute is applied to
> functions to indicate that they may be considered for splitting. This
> removes some complexity from the old/new PM pipeline builders, and
> behaves as expected when LTO is enabled.
>
> Co-authored by: Saleem Abdulrasool <compnerd@compnerd.org>
> Differential Revision: https://reviews.llvm.org/D57265
> Reviewed By: Aditya Kumar, Vedant Kumar
> Reviewers: Teresa Johnson, Aditya Kumar, Fedor Sergeev, Philip Pfaffe, Vedant Kumar

This reverts commit 273c299d5d649a0222fbde03c9a41e41913751b4.
2020-10-19 12:31:14 +02:00

55 lines
1.8 KiB
LLVM

; RUN: opt -S -hotcoldsplit -hotcoldsplit-threshold=0 < %s | FileCheck %s
target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-apple-macosx10.14.0"
declare void @sideeffect(i64)
declare i8* @realloc(i8* %ptr, i64 %size)
declare void @free(i8* %ptr)
declare void @sink() cold
; CHECK-LABEL: define {{.*}}@realloc2(
; CHECK: call {{.*}}@sideeffect(
; CHECK: call {{.*}}@realloc(
; CHECK-LABEL: codeRepl:
; CHECK: call {{.*}}@realloc2.cold.1(i64 %size, i8* %ptr, i8** %retval.0.ce.loc)
; CHECK-LABEL: cleanup:
; CHECK-NEXT: phi i8* [ null, %if.then ], [ %call, %if.end ], [ %retval.0.ce.reload, %codeRepl ]
define i8* @realloc2(i8* %ptr, i64 %size) {
entry:
%0 = add i64 %size, -1
%1 = icmp ugt i64 %0, 184549375
br i1 %1, label %if.then, label %if.end
if.then: ; preds = %entry
call void @sideeffect(i64 %size)
br label %cleanup
if.end: ; preds = %entry
%call = call i8* @realloc(i8* %ptr, i64 %size)
%tobool1 = icmp eq i8* %call, null
br i1 %tobool1, label %if.then2, label %cleanup
if.then2: ; preds = %if.end
call void @sideeffect(i64 %size)
call void @sink()
%tobool3 = icmp eq i8* %ptr, null
br i1 %tobool3, label %cleanup, label %if.then4
if.then4: ; preds = %if.then2
call void @free(i8* %ptr)
br label %cleanup
cleanup: ; preds = %if.end, %if.then4, %if.then2, %if.then
%retval.0 = phi i8* [ null, %if.then ], [ null, %if.then2 ], [ null, %if.then4 ], [ %call, %if.end ]
ret i8* %retval.0
}
; CHECK-LABEL: define {{.*}}@realloc2.cold.1(
; CHECK: call {{.*}}@sideeffect
; CHECK: call {{.*}}@sink
; CHECK: call {{.*}}@free