[PATCH] D40604: [GlobalISel][IRTranslator] Fix crash during translation of zero sized loads and stores
Daniel Sanders via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 29 09:41:14 PST 2017
dsanders added inline comments.
================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:340-341
+ if (DL->getTypeStoreSize(LI.getType()) == 0)
+ return true;
+
----------------
aemerson wrote:
> dsanders wrote:
> > I'm not sure this is correct for the load. If the load result has a use then I'd expect -verify-machineinstrs to complain about a missing def. I think we need to emit an IMPLICIT_DEF.
> That would require getting an LLT for a zero size type to create a vreg and running into the initial cause of the crash.
>
> Also, is there anything meaningful you can do with the load result? You can't bitcast it to anything (I think?) and storing it won't result in a store being generated, so no instructions are emitted for the verifier.
You can return them and pass them to functions but that's the only cases I can think of. If we eliminate those uses too then it will LGTM
Repository:
rL LLVM
https://reviews.llvm.org/D40604
More information about the llvm-commits
mailing list