[llvm] ed1ada7 - InstCombine: Don't use anonymous values in test

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 1 18:56:45 PST 2022


Author: Matt Arsenault
Date: 2022-12-01T21:55:06-05:00
New Revision: ed1ada752118a0aa12d10f7ec7b20c65b11038e8

URL: https://github.com/llvm/llvm-project/commit/ed1ada752118a0aa12d10f7ec7b20c65b11038e8
DIFF: https://github.com/llvm/llvm-project/commit/ed1ada752118a0aa12d10f7ec7b20c65b11038e8.diff

LOG: InstCombine: Don't use anonymous values in test

Also don't use grep because it's not 2002.

Added: 
    

Modified: 
    llvm/test/Transforms/InstCombine/X86/pr2645-1.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/Transforms/InstCombine/X86/pr2645-1.ll b/llvm/test/Transforms/InstCombine/X86/pr2645-1.ll
index 99cf523bf03a5..9f35c97088f0a 100644
--- a/llvm/test/Transforms/InstCombine/X86/pr2645-1.ll
+++ b/llvm/test/Transforms/InstCombine/X86/pr2645-1.ll
@@ -1,39 +1,68 @@
-; RUN: opt < %s -passes=instcombine -S | grep shufflevector
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
 ; PR2645
-
 ; instcombine shouldn't delete the shufflevector.
 
