[PATCH] D57335: [IR] Don't assume all functions are 4 byte aligned
Michael Platings via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 25 09:34:10 PST 2019
michaelplatings marked 4 inline comments as done.
michaelplatings added inline comments.
Comment at: llvm/lib/IR/ConstantFold.cpp:1087
+ if (GVAlign == 0U && isa<Function>(GV))
+ GVAlign = 4U;
> Using "4" as a default is dangerous; on x86, the alignment of the pointer corresponds to the alignment of the function, but might be less than 4 if it isn't explicitly specified.
I've put in a comment to say as much. Sadly I'm not in a position to change this behaviour without causing a code size regression.
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
More information about the cfe-commits