ret i32 %tmp4
}
-; A
-define i32 @test5(i32 %a) nounwind {
-; CHECK-LABEL: @test5(
-; CHECK-NEXT: ret i32 %a
-;
- %tmp2 = tail call i32 @llvm.bswap.i32( i32 %a )
- %tmp4 = tail call i32 @llvm.bswap.i32( i32 %tmp2 )
- ret i32 %tmp4
-}
-
; a >> 24
define i32 @test6(i32 %a) nounwind {
; CHECK-LABEL: @test6(
%A = tail call double @llvm.powi.f64(double %V, i32 -1) nounwind
store volatile double %A, double* %P
- %B = tail call double @llvm.powi.f64(double %V, i32 0) nounwind
- store volatile double %B, double* %P
-
- %C = tail call double @llvm.powi.f64(double %V, i32 1) nounwind
- store volatile double %C, double* %P
-
%D = tail call double @llvm.powi.f64(double %V, i32 2) nounwind
store volatile double %D, double* %P
ret void
; CHECK-LABEL: @powi(
; CHECK: %A = fdiv double 1.0{{.*}}, %V
; CHECK: store volatile double %A,
-; CHECK: store volatile double 1.0
-; CHECK: store volatile double %V
; CHECK: %D = fmul double %V, %V
; CHECK: store volatile double %D
}
-; RUN: opt < %s -instcombine -S | FileCheck %s
+; RUN: opt < %s -instsimplify -S | FileCheck %s
define i32 @identity_bitreverse_i32(i32 %p) {
; CHECK-LABEL: @identity_bitreverse_i32(
--- /dev/null
+; RUN: opt < %s -instsimplify -S | FileCheck %s
+
+declare double @llvm.powi.f64(double, i32) nounwind readonly
+declare i32 @llvm.bswap.i32(i32)
+
+; A
+define i32 @test_bswap(i32 %a) nounwind {
+; CHECK-LABEL: @test_bswap(
+; CHECK-NEXT: ret i32 %a
+;
+ %tmp2 = tail call i32 @llvm.bswap.i32( i32 %a )
+ %tmp4 = tail call i32 @llvm.bswap.i32( i32 %tmp2 )
+ ret i32 %tmp4
+}
+
+define void @powi(double %V, double *%P) {
+ %B = tail call double @llvm.powi.f64(double %V, i32 0) nounwind
+ store volatile double %B, double* %P
+
+ %C = tail call double @llvm.powi.f64(double %V, i32 1) nounwind
+ store volatile double %C, double* %P
+
+ ret void
+; CHECK-LABEL: @powi(
+; CHECK: store volatile double 1.0
+; CHECK: store volatile double %V
+}