[llvm-dev] [SDAG] Recovering pointer types

David Chisnall via llvm-dev llvm-dev at lists.llvm.org
Mon Dec 26 06:57:16 PST 2016


On 26 Dec 2016, at 15:49, Nemanja Ivanovic <nemanja.i.ibm at gmail.com> wrote:
> 
> David, thank you for the prompt response.
> I originally implemented this with a check of getAlignment(). However, both getAlignment() and getOriginalAlignment() on the <4 x i32> load return the stronger alignment (16) rather than the alignment that the i32* parameter would have (4).
> 
> So I am a bit stuck in terms of how to verify the original alignment.

It sounds as if the problem here is actually in the front end.  For your target, the alignment of <4 x i32> is 4, and so the load should have alignment 4.  For some reason, it’s being promoted to 16.  If this is clang, then it has probably decided that all 4-way vectors for your target must be naturally aligned.  You can change that in the TargetInfo object (I can’t remember if it’s the Basic or CodeGen one that you want for this) for your target.

David



More information about the llvm-dev mailing list