[llvm-branch-commits] [llvm] 9b202ca - [X86] Add test for PR64589 (NFC)
Tobias Hieta via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Aug 15 02:09:23 PDT 2023
Author: Nikita Popov
Date: 2023-08-15T11:07:53+02:00
New Revision: 9b202cad8905c54e5da394b4739a0df5bc7eb3ae
URL: https://github.com/llvm/llvm-project/commit/9b202cad8905c54e5da394b4739a0df5bc7eb3ae
DIFF: https://github.com/llvm/llvm-project/commit/9b202cad8905c54e5da394b4739a0df5bc7eb3ae.diff
LOG: [X86] Add test for PR64589 (NFC)
(cherry picked from commit 59d558a37850611f9b63a5c1a8bfe87a9606c81e)
Added:
llvm/test/CodeGen/X86/pr64589.ll
Modified:
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/pr64589.ll b/llvm/test/CodeGen/X86/pr64589.ll
new file mode 100644
index 00000000000000..0695e20d592923
--- /dev/null
+++ b/llvm/test/CodeGen/X86/pr64589.ll
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
+; RUN: llc -mtriple=x86_64-- < %s | FileCheck %s
+
+; FIXME: This is a miscompile.
+; It's not possible to directly or the two loads together, because this might
+; propagate a poison value from the second load (which has !range but not
+; !noundef).
+define i8 @test(ptr %p) {
+; CHECK-LABEL: test:
+; CHECK: # %bb.0:
+; CHECK-NEXT: movzbl (%rdi), %eax
+; CHECK-NEXT: orb 1(%rdi), %al
+; CHECK-NEXT: addb %al, %al
+; CHECK-NEXT: retq
+ %v1 = load i8, ptr %p, align 4, !range !0, !noundef !{}
+ %cmp1 = icmp ne i8 %v1, 0
+ %p2 = getelementptr inbounds i8, ptr %p, i64 1
+ %v2 = load i8, ptr %p2, align 1, !range !0
+ %cmp2 = icmp ne i8 %v2, 0
+ %or = select i1 %cmp1, i1 true, i1 %cmp2
+ %res = select i1 %or, i8 2, i8 0
+ ret i8 %res
+}
+
+!0 = !{i8 0, i8 2}
More information about the llvm-branch-commits
mailing list