[llvm] [SimplifyLibCalls] Constant fold scalbxx (PR #114417)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Nov  6 06:20:24 PST 2024
    
    
  
================
@@ -2621,6 +2623,21 @@ static Constant *ConstantFoldLibCall2(StringRef Name, Type *Ty,
   switch (Func) {
   default:
     break;
+  case LibFunc_ldexp:
+  case LibFunc_ldexpf:
+  case LibFunc_ldexpl:
+  case LibFunc_scalbn:
+  case LibFunc_scalbnf:
+  case LibFunc_scalbnl:
+  case LibFunc_scalbln:
+  case LibFunc_scalblnf:
+  case LibFunc_scalblnl:
+    if (TLI->has(Func)) {
+      APFloat ret =
+          llvm::scalbn(Op1V, Op2V.convertToDouble(), RoundingMode::TowardZero);
----------------
fawdlstty wrote:
> There should be no conversion, this code is dead
I don't know how to remove the conversion here, it only accepts int type, causing the compilation to fail
https://github.com/llvm/llvm-project/pull/114417
    
    
More information about the llvm-commits
mailing list