[PATCH] D40095: Fix pointer EVT in SelectionDAGBuilder::visitAlloca

Yaxun Liu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 18:53:03 PST 2017


yaxunl added inline comments.


================
Comment at: lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp:3526
   Flags.setNoUnsignedWrap(true);
-  AllocSize = DAG.getNode(ISD::ADD, dl,
-                          AllocSize.getValueType(), AllocSize,
-                          DAG.getIntPtrConstant(StackAlign - 1, dl), Flags);
+  AllocSize = DAG.getNode(ISD::ADD, dl, AllocSize.getValueType(), AllocSize,
+                          DAG.getConstant(StackAlign - 1, dl, IntPtr), Flags);
----------------
rampitec wrote:
> Should not DAG.getIntPtrConstant() take an address space and pass it to the TLI.getPointerTy()?
getIntPtrConstant gets a constant with the size of a default pointer. It seems not so useful to let it accept an extra address space parameter except here. However, even here we don't need it since we can just use getConstant with EVT IntPtr.


https://reviews.llvm.org/D40095





More information about the llvm-commits mailing list