[PATCH] D40604: [GlobalISel][IRTranslator] Fix crash during translation of zero sized loads and stores

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 29 09:27:20 PST 2017


aemerson added inline comments.


================
Comment at: lib/CodeGen/GlobalISel/IRTranslator.cpp:340-341
 
+  if (DL->getTypeStoreSize(LI.getType()) == 0)
+    return true;
+
----------------
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.


Repository:
  rL LLVM

https://reviews.llvm.org/D40604





More information about the llvm-commits mailing list