[PATCH] D39758: CodeGen: Fix pointer info in SplitVecOp_EXTRACT_VECTOR_ELT
Yaxun Liu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 7 15:04:34 PST 2017
yaxunl added inline comments.
================
Comment at: lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:1787
return DAG.getExtLoad(ISD::EXTLOAD, dl, N->getValueType(0), Store, StackPtr,
- MachinePointerInfo(), EltVT);
+ MachinePointerInfo(UndefValue::get(Type::getInt32PtrTy(
+ *DAG.getContext(), PtrInfo.getAddrSpace()))),
----------------
efriedma wrote:
> You can't use "UndefValue" here; a non-null "Value*" has to be something alias analysis will understand properly.
>
> If you want to actually get this right, you need to use MachinePointerInfo::getFixedStack(). (CreateStackTemporary doesn't explicitly return the FrameIndex, but you can extract it from the returned FrameIndexSDNode.) Or I guess we could add some way to represent an unknown pointer in a specific address-space, but that's probably not any simpler.
getFixedStack can only be used with frame index with a constant offset, but here the offset is not constant. Here we only need to carry the information about address space. Therefore undef with a specific address space. The backend won't perform any optimization based on that and only uses the address space information.
https://reviews.llvm.org/D39758
More information about the llvm-commits
mailing list