Update test scripts were limited because they performed a single action on the entire file and if that action was controlled by arguments, like the one introduced in D68819, there was no record of it. This patch introduces the capability of changing the arguments passed to the script "on-the-fly" while processing a test file. In addition, an "on/off" switch was added so that processing can be disabled for parts of the file where the content is simply copied. The last extension is a record of the invocation arguments in the auto generated NOTE. These arguments are also picked up in a subsequent invocation, allowing updates with special options enabled without user interaction. To change the arguments the string `UTC_ARGS:` has to be present in a line, followed by "additional command line arguments". That is everything that follows `UTC_ARGS:` will be added to a growing list of "command line arguments" which is reparsed after every update. Reviewed By: arichardson Differential Revision: https://reviews.llvm.org/D69701
56 lines
1.5 KiB
Plaintext
56 lines
1.5 KiB
Plaintext
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature
|
|
; Example input for update_llc_test_checks (taken from test/Transforms/InstSimplify/add.ll)
|
|
; RUN: opt < %s -instsimplify -S | FileCheck %s
|
|
|
|
define i32 @common_sub_operand(i32 %X, i32 %Y) {
|
|
; CHECK-LABEL: define {{[^@]+}}@common_sub_operand
|
|
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]])
|
|
; CHECK-NEXT: ret i32 [[X]]
|
|
;
|
|
%Z = sub i32 %X, %Y
|
|
%Q = add i32 %Z, %Y
|
|
ret i32 %Q
|
|
}
|
|
|
|
define i32 @negated_operand(i32 %x) {
|
|
; CHECK-LABEL: define {{[^@]+}}@negated_operand
|
|
; CHECK-SAME: (i32 [[X:%.*]])
|
|
; CHECK-NEXT: ret i32 0
|
|
;
|
|
%negx = sub i32 0, %x
|
|
%r = add i32 %negx, %x
|
|
ret i32 %r
|
|
}
|
|
|
|
define <2 x i32> @negated_operand_commute_vec(<2 x i32> %x) {
|
|
; CHECK-LABEL: define {{[^@]+}}@negated_operand_commute_vec
|
|
; CHECK-SAME: (<2 x i32> [[X:%.*]])
|
|
; CHECK-NEXT: ret <2 x i32> zeroinitializer
|
|
;
|
|
%negx = sub <2 x i32> zeroinitializer, %x
|
|
%r = add <2 x i32> %x, %negx
|
|
ret <2 x i32> %r
|
|
}
|
|
|
|
define i8 @knownnegation(i8 %x, i8 %y) {
|
|
; CHECK-LABEL: define {{[^@]+}}@knownnegation
|
|
; CHECK-SAME: (i8 [[X:%.*]], i8 [[Y:%.*]])
|
|
; CHECK-NEXT: ret i8 0
|
|
;
|
|
%xy = sub i8 %x, %y
|
|
%yx = sub i8 %y, %x
|
|
%r = add i8 %xy, %yx
|
|
ret i8 %r
|
|
}
|
|
|
|
define <2 x i8> @knownnegation_commute_vec(<2 x i8> %x, <2 x i8> %y) {
|
|
; CHECK-LABEL: define {{[^@]+}}@knownnegation_commute_vec
|
|
; CHECK-SAME: (<2 x i8> [[X:%.*]], <2 x i8> [[Y:%.*]])
|
|
; CHECK-NEXT: ret <2 x i8> zeroinitializer
|
|
;
|
|
%xy = sub <2 x i8> %x, %y
|
|
%yx = sub <2 x i8> %y, %x
|
|
%r = add <2 x i8> %yx, %xy
|
|
ret <2 x i8> %r
|
|
}
|