[llvm] [ConstantFold] Fold `ilogb` and `ilogbf` when the input parameter is a constant value. (PR #113014)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 19 07:27:28 PDT 2024


================
@@ -2131,7 +2133,8 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
     }
 #endif
 
-    if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy())
+    if (!Ty->isHalfTy() && !Ty->isFloatTy() && !Ty->isDoubleTy() &&
----------------
c8ef wrote:

> Probably should just handle this case before here, or just delete the whole check.

It appears that the check is necessary to guard certain types, such as vector or fp128 types.

https://github.com/llvm/llvm-project/pull/113014


More information about the llvm-commits mailing list