[llvm] 14936e0 - [InstCombine] add test for miscompile (PR46561); NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sat Jul 4 08:06:40 PDT 2020
Author: Sanjay Patel
Date: 2020-07-04T11:06:30-04:00
New Revision: 14936e01e2199842e0a6ef3a85a60e32c14685ea
URL: https://github.com/llvm/llvm-project/commit/14936e01e2199842e0a6ef3a85a60e32c14685ea
DIFF: https://github.com/llvm/llvm-project/commit/14936e01e2199842e0a6ef3a85a60e32c14685ea.diff
LOG: [InstCombine] add test for miscompile (PR46561); NFC
Added:
Modified:
llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll b/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
index 6b8cfd4f4ae2..407c0ee906b6 100644
--- a/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
+++ b/llvm/test/Transforms/InstCombine/icmp-mul-zext.ll
@@ -120,3 +120,33 @@ ret1:
ret2:
ret i16 %trunc_unnecessary ; crash visiting this use after corrupting iterator
}
+
+; FIXME: This miscompiles because of broken pattern matching.
+
+define i1 @PR46561(i1 %a, i1 %x, i1 %y, i8 %z) {
+; CHECK-LABEL: @PR46561(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: br i1 [[A:%.*]], label [[COND_TRUE:%.*]], label [[END:%.*]]
+; CHECK: cond.true:
+; CHECK-NEXT: br label [[END]]
+; CHECK: end:
+; CHECK-NEXT: [[P:%.*]] = phi i1 [ true, [[COND_TRUE]] ], [ false, [[ENTRY:%.*]] ]
+; CHECK-NEXT: ret i1 [[P]]
+;
+entry:
+ br i1 %a, label %cond.true, label %end
+
+cond.true:
+ %tz = trunc i8 %z to i1
+ %zx = zext i1 %x to i32
+ %zy = zext i1 %y to i32
+ %zz = zext i1 %tz to i32
+ %mul = mul i32 %zx, %zy
+ %cond = xor i32 %mul, %zz
+ br label %end
+
+end:
+ %p = phi i32 [ %cond, %cond.true ], [ -1, %entry ]
+ %r = icmp eq i32 %p, 0
+ ret i1 %r
+}
More information about the llvm-commits
mailing list