[llvm] 1225c8a - Update sink instruction testcase

Anna Thomas via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 8 13:54:18 PST 2021


Author: Anna Thomas
Date: 2021-12-08T16:54:10-05:00
New Revision: 1225c8a06103e029a4b2ebb782a175ab1e011cbe

URL: https://github.com/llvm/llvm-project/commit/1225c8a06103e029a4b2ebb782a175ab1e011cbe
DIFF: https://github.com/llvm/llvm-project/commit/1225c8a06103e029a4b2ebb782a175ab1e011cbe.diff

LOG: Update sink instruction testcase

Add inferable writeonly attribute. Simplify testcase.

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/sink_sideeffecting_instruction.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/sink_sideeffecting_instruction.ll b/llvm/test/Transforms/InstCombine/sink_sideeffecting_instruction.ll
index e36256eb3d59..e1d411c7a5a8 100644
--- a/llvm/test/Transforms/InstCombine/sink_sideeffecting_instruction.ll
+++ b/llvm/test/Transforms/InstCombine/sink_sideeffecting_instruction.ll
@@ -40,7 +40,7 @@ define dso_local i32 @test() local_unnamed_addr #2 {
 ; CHECK-LABEL: test
 ; CHECK: bb5:
 ; CHECK: %tmp7 = call i32 @foo(i32* nonnull writeonly %tmp1) 
-; CHECK: br i1 %tmp9, label %bb10, label %bb_crit_edge
+; CHECK-NEXT: br i1 %tmp9, label %bb10, label %bb_crit_edge
 bb:
   %tmp = alloca i32, align 4
   %tmp1 = alloca i32, align 4
@@ -53,9 +53,9 @@ bb:
 bb5:                                              ; preds = %bb
   %tmp6 = bitcast i32* %tmp1 to i8*
   call void @llvm.lifetime.start.p0i8(i64 4, i8* nonnull %tmp6) #4
-  %tmp7 = call i32 @foo(i32* nonnull writeonly %tmp1)
   %tmp8 = load i32, i32* %tmp, align 4, !tbaa !2
   %tmp9 = icmp eq i32 %tmp8, 0
+  %tmp7 = call i32 @foo(i32* nonnull writeonly %tmp1)
   br i1 %tmp9, label %bb10, label %bb_crit_edge
 
 bb10:                                             ; preds = %bb5
@@ -83,7 +83,7 @@ declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture) #3
 ; Function Attrs: argmemonly nofree nosync nounwind willreturn
 declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) #3
 
-attributes #0 = { noinline uwtable argmemonly nounwind willreturn }
+attributes #0 = { noinline uwtable argmemonly nounwind willreturn writeonly }
 attributes #3 = { argmemonly nofree nosync nounwind willreturn }
 !0 = !{i32 1, !"wchar_size", i32 4}
 !1 = !{!"clang version 10.0.0-4ubuntu1 "}


        


More information about the llvm-commits mailing list