[llvm] 7cbdb1e - [test] Precommit some tests for invariant group icmps
Arthur Eubanks via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 25 11:30:53 PDT 2021
Author: Arthur Eubanks
Date: 2021-08-25T11:30:11-07:00
New Revision: 7cbdb1ee7935036a5130bc15aeb4f9174b3b380e
URL: https://github.com/llvm/llvm-project/commit/7cbdb1ee7935036a5130bc15aeb4f9174b3b380e
DIFF: https://github.com/llvm/llvm-project/commit/7cbdb1ee7935036a5130bc15aeb4f9174b3b380e.diff
LOG: [test] Precommit some tests for invariant group icmps
Added:
Modified:
llvm/test/Transforms/InstCombine/invariant.group.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/invariant.group.ll b/llvm/test/Transforms/InstCombine/invariant.group.ll
index cbc2368342e3..7480242ee096 100644
--- a/llvm/test/Transforms/InstCombine/invariant.group.ll
+++ b/llvm/test/Transforms/InstCombine/invariant.group.ll
@@ -159,6 +159,34 @@ define i16 addrspace(42)* @skipWithDifferentTypesDifferentAddrspace(i8* %a) {
ret i16 addrspace(42)* %a3
}
+define i1 @icmp1(i8* %a) {
+; CHECK-LABEL: @icmp1(
+; CHECK-NEXT: [[A2:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* [[A:%.*]])
+; CHECK-NEXT: [[TMP1:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* [[A]])
+; CHECK-NEXT: [[R:%.*]] = icmp eq i8* [[A2]], [[TMP1]]
+; CHECK-NEXT: ret i1 [[R]]
+;
+ %a2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %a)
+ %a3 = call i8* @llvm.strip.invariant.group.p0i8(i8* %a2)
+ %r = icmp eq i8* %a2, %a3
+ ret i1 %r
+}
+
+define i1 @icmp2(i8* %a, i8* %b) {
+; CHECK-LABEL: @icmp2(
+; CHECK-NEXT: [[TMP1:%.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* [[A:%.*]])
+; CHECK-NEXT: [[TMP2:%.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* [[B:%.*]])
+; CHECK-NEXT: [[R:%.*]] = icmp eq i8* [[TMP1]], [[TMP2]]
+; CHECK-NEXT: ret i1 [[R]]
+;
+ %a2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %a)
+ %a3 = call i8* @llvm.strip.invariant.group.p0i8(i8* %a2)
+ %b2 = call i8* @llvm.strip.invariant.group.p0i8(i8* %b)
+ %b3 = call i8* @llvm.launder.invariant.group.p0i8(i8* %b2)
+ %r = icmp eq i8* %a3, %b3
+ ret i1 %r
+}
+
declare i8* @llvm.launder.invariant.group.p0i8(i8*)
declare i8 addrspace(42)* @llvm.launder.invariant.group.p42i8(i8 addrspace(42)*)
declare i8* @llvm.strip.invariant.group.p0i8(i8*)
More information about the llvm-commits
mailing list