[PATCH] SROA fix to avoid invalid bitcast generation when converting a load from a double pointer bitcasted with an address space change of the pointee pointee
chandlerc at gmail.com
Fri Mar 7 11:39:10 PST 2014
On Fri, Mar 7, 2014 at 11:35 AM, Matt Arsenault <arsenm2 at gmail.com> wrote:
> On Mar 7, 2014, at 11:18 AM, Chandler Carruth <chandlerc at gmail.com> wrote:
> 1) I don't understand why we don't allow bitcasting between address spaces
> when they are the same size. We have the datalayout embedded in the module,
> we should be able to verify this, etc etc. Breaking the same-size "as if"
> semantics of bitcast seems a pointless limitation.
> Pointers with different address spaces may have different representations
> and could need a nontrivial transformation between them.
Yes, I'm suggesting that bitcast should *not* do what addrspacecast does,
but shoudl do what storing and loading the bits does.
This might produce a garbage pointer, but garbage in, garbage out. Making
it invalid IR seems like it makes things like SROA unnecessarily complex.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-commits