[llvm] [AMDGPU] Fold redundant inf/nan checks into frexp instructions (PR #214936)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 8 03:01:55 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- llvm/lib/Target/AMDGPU/AMDGPUISelLowering.cpp llvm/lib/Target/AMDGPU/AMDGPUISelLowering.h llvm/lib/Target/AMDGPU/SIISelLowering.cpp llvm/lib/Target/AMDGPU/SIISelLowering.h --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
index ae550ebbe..f67fe5293 100644
--- a/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
+++ b/llvm/lib/Target/AMDGPU/SIISelLowering.cpp
@@ -18870,12 +18870,10 @@ SITargetLowering::performFrexpSelectCombine(SDNode *N,
// Check if FrexpVal comes from amdgcn_frexp_exp or amdgcn_frexp_mant.
SDValue FrexpInput;
- if (!sd_match(FrexpVal,
- m_IntrinsicWOChain<Intrinsic::amdgcn_frexp_exp>(
- m_Value(FrexpInput))) &&
- !sd_match(FrexpVal,
- m_IntrinsicWOChain<Intrinsic::amdgcn_frexp_mant>(
- m_Value(FrexpInput))))
+ if (!sd_match(FrexpVal, m_IntrinsicWOChain<Intrinsic::amdgcn_frexp_exp>(
+ m_Value(FrexpInput))) &&
+ !sd_match(FrexpVal, m_IntrinsicWOChain<Intrinsic::amdgcn_frexp_mant>(
+ m_Value(FrexpInput))))
return SDValue();
// The frexp intrinsics ignore sign, so we can strip sign ops when comparing.
``````````
</details>
https://github.com/llvm/llvm-project/pull/214936
More information about the llvm-commits
mailing list