This check is not compatible with opaque pointers. We can avoid it by adjusting the getPointerAlignment() implementation to avoid creating unnecessary ptrtoint expressions for bitcasted pointers. The code already uses OnlyIfReduced to not create an expression if it does not simplify, and this makes sure that folding a bitcast + ptrtoint into a ptrtoint doesn't count as a simplification.
Details
Details
Diff Detail
Diff Detail
Unit Tests
Unit Tests
Event Timeline
Comment Actions
Removing this "hack" is a good idea. From the TODO I'd assumed we simply ignore function pointer i2p uses that have no uses themselves. But this seems to work as well I guess, or at least there is no test (yet) to expose it doesn't. LG