diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2023-08-11 15:05:36 -0400 |
---|---|---|
committer | Matt Arsenault <arsenm2@gmail.com> | 2023-09-13 08:38:48 +0300 |
commit | edecb6048148b7c22cfe567ccbf2dba5e1000bdc (patch) | |
tree | c4eed491dc576e52622254b2ccd6c3ea944ff87d /llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp | |
parent | 00061843bd93b7dd9f83e1448e569e193c22ccf8 (diff) | |
download | llvm-edecb6048148b7c22cfe567ccbf2dba5e1000bdc.zip llvm-edecb6048148b7c22cfe567ccbf2dba5e1000bdc.tar.gz llvm-edecb6048148b7c22cfe567ccbf2dba5e1000bdc.tar.bz2 |
Reapply "AMDGPU: Drop and auto-upgrade llvm.amdgcn.ldexp to llvm.ldexp"
This reverts commit d9333e360a7c52587ab6e4328e7493b357fb2cf3.
Diffstat (limited to 'llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp')
-rw-r--r-- | llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp b/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp index 992f996..f49945d 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp +++ b/llvm/lib/Target/AMDGPU/AMDGPUInstCombineIntrinsic.cpp @@ -1048,50 +1048,6 @@ GCNTTIImpl::instCombineIntrinsic(InstCombiner &IC, IntrinsicInst &II) const { break; } - case Intrinsic::amdgcn_ldexp: { - // FIXME: This doesn't introduce new instructions and belongs in - // InstructionSimplify. - Type *Ty = II.getType(); - Value *Op0 = II.getArgOperand(0); - Value *Op1 = II.getArgOperand(1); - - // Folding undef to qnan is safe regardless of the FP mode. - if (isa<UndefValue>(Op0)) { - auto *QNaN = ConstantFP::get(Ty, APFloat::getQNaN(Ty->getFltSemantics())); - return IC.replaceInstUsesWith(II, QNaN); - } - - const APFloat *C = nullptr; - match(Op0, PatternMatch::m_APFloat(C)); - - // FIXME: Should flush denorms depending on FP mode, but that's ignored - // everywhere else. - // - // These cases should be safe, even with strictfp. - // ldexp(0.0, x) -> 0.0 - // ldexp(-0.0, x) -> -0.0 - // ldexp(inf, x) -> inf - // ldexp(-inf, x) -> -inf - if (C && (C->isZero() || C->isInfinity())) { - return IC.replaceInstUsesWith(II, Op0); - } - - // With strictfp, be more careful about possibly needing to flush denormals - // or not, and snan behavior depends on ieee_mode. - if (II.isStrictFP()) - break; - - if (C && C->isNaN()) - return IC.replaceInstUsesWith(II, ConstantFP::get(Ty, C->makeQuiet())); - - // ldexp(x, 0) -> x - // ldexp(x, undef) -> x - if (isa<UndefValue>(Op1) || match(Op1, PatternMatch::m_ZeroInt())) { - return IC.replaceInstUsesWith(II, Op0); - } - - break; - } case Intrinsic::amdgcn_fmul_legacy: { Value *Op0 = II.getArgOperand(0); Value *Op1 = II.getArgOperand(1); |