[llvm] 9c0f957 - [InstCombine] Add test for load type conversion with !noundef (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 19 07:50:53 PST 2023
Author: Nikita Popov
Date: 2023-01-19T16:50:45+01:00
New Revision: 9c0f9572e21e8ef9cdbab4ead88e02cc53e7ad1f
URL: https://github.com/llvm/llvm-project/commit/9c0f9572e21e8ef9cdbab4ead88e02cc53e7ad1f
DIFF: https://github.com/llvm/llvm-project/commit/9c0f9572e21e8ef9cdbab4ead88e02cc53e7ad1f.diff
LOG: [InstCombine] Add test for load type conversion with !noundef (NFC)
The !noundef metadata is currently dropped.
Added:
Modified:
llvm/test/Transforms/InstCombine/loadstore-metadata.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/loadstore-metadata.ll b/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
index d0c62b1eee02..5205b7d3f539 100644
--- a/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
+++ b/llvm/test/Transforms/InstCombine/loadstore-metadata.ll
@@ -76,8 +76,8 @@ define ptr @test_load_cast_combine_align(ptr %ptr) {
; metadata.
; CHECK-LABEL: @test_load_cast_combine_align(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !align !8
-; CHECK-NEXT: ret ptr [[L1]]
+; CHECK-NEXT: [[L:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !align !8
+; CHECK-NEXT: ret ptr [[L]]
;
entry:
%l = load ptr, ptr %ptr, !align !9
@@ -89,8 +89,8 @@ define ptr @test_load_cast_combine_deref(ptr %ptr) {
; metadata.
; CHECK-LABEL: @test_load_cast_combine_deref(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !dereferenceable !8
-; CHECK-NEXT: ret ptr [[L1]]
+; CHECK-NEXT: [[L:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !dereferenceable !8
+; CHECK-NEXT: ret ptr [[L]]
;
entry:
%l = load ptr, ptr %ptr, !dereferenceable !9
@@ -102,8 +102,8 @@ define ptr @test_load_cast_combine_deref_or_null(ptr %ptr) {
; dereferenceable_or_null metadata.
; CHECK-LABEL: @test_load_cast_combine_deref_or_null(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[L1:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !dereferenceable_or_null !8
-; CHECK-NEXT: ret ptr [[L1]]
+; CHECK-NEXT: [[L:%.*]] = load ptr, ptr [[PTR:%.*]], align 8, !dereferenceable_or_null !8
+; CHECK-NEXT: ret ptr [[L]]
;
entry:
%l = load ptr, ptr %ptr, !dereferenceable_or_null !9
@@ -122,7 +122,7 @@ define void @test_load_cast_combine_loop(ptr %src, ptr %dst, i32 %n) {
; CHECK-NEXT: [[SRC_GEP:%.*]] = getelementptr inbounds float, ptr [[SRC:%.*]], i64 [[TMP0]]
; CHECK-NEXT: [[TMP1:%.*]] = sext i32 [[I]] to i64
; CHECK-NEXT: [[DST_GEP:%.*]] = getelementptr inbounds i32, ptr [[DST:%.*]], i64 [[TMP1]]
-; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[SRC_GEP]], align 4, !llvm.access.group !9
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[SRC_GEP]], align 4, !llvm.access.group [[ACC_GRP9:![0-9]+]]
; CHECK-NEXT: store i32 [[L1]], ptr [[DST_GEP]], align 4
; CHECK-NEXT: [[I_NEXT]] = add i32 [[I]], 1
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[I_NEXT]], [[N:%.*]]
@@ -163,6 +163,16 @@ entry:
ret void
}
+define i32 @test_load_cast_combine_noundef(ptr %ptr) {
+; CHECK-LABEL: @test_load_cast_combine_noundef(
+; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[PTR:%.*]], align 4
+; CHECK-NEXT: ret i32 [[L1]]
+;
+ %l = load float, ptr %ptr, !noundef !{}
+ %c = bitcast float %l to i32
+ ret i32 %c
+}
+
!0 = !{!1, !1, i64 0}
!1 = !{!"scalar type", !2}
!2 = !{!"root"}
More information about the llvm-commits
mailing list