Skip to content

InstCombine: Add baseline test for minimumnum/maximumnum freeze fold #138728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions llvm/test/Transforms/InstCombine/freeze-fp-ops.ll
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,28 @@ define float @freeze_maximum(float %arg0, float noundef %arg1) {
ret float %freeze
}

define float @freeze_minimumnum(float %arg0, float noundef %arg1) {
; CHECK-LABEL: @freeze_minimumnum(
; CHECK-NEXT: [[OP:%.*]] = call float @llvm.minimumnum.f32(float [[ARG0:%.*]], float noundef [[ARG1:%.*]])
; CHECK-NEXT: [[FREEZE:%.*]] = freeze float [[OP]]
; CHECK-NEXT: ret float [[FREEZE]]
;
%op = call float @llvm.minimumnum.f32(float %arg0, float noundef %arg1)
%freeze = freeze float %op
ret float %freeze
}

define float @freeze_maximumnum(float %arg0, float noundef %arg1) {
; CHECK-LABEL: @freeze_maximumnum(
; CHECK-NEXT: [[OP:%.*]] = call float @llvm.maximumnum.f32(float [[ARG0:%.*]], float noundef [[ARG1:%.*]])
; CHECK-NEXT: [[FREEZE:%.*]] = freeze float [[OP]]
; CHECK-NEXT: ret float [[FREEZE]]
;
%op = call float @llvm.maximumnum.f32(float %arg0, float noundef %arg1)
%freeze = freeze float %op
ret float %freeze
}

define i1 @freeze_isfpclass(float %arg0) {
; CHECK-LABEL: @freeze_isfpclass(
; CHECK-NEXT: [[ARG0_FR:%.*]] = freeze float [[ARG0:%.*]]
Expand Down
Loading