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?
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.