This is an archive of the discontinued LLVM Phabricator instance.

Fix pointer EVT in SelectionDAGBuilder::visitAlloca
ClosedPublic

Authored by yaxunl on Nov 15 2017, 12:35 PM.

Details

Summary

SelectionDAGBuilder::visitAlloca assumes alloca address space is 0, which is
incorrect for triple amdgcn---amdgiz and causes isel failure.

This patch fixes that.

Diff Detail

Repository
rL LLVM

Event Timeline

yaxunl created this revision.Nov 15 2017, 12:35 PM
rampitec added inline comments.Nov 15 2017, 12:54 PM
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
3526 ↗(On Diff #123072)

Should not DAG.getIntPtrConstant() take an address space and pass it to the TLI.getPointerTy()?

yaxunl added inline comments.Nov 15 2017, 6:53 PM
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
3526 ↗(On Diff #123072)

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.

This revision is now accepted and ready to land.Nov 15 2017, 6:56 PM
This revision was automatically updated to reflect the committed changes.