When fast iseling a GEP, accumulate the offset rather than emitting a series of
authorChad Rosier <mcrosier@apple.com>
Thu, 17 Nov 2011 07:15:58 +0000 (07:15 +0000)
committerChad Rosier <mcrosier@apple.com>
Thu, 17 Nov 2011 07:15:58 +0000 (07:15 +0000)
commit478b06c9801f0b75c5216ce0886ac3d630d4fc7b
tree54fa90701be13d4ab0be4cfb05352cfec4de49be
parentec43d1f553cb440df1b435d3798063d0cba6a117
When fast iseling a GEP, accumulate the offset rather than emitting a series of
ADDs.  MaxOffs is used as a threshold to limit the size of the offset. Tradeoffs
being: (1) If we can't materialize the large constant then we'll cause fast-isel
to bail. (2) Too large of an offset can't be directly encoded in the ADD
resulting in a MOV+ADD.  Generally not a bad thing because otherwise we would
have had ADD+ADD, but on Thumb this turns into a MOVS+MOVT+ADD. Working on a fix
for that. (3) Conversely, too low of a threshold we'll miss opportunities to
coalesce ADDs.
rdar://10412592

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144886 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/FastISel.cpp
test/CodeGen/ARM/fast-isel-GEP-coalesce.ll [new file with mode: 0644]