Karl Rehm via llvm-dev
2021-Jun-14 22:32 UTC
[llvm-dev] Weird pointer alignment behavior on x86_32 - intentional or not?
Hello, I'm trying to figure out why LLVM generates different code between Windows and other targets when it comes to a simple pointer dereference. I've narrowed it down to alignment, but I'm confused as to why this happens. Is this behavior intentional? https://godbolt.org/z/f18WxzW11 -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210614/62be85a8/attachment.html>
Karl Rehm via llvm-dev
2021-Jun-15 02:28 UTC
[llvm-dev] Weird pointer alignment behavior on x86_32 - intentional or not?
Update: This might be an issue with optimization ordering. Forcing DAGCombiner::isAlias to return true (everything aliases) causes things to go as expected. The difference in architectures is because the alignment on other platforms is 4 bytes whereas on Windows it's 8, causing the alias analysis to succeed on Windows but not on other platforms. On Mon, Jun 14, 2021 at 6:32 PM Karl Rehm <klrehm123 at gmail.com> wrote:> Hello, > I'm trying to figure out why LLVM generates different code between Windows > and other targets when it comes to a simple pointer dereference. I've > narrowed it down to alignment, but I'm confused as to why this happens. Is > this behavior intentional? > > https://godbolt.org/z/f18WxzW11 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210614/029c500d/attachment.html>