[llvm] e72f16b - [Test] Add a JumpThreading test exposing a bug in BasicAA.

Daniil Suchkov via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 7 14:40:52 PDT 2021


Author: Daniil Suchkov
Date: 2021-06-07T21:39:00Z
New Revision: e72f16b7e66256dba5496a32546417d438bb035c

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

LOG: [Test] Add a JumpThreading test exposing a bug in BasicAA.

Added: 
    llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll b/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
new file mode 100644
index 0000000000000..10de852c26571
--- /dev/null
+++ b/llvm/test/Transforms/JumpThreading/aa-crash-phi-no-args.ll
@@ -0,0 +1,45 @@
+; XFAIL: *
+; REQUIRES: asserts
+; RUN: opt -jump-threading -aa-pipeline basic-aa -S -disable-output %s
+; RUN: opt -passes=jump-threading -aa-pipeline basic-aa -S -disable-output %s
+
+define void @foo(i8** %arg1, i32* %arg2) {
+bb:
+  br label %bb1
+
+bb1:
+  %tmp = phi i1 [ 0, %bb24 ], [ 1, %bb ]
+  br i1 %tmp, label %bb9, label %bb24
+
+
+bb9:
+  br i1 %tmp, label %bb8, label %bb20
+
+bb8:
+  ret void
+
+bb13:
+  br label %bb14
+
+bb14:
+  %tmp15 = phi i32* [ %tmp21, %bb20 ], [ %arg2, %bb13 ]
+  %tmp16 = phi i8** [ %tmp22, %bb20 ], [ %arg1, %bb13 ]
+  store atomic i32 0, i32* %tmp15 unordered, align 4
+  %tmp17 = load atomic i8*, i8** %tmp16 unordered, align 8
+  %tmp18 = icmp eq i8* %tmp17, null
+  br i1 %tmp18, label %bb25, label %bb19
+
+bb19:
+  ret void
+
+bb20:
+  %tmp21 = phi i32* [ %arg2, %bb9 ]
+  %tmp22 = phi i8** [ %arg1, %bb9 ]
+  br label %bb14
+
+bb24:
+  br label %bb1
+
+bb25:
+  ret void
+}


        


More information about the llvm-commits mailing list