[llvm] [InstCombine] Lower ilogb to bit operations for normal values (PR #218044)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 00:07:39 PDT 2026
================
@@ -3239,6 +3239,59 @@ Value *LibCallSimplifier::optimizeFdim(CallInst *CI, IRBuilderBase &B) {
return ConstantFP::get(CI->getType(), Difference);
}
+Value *LibCallSimplifier::optimizeILogB(CallInst *CI, IRBuilderBase &B) {
+ // Prevent the optimization from re-triggering and causing the fixpoint error.
+ if (CI->use_empty())
+ return nullptr;
+
+ Value *X = CI->getArgOperand(0);
+ Type *FTy = X->getType();
+
+ // Restricted to standard IEEE floats, doubles and fp128
+ if (!FTy->isFloatTy() && !FTy->isDoubleTy() && !FTy->isFP128Ty())
----------------
arsenm wrote:
Missing negative test for other long double types
https://github.com/llvm/llvm-project/pull/218044
More information about the llvm-commits
mailing list