Skip to content

Commit f2e787e

Browse files
committed
[InstCombine] Add some tests with reduced flag sets, NFC
We remove the combine for fmuladd with fast flag on PR90434, and add these tests with reduced flags to show they have identity results.
1 parent 2631531 commit f2e787e

File tree

1 file changed

+18
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+18
-0
lines changed

llvm/test/Transforms/InstCombine/fma.ll

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,24 @@ define float @fmuladd_fneg_x_fneg_y_fast(float %x, float %y, float %z) {
203203
ret float %fmuladd
204204
}
205205

206+
define float @fmuladd_unfold(float %x, float %y, float %z) {
207+
; CHECK-LABEL: @fmuladd_unfold(
208+
; CHECK-NEXT: [[FMULADD:%.*]] = call reassoc contract float @llvm.fmuladd.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])
209+
; CHECK-NEXT: ret float [[FMULADD]]
210+
;
211+
%fmuladd = call reassoc contract float @llvm.fmuladd.f32(float %x, float %y, float %z)
212+
ret float %fmuladd
213+
}
214+
215+
define <8 x half> @fmuladd_unfold_vec(<8 x half> %x, <8 x half> %y, <8 x half> %z) {
216+
; CHECK-LABEL: @fmuladd_unfold_vec(
217+
; CHECK-NEXT: [[FMULADD:%.*]] = call reassoc contract <8 x half> @llvm.fmuladd.v8f16(<8 x half> [[X:%.*]], <8 x half> [[Y:%.*]], <8 x half> [[Z:%.*]])
218+
; CHECK-NEXT: ret <8 x half> [[FMULADD]]
219+
;
220+
%fmuladd = call reassoc contract <8 x half> @llvm.fmuladd.v8f16(<8 x half> %x, <8 x half> %y, <8 x half> %z)
221+
ret <8 x half> %fmuladd
222+
}
223+
206224
define float @fmuladd_unary_fneg_x_unary_fneg_y_fast(float %x, float %y, float %z) {
207225
; CHECK-LABEL: @fmuladd_unary_fneg_x_unary_fneg_y_fast(
208226
; CHECK-NEXT: [[FMULADD:%.*]] = call fast float @llvm.fmuladd.f32(float [[X:%.*]], float [[Y:%.*]], float [[Z:%.*]])

0 commit comments

Comments
 (0)