[llvm] d589372 - [SCCP] Extend nonnull metadata test (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 12 08:48:44 PDT 2020
Author: Nikita Popov
Date: 2020-07-12T17:48:32+02:00
New Revision: d589372704fc7da0c143cbfe27f930a9d7dd333b
URL: https://github.com/llvm/llvm-project/commit/d589372704fc7da0c143cbfe27f930a9d7dd333b
DIFF: https://github.com/llvm/llvm-project/commit/d589372704fc7da0c143cbfe27f930a9d7dd333b.diff
LOG: [SCCP] Extend nonnull metadata test (NFC)
Added:
Modified:
llvm/test/Transforms/SCCP/metadata.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/SCCP/metadata.ll b/llvm/test/Transforms/SCCP/metadata.ll
index 43e4c59571e9..844e2103ae31 100644
--- a/llvm/test/Transforms/SCCP/metadata.ll
+++ b/llvm/test/Transforms/SCCP/metadata.ll
@@ -44,16 +44,39 @@ define i32 @load_range_single_volatile(i32* %p) {
ret i32 %v
}
-define void @load_nonnull(i32** %p) {
+define void @load_nonnull(i32** %p, i32** %p2) {
; CHECK-LABEL: @load_nonnull(
; CHECK-NEXT: [[V:%.*]] = load i32*, i32** [[P:%.*]], align 8, !nonnull !2
+; CHECK-NEXT: [[V2:%.*]] = load i32*, i32** [[P2:%.*]], align 8, !nonnull !2
; CHECK-NEXT: [[C1:%.*]] = icmp ne i32* [[V]], null
; CHECK-NEXT: call void @use(i1 [[C1]])
+; CHECK-NEXT: [[C2:%.*]] = icmp eq i32* [[V]], null
+; CHECK-NEXT: call void @use(i1 [[C2]])
+; CHECK-NEXT: [[C3:%.*]] = icmp ne i32* null, [[V]]
+; CHECK-NEXT: call void @use(i1 [[C3]])
+; CHECK-NEXT: [[C4:%.*]] = icmp eq i32* null, [[V]]
+; CHECK-NEXT: call void @use(i1 [[C4]])
+; CHECK-NEXT: [[C5:%.*]] = icmp eq i32* [[V]], [[V2]]
+; CHECK-NEXT: call void @use(i1 [[C5]])
+; CHECK-NEXT: [[C6:%.*]] = icmp ne i32* [[V]], [[V2]]
+; CHECK-NEXT: call void @use(i1 [[C6]])
; CHECK-NEXT: ret void
;
%v = load i32*, i32** %p, !nonnull !{}
+ %v2 = load i32*, i32** %p2, !nonnull !{}
%c1 = icmp ne i32* %v, null
call void @use(i1 %c1)
+ %c2 = icmp eq i32* %v, null
+ call void @use(i1 %c2)
+ %c3 = icmp ne i32* null, %v
+ call void @use(i1 %c3)
+ %c4 = icmp eq i32* null, %v
+ call void @use(i1 %c4)
+ ; There is no particular relationship between two nonnull values.
+ %c5 = icmp eq i32* %v, %v2
+ call void @use(i1 %c5)
+ %c6 = icmp ne i32* %v, %v2
+ call void @use(i1 %c6)
ret void
}
More information about the llvm-commits
mailing list