[LLVMdev] Is shortening a load a bug?

Reid Kleckner rnk at google.com
Thu Sep 11 21:10:27 PDT 2014


On Thu, Sep 11, 2014 at 5:17 PM, bagel <bagel99 at gmail.com> wrote:
>
> The phrase "As long as loading an i8 is legal" is the whole point.  What
> if it isn't?  How do I specify that (should of specifying the load as
> volatile, which is overkill)?  As an author of a front end, I want to know
> what the contract is when I say load 32-bits?  When I say load 32-bits I
> mean load 32-bits.
>
> I think it's a bug because there is no good way do avoid it and it breaks
> device drivers.


This sounds like the *exact* use case for volatile, where the load is
observable in some way other than the result that it is used for. If i8 is
a legal type for the rest of your ISA, then this should be a volatile load.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140911/edf3d85c/attachment.html>


More information about the llvm-dev mailing list