-define internal void @""(i8*, i32, i8*) {
-; <label>:3
-        br label %4
+define internal void @0(i8* %arg, i32 %arg1, i8* %arg2) {
+; CHECK-LABEL: @0(
+; CHECK-NEXT:  bb:
+; CHECK-NEXT:    br label [[BB3:%.*]]
+; CHECK:       bb3:
+; CHECK-NEXT:    [[DOT0:%.*]] = phi i32 [ 0, [[BB:%.*]] ], [ [[I17:%.*]], [[BB4:%.*]] ]
+; CHECK-NEXT:    [[I:%.*]] = icmp slt i32 [[DOT0]], [[ARG1:%.*]]
+; CHECK-NEXT:    br i1 [[I]], label [[BB4]], label [[BB18:%.*]]
+; CHECK:       bb4:
+; CHECK-NEXT:    [[TMP0:%.*]] = sext i32 [[DOT0]] to i64
+; CHECK-NEXT:    [[I5:%.*]] = getelementptr i8, i8* [[ARG2:%.*]], i64 [[TMP0]]
+; CHECK-NEXT:    [[TMP1:%.*]] = bitcast i8* [[I5]] to <1 x i64>*
+; CHECK-NEXT:    [[I71:%.*]] = load <1 x i64>, <1 x i64>* [[TMP1]], align 1
+; CHECK-NEXT:    [[I9:%.*]] = call <2 x i64> @foo(<1 x i64> [[I71]])
+; CHECK-NEXT:    [[I11:%.*]] = bitcast <2 x i64> [[I9]] to <8 x i16>
+; CHECK-NEXT:    [[I12:%.*]] = shufflevector <8 x i16> [[I11]], <8 x i16> poison, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
+; CHECK-NEXT:    [[I13:%.*]] = bitcast <8 x i16> [[I12]] to <4 x i32>
+; CHECK-NEXT:    [[I14:%.*]] = sitofp <4 x i32> [[I13]] to <4 x float>
+; CHECK-NEXT:    [[TMP2:%.*]] = sext i32 [[DOT0]] to i64
+; CHECK-NEXT:    [[I15:%.*]] = getelementptr i8, i8* [[ARG:%.*]], i64 [[TMP2]]
+; CHECK-NEXT:    [[I16:%.*]] = bitcast i8* [[I15]] to <4 x float>*
+; CHECK-NEXT:    store <4 x float> [[I14]], <4 x float>* [[I16]], align 1
+; CHECK-NEXT:    [[I17]] = add i32 [[DOT0]], 1
+; CHECK-NEXT:    br label [[BB3]]
+; CHECK:       bb18:
+; CHECK-NEXT:    call void @llvm.x86.mmx.emms()
+; CHECK-NEXT:    ret void
+;
+bb:
+  br label %bb3
 
-; <label>:4             ; preds = %6, %3
-        %.0 = phi i32 [ 0, %3 ], [ %19, %6 ]            ; <i32> [#uses=4]
-        %5 = icmp slt i32 %.0, %1               ; <i1> [#uses=1]
-        br i1 %5, label %6, label %20
+bb3:                                              ; preds = %bb4, %bb
+  %.0 = phi i32 [ 0, %bb ], [ %i17, %bb4 ]
+  %i = icmp slt i32 %.0, %arg1
+  br i1 %i, label %bb4, label %bb18
 
-; <label>:6             ; preds = %4
-        %7 = getelementptr i8, i8* %2, i32 %.0              ; <i8*> [#uses=1]
-        %8 = bitcast i8* %7 to <4 x i16>*               ; <<4 x i16>*> [#uses=1]
-        %9 = load <4 x i16>, <4 x i16>* %8, align 1                ; <<4 x i16>> [#uses=1]
-        %10 = bitcast <4 x i16> %9 to <1 x i64>         ; <<1 x i64>> [#uses=1]
-        %11 = call <2 x i64> @foo(<1 x i64> %10)
-; <<2 x i64>> [#uses=1]
-        %12 = bitcast <2 x i64> %11 to <4 x i32>                ; <<4 x i32>> [#uses=1]
-        %13 = bitcast <4 x i32> %12 to <8 x i16>                ; <<8 x i16>> [#uses=2]
-        %14 = shufflevector <8 x i16> %13, <8 x i16> %13, <8 x i32> < i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3 >          ; <<8 x i16>> [#uses=1]
-        %15 = bitcast <8 x i16> %14 to <4 x i32>                ; <<4 x i32>> [#uses=1]
-        %16 = sitofp <4 x i32> %15 to <4 x float>               ; <<4 x float>> [#uses=1]
-        %17 = getelementptr i8, i8* %0, i32 %.0             ; <i8*> [#uses=1]
-        %18 = bitcast i8* %17 to <4 x float>*           ; <<4 x float>*> [#uses=1]
-        store <4 x float> %16, <4 x float>* %18, align 1
-        %19 = add i32 %.0, 1            ; <i32> [#uses=1]
-        br label %4
+bb4:                                              ; preds = %bb3
+  %i5 = getelementptr i8, i8* %arg2, i32 %.0
+  %i6 = bitcast i8* %i5 to <4 x i16>*
+  %i7 = load <4 x i16>, <4 x i16>* %i6, align 1
+  %i8 = bitcast <4 x i16> %i7 to <1 x i64>
+  %i9 = call <2 x i64> @foo(<1 x i64> %i8)
+  %i10 = bitcast <2 x i64> %i9 to <4 x i32>
+  %i11 = bitcast <4 x i32> %i10 to <8 x i16>
+  %i12 = shufflevector <8 x i16> %i11, <8 x i16> %i11, <8 x i32> <i32 0, i32 0, i32 1, i32 1, i32 2, i32 2, i32 3, i32 3>
+  %i13 = bitcast <8 x i16> %i12 to <4 x i32>
+  %i14 = sitofp <4 x i32> %i13 to <4 x float>
+  %i15 = getelementptr i8, i8* %arg, i32 %.0
+  %i16 = bitcast i8* %i15 to <4 x float>*
+  store <4 x float> %i14, <4 x float>* %i16, align 1
+  %i17 = add i32 %.0, 1
+  br label %bb3
 
-; <label>:20            ; preds = %4
-        call void @llvm.x86.mmx.emms( )
-        ret void
+bb18:                                             ; preds = %bb3
+  call void @llvm.x86.mmx.emms()
+  ret void
 }
 
 declare <2 x i64> @foo(<1 x i64>)
-declare void @llvm.x86.mmx.emms( )
+
+declare void @llvm.x86.mmx.emms() #0
+
+attributes #0 = { nounwind }


        


More information about the llvm-commits mailing list