Thanks to visit codestin.com
Credit goes to github.com

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

Conversation

arsenm
Copy link
Contributor

@arsenm arsenm commented May 6, 2025

No description provided.

Copy link
Contributor Author

arsenm commented May 6, 2025

@arsenm arsenm marked this pull request as ready for review May 6, 2025 17:43
@llvmbot
Copy link
Member

llvmbot commented May 6, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Matt Arsenault (arsenm)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/138728.diff

1 Files Affected:

  • (modified) llvm/test/Transforms/InstCombine/freeze-fp-ops.ll (+22)
diff --git a/llvm/test/Transforms/InstCombine/freeze-fp-ops.ll b/llvm/test/Transforms/InstCombine/freeze-fp-ops.ll
index 9fb69015a8f7d..8bee84f23e147 100644
--- a/llvm/test/Transforms/InstCombine/freeze-fp-ops.ll
+++ b/llvm/test/Transforms/InstCombine/freeze-fp-ops.ll
@@ -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:%.*]]

Copy link
Contributor Author

arsenm commented May 6, 2025

Merge activity

  • May 6, 4:19 PM EDT: A user started a stack merge that includes this pull request via Graphite.
  • May 6, 4:22 PM EDT: Graphite rebased this pull request as part of a merge.
  • May 6, 4:24 PM EDT: @arsenm merged this pull request with Graphite.

@arsenm arsenm force-pushed the users/arsenm/instcombine/add-baseline-tests-minimumnum-maximumnum-freeze branch from 9c7a03f to 9e6aa16 Compare May 6, 2025 20:21
@arsenm arsenm merged commit deebf47 into main May 6, 2025
6 of 9 checks passed
@arsenm arsenm deleted the users/arsenm/instcombine/add-baseline-tests-minimumnum-maximumnum-freeze branch May 6, 2025 20:24
GeorgeARM pushed a commit to GeorgeARM/llvm-project that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants