mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-25 12:12:47 +01:00
64cf7359d3
Some of the tests in the llvm/test/Transforms/IPConstantProp directory actually only use -ipsccp. Those tests belong to the other (IP)SCCP tests in llvm/test/Transforms/SCCP/ and this commits moves them there to avoid confusion with IPConstantProp.
35 lines
1.0 KiB
LLVM
35 lines
1.0 KiB
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes
|
|
; RUN: opt < %s -S -ipsccp | FileCheck %s
|
|
|
|
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
|
|
target triple = "x86_64-unknown-linux-gnu"
|
|
|
|
define i64 @fn2() {
|
|
; CHECK-LABEL: define {{[^@]+}}@fn2()
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CONV:%.*]] = sext i32 undef to i64
|
|
; CHECK-NEXT: [[DIV:%.*]] = sdiv i64 8, [[CONV]]
|
|
; CHECK-NEXT: [[CALL2:%.*]] = call i64 @fn1(i64 [[DIV]])
|
|
; CHECK-NEXT: ret i64 [[CALL2]]
|
|
;
|
|
entry:
|
|
%conv = sext i32 undef to i64
|
|
%div = sdiv i64 8, %conv
|
|
%call2 = call i64 @fn1(i64 %div)
|
|
ret i64 %call2
|
|
}
|
|
|
|
define internal i64 @fn1(i64 %p1) {
|
|
; CHECK-LABEL: define {{[^@]+}}@fn1
|
|
; CHECK-SAME: (i64 [[P1:%.*]])
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[TOBOOL:%.*]] = icmp ne i64 [[P1]], 0
|
|
; CHECK-NEXT: [[COND:%.*]] = select i1 [[TOBOOL]], i64 [[P1]], i64 [[P1]]
|
|
; CHECK-NEXT: ret i64 [[COND]]
|
|
;
|
|
entry:
|
|
%tobool = icmp ne i64 %p1, 0
|
|
%cond = select i1 %tobool, i64 %p1, i64 %p1
|
|
ret i64 %cond
|
|
}
|