File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
llvm/test/Transforms/InstCombine Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -444,3 +444,16 @@ define float @negated_op_extra_use(float %x) {
444
444
%r = call float @llvm.maximum.f32 (float %negx , float %x )
445
445
ret float %r
446
446
}
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
+ }
Original file line number Diff line number Diff line change @@ -466,3 +466,16 @@ define float @negated_op_extra_use(float %x) {
466
466
%r = call float @llvm.maxnum.f32 (float %negx , float %x )
467
467
ret float %r
468
468
}
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
+ }
You can’t perform that action at this time.
0 commit comments