[llvm] add `frexp`/`ldexp` expansion in `ExpandIrInsts` (PR #208556)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 13 12:31:33 PDT 2026


================
@@ -546,6 +548,220 @@ static bool expandFRem(BinaryOperator &I, std::optional<SimplifyQuery> &SQ) {
 
   return true;
 }
+
+static void expandLdexp(IntrinsicInst *II) {
+  LLVM_DEBUG(dbgs() << "Expanding instruction: " << *II << '\n');
+
+  IRBuilder<> B(II);
+  B.SetCurrentDebugLocation(II->getDebugLoc());
+  LLVMContext &Ctx = II->getContext();
+
+  Type *VT = II->getType();
+  Value *X = II->getArgOperand(0);
+  Value *N = II->getArgOperand(1);
+  Type *ExpVT = N->getType();
+  Type *AsIntVT = B.getIntNTy(VT->getScalarSizeInBits());
+
+  const fltSemantics &FltSem = VT->getFltSemantics();
----------------
arsenm wrote:

This will assert for vector types 

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


More information about the llvm-commits mailing list