[llvm] 8ae33cb - [X86] Add additional test for PR54369 (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 8 01:40:16 PDT 2022
Author: Nikita Popov
Date: 2022-04-08T10:39:43+02:00
New Revision: 8ae33cb300262738d9798edb612c7431612f56f6
URL: https://github.com/llvm/llvm-project/commit/8ae33cb300262738d9798edb612c7431612f56f6
DIFF: https://github.com/llvm/llvm-project/commit/8ae33cb300262738d9798edb612c7431612f56f6.diff
LOG: [X86] Add additional test for PR54369 (NFC)
>From this comment: https://reviews.llvm.org/D123014#3436522
Added:
Modified:
llvm/test/CodeGen/X86/pr54369.ll
Removed:
################################################################################
diff --git a/llvm/test/CodeGen/X86/pr54369.ll b/llvm/test/CodeGen/X86/pr54369.ll
index 818b4f9d87ea3..ff6094120cf73 100644
--- a/llvm/test/CodeGen/X86/pr54369.ll
+++ b/llvm/test/CodeGen/X86/pr54369.ll
@@ -18,4 +18,22 @@ define i64 @adder(i64 %lhs, i64 %rhs) {
ret i64 %errorval
}
+ at a = global i32 0, align 4
+
+define i64 @adder_constexpr(i64 %lhs, i64 %rhs) {
+; CHECK-LABEL: adder_constexpr:
+; CHECK: # %bb.0:
+; CHECK-NEXT: addq %rsi, %rdi
+; CHECK-NEXT: seto %al
+; CHECK-NEXT: movq a at GOTPCREL(%rip), %rax
+; CHECK-NEXT: addq $5, %rax
+; CHECK-NEXT: movl $148, %ecx
+; CHECK-NEXT: cmovoq %rcx, %rax
+; CHECK-NEXT: retq
+ %res = call { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %lhs, i64 %rhs)
+ %errorbit = extractvalue { i64, i1 } %res, 1
+ %errorval = select i1 %errorbit, i64 148, i64 add (i64 ptrtoint (i32* @a to i64), i64 5)
+ ret i64 %errorval
+}
+
declare { i64, i1 } @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)
More information about the llvm-commits
mailing list