[llvm] 4df6f3f - InstCombine: Stop using grep in some tests
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 20:09:01 PST 2022
Author: Matt Arsenault
Date: 2022-12-01T23:08:57-05:00
New Revision: 4df6f3f8a36af2a655edc76808b6fd98f523c08b
URL: https://github.com/llvm/llvm-project/commit/4df6f3f8a36af2a655edc76808b6fd98f523c08b
DIFF: https://github.com/llvm/llvm-project/commit/4df6f3f8a36af2a655edc76808b6fd98f523c08b.diff
LOG: InstCombine: Stop using grep in some tests
Switch to FileCheck and generated checks.
Added:
Modified:
llvm/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll b/llvm/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
index 3e79cc90abc7..15ccce5ebc65 100644
--- a/llvm/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
+++ b/llvm/test/Transforms/InstCombine/2008-04-22-ByValBitcast.ll
@@ -1,15 +1,23 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
;; The bitcast cannot be eliminated because byval arguments need
;; the correct type, or at least a type of the correct size.
-; RUN: opt < %s -passes=instcombine -S | grep bitcast
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128"
target triple = "i386-apple-darwin9"
- %struct.NSRect = type { [4 x float] }
+
+%struct.NSRect = type { [4 x float] }
define void @foo(i8* %context) nounwind {
+; CHECK-LABEL: @foo(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[TMP1:%.*]] = bitcast i8* [[CONTEXT:%.*]] to %struct.NSRect*
+; CHECK-NEXT: call void (i32, ...) @bar(i32 3, %struct.NSRect* byval([[STRUCT_NSRECT:%.*]]) align 4 [[TMP1]]) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: ret void
+;
entry:
- %tmp1 = bitcast i8* %context to %struct.NSRect* ; <%struct.NSRect*> [#uses=1]
- call void (i32, ...) @bar( i32 3, %struct.NSRect* byval(%struct.NSRect) align 4 %tmp1 ) nounwind
- ret void
+ %tmp1 = bitcast i8* %context to %struct.NSRect* ; <%struct.NSRect*> [#uses=1]
+ call void (i32, ...) @bar( i32 3, %struct.NSRect* byval(%struct.NSRect) align 4 %tmp1 ) nounwind
+ ret void
}
declare void @bar(i32, ...)
diff --git a/llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll b/llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll
index 383fa367b688..aa7f1f3093e7 100644
--- a/llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll
+++ b/llvm/test/Transforms/InstCombine/fp-ret-bitcast.ll
@@ -1,28 +1,42 @@
-; RUN: opt < %s -passes=instcombine -S | \
-; RUN: grep "call float bitcast" | count 1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
+; RUN: opt -S -passes=instcombine < %s | FileCheck %s
+; Check that there's a call one call to @objc_msgSend_fpret with a
+; float result
+
target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
- %struct.NSObject = type { %struct.objc_class* }
- %struct.NSArray = type { %struct.NSObject }
- %struct.objc_class = type opaque
- %struct.objc_selector = type opaque
+%struct.NSObject = type { %struct.objc_class* }
+%struct.NSArray = type { %struct.NSObject }
+%struct.objc_class = type opaque
+%struct.objc_selector = type opaque
@"\01L_OBJC_METH_VAR_NAME_112" = internal global [15 x i8] c"whiteComponent\00", section "__TEXT,__cstring,cstring_literals"
@"\01L_OBJC_SELECTOR_REFERENCES_81" = internal global %struct.objc_selector* bitcast ([15 x i8]* @"\01L_OBJC_METH_VAR_NAME_112" to %struct.objc_selector*), section "__OBJC,__message_refs,literal_pointers,no_dead_strip"
define void @bork() nounwind {
+; CHECK-LABEL: @bork(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[COLOR:%.*]] = alloca %struct.NSArray*, align 8
+; CHECK-NEXT: [[TMP103:%.*]] = load %struct.NSArray*, %struct.NSArray** [[COLOR]], align 8
+; CHECK-NEXT: [[TMP103104:%.*]] = getelementptr [[STRUCT_NSARRAY:%.*]], %struct.NSArray* [[TMP103]], i64 0, i32 0
+; CHECK-NEXT: [[TMP105:%.*]] = load %struct.objc_selector*, %struct.objc_selector** @"\01L_OBJC_SELECTOR_REFERENCES_81", align 8
+; CHECK-NEXT: [[TMP107:%.*]] = call float bitcast (void (%struct.NSObject*, ...)* @objc_msgSend_fpret to float (%struct.NSObject*, %struct.objc_selector*)*)(%struct.NSObject* [[TMP103104]], %struct.objc_selector* [[TMP105]]) #[[ATTR0:[0-9]+]]
+; CHECK-NEXT: br label [[EXIT:%.*]]
+; CHECK: exit:
+; CHECK-NEXT: ret void
+;
entry:
- %color = alloca %struct.NSArray*
- %color.466 = alloca %struct.NSObject*
- %tmp103 = load %struct.NSArray*, %struct.NSArray** %color, align 4
- %tmp103104 = getelementptr %struct.NSArray, %struct.NSArray* %tmp103, i32 0, i32 0
- store %struct.NSObject* %tmp103104, %struct.NSObject** %color.466, align 4
- %tmp105 = load %struct.objc_selector*, %struct.objc_selector** @"\01L_OBJC_SELECTOR_REFERENCES_81", align 4
- %tmp106 = load %struct.NSObject*, %struct.NSObject** %color.466, align 4
- %tmp107 = call float bitcast (void (%struct.NSObject*, ...)* @objc_msgSend_fpret to float (%struct.NSObject*, %struct.objc_selector*)*)( %struct.NSObject* %tmp106, %struct.objc_selector* %tmp105 ) nounwind
- br label %exit
+ %color = alloca %struct.NSArray*
+ %color.466 = alloca %struct.NSObject*
+ %tmp103 = load %struct.NSArray*, %struct.NSArray** %color, align 4
+ %tmp103104 = getelementptr %struct.NSArray, %struct.NSArray* %tmp103, i32 0, i32 0
+ store %struct.NSObject* %tmp103104, %struct.NSObject** %color.466, align 4
+ %tmp105 = load %struct.objc_selector*, %struct.objc_selector** @"\01L_OBJC_SELECTOR_REFERENCES_81", align 4
+ %tmp106 = load %struct.NSObject*, %struct.NSObject** %color.466, align 4
+ %tmp107 = call float bitcast (void (%struct.NSObject*, ...)* @objc_msgSend_fpret to float (%struct.NSObject*, %struct.objc_selector*)*)( %struct.NSObject* %tmp106, %struct.objc_selector* %tmp105 ) nounwind
+ br label %exit
exit:
- ret void
+ ret void
}
declare void @objc_msgSend_fpret(%struct.NSObject*, ...)
More information about the llvm-commits
mailing list