[llvm] [SelectionDAG] Handling Oversized Alloca Types under 32 bit Mode to Avoid Code Generator Crash (PR #71472)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 03:01:34 PST 2023


================
@@ -4138,9 +4138,11 @@ void SelectionDAGBuilder::visitAlloca(const AllocaInst &I) {
                                           APInt(IntPtr.getScalarSizeInBits(),
                                                 TySize.getKnownMinValue())));
   else
-    AllocSize =
-        DAG.getNode(ISD::MUL, dl, IntPtr, AllocSize,
-                    DAG.getConstant(TySize.getFixedValue(), dl, IntPtr));
+    AllocSize = DAG.getNode(
+        ISD::MUL, dl, IntPtr, AllocSize,
+        DAG.getZExtOrTrunc(
+            DAG.getConstant(TySize.getFixedValue(), dl, MVT::getIntegerVT(64)),
----------------
arsenm wrote:

Something weird happened with the formatting here, I think a separate variable for the constant would help 

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


More information about the llvm-commits mailing list