Skip to content

Commit 218aa72

Browse files
committed
[Transforms] Add pre-commit tests (NFC)
1 parent 0c90e88 commit 218aa72

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

llvm/test/Transforms/InstCombine/maximum.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,3 +444,16 @@ define float @negated_op_extra_use(float %x) {
444444
%r = call float @llvm.maximum.f32(float %negx, float %x)
445445
ret float %r
446446
}
447+
448+
define float @negated_op_extra_use_comm(float %x) {
449+
; CHECK-LABEL: @negated_op_extra_use_comm(
450+
; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
451+
; CHECK-NEXT: call void @use(float [[NEGX]])
452+
; CHECK-NEXT: [[R:%.*]] = call float @llvm.maximum.f32(float [[X]], float [[NEGX]])
453+
; CHECK-NEXT: ret float [[R]]
454+
;
455+
%negx = fneg float %x
456+
call void @use(float %negx)
457+
%r = call float @llvm.maximum.f32(float %x, float %negx)
458+
ret float %r
459+
}

llvm/test/Transforms/InstCombine/maxnum.ll

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,3 +466,16 @@ define float @negated_op_extra_use(float %x) {
466466
%r = call float @llvm.maxnum.f32(float %negx, float %x)
467467
ret float %r
468468
}
469+
470+
define float @negated_op_extra_use_comm(float %x) {
471+
; CHECK-LABEL: @negated_op_extra_use_comm(
472+
; CHECK-NEXT: [[NEGX:%.*]] = fneg float [[X:%.*]]
473+
; CHECK-NEXT: call void @use(float [[NEGX]])
474+
; CHECK-NEXT: [[R:%.*]] = call float @llvm.maxnum.f32(float [[X]], float [[NEGX]])
475+
; CHECK-NEXT: ret float [[R]]
476+
;
477+
%negx = fneg float %x
478+
call void @use(float %negx)
479+
%r = call float @llvm.maxnum.f32(float %x, float %negx)
480+
ret float %r
481+
}

0 commit comments

Comments
 (0)