[llvm] [IRBuilder] Refactor for intrinsics const-folding (NFC) (PR #202738)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 9 12:05:18 PDT 2026


================
@@ -248,73 +248,79 @@ Value *IRBuilderBase::CreateStepVector(Type *DstType, const Twine &Name) {
   return ConstantVector::get(Indices);
 }
 
-CallInst *IRBuilderBase::CreateMemSet(Value *Ptr, Value *Val, Value *Size,
-                                      MaybeAlign Align, bool isVolatile,
-                                      const AAMDNodes &AAInfo) {
+Value *IRBuilderBase::CreateMemSet(Value *Ptr, Value *Val, Value *Size,
+                                   MaybeAlign Align, bool isVolatile,
+                                   const AAMDNodes &AAInfo) {
   Value *Ops[] = {Ptr, Val, Size, getInt1(isVolatile)};
   Type *Tys[] = {Ptr->getType(), Size->getType()};
 
-  CallInst *CI = CreateIntrinsic(Intrinsic::memset, Tys, Ops);
+  Value *V = CreateIntrinsic(Intrinsic::memset, Tys, Ops);
----------------
topperc wrote:

Would it make sense to have a version of CreateIntrinsic for things that can never constant fold?

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


More information about the llvm-commits mailing list