aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopSimplify.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2007-10-28 12:59:45 +0000
committerDuncan Sands <baldrick@free.fr>2007-10-28 12:59:45 +0000
commit1826deda685d7f6eed9a20515e5476d4fd8505b9 (patch)
tree761f1b9df81e840207ea2c987f13abd2227c4cbd /llvm/lib/Transforms/Utils/LoopSimplify.cpp
parentc826ac533bea863673501dc986902bb192fa9d73 (diff)
downloadllvm-1826deda685d7f6eed9a20515e5476d4fd8505b9.zip
llvm-1826deda685d7f6eed9a20515e5476d4fd8505b9.tar.gz
llvm-1826deda685d7f6eed9a20515e5476d4fd8505b9.tar.bz2
The guaranteed alignment of ptr+offset is only the minimum of
of offset and the alignment of ptr if these are both powers of 2. While the ptr alignment is guaranteed to be a power of 2, there is no reason to think that offset is. For example, if offset is 12 (the size of a long double on x86-32 linux) and the alignment of ptr is 8, then the alignment of ptr+offset will in general be 4, not 8. Introduce a function MinAlign, lifted from gcc, for computing the minimum guaranteed alignment. I've tried to fix up everywhere under lib/CodeGen/SelectionDAG/. I also changed some places that weren't wrong (because both values were a power of 2), as a defensive change against people copying and pasting the code. Hopefully someone who cares about alignment will review the rest of LLVM and fix up the remaining places. Since I'm on x86 I'm not very motivated to do this myself... llvm-svn: 43421
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopSimplify.cpp')
0 files changed, 0 insertions, 0 deletions