diff options
author | Chris Lattner <sabre@nondot.org> | 2007-04-13 20:42:26 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2007-04-13 20:42:26 +0000 |
commit | c5494af8a90f398046c45bc2b7549ab9004c01d9 (patch) | |
tree | 86ae95bed5e1139870b5a51635f98a2ec912a293 /lib/Support/SmallPtrSet.cpp | |
parent | 3bd767b91d1642fa5aed4ff230d76ce648d247da (diff) |
Now that codegen prepare isn't defeating me, I can finally fix what I set
out to do! :)
This fixes a problem where LSR would insert a bunch of code into each MBB
that uses a particular subexpression (e.g. IV+base+C). The problem is that
this code cannot be CSE'd back together if inserted into different blocks.
This patch changes LSR to attempt to insert a single copy of this code and
share it, allowing codegenprepare to duplicate the code if it can be sunk
into various addressing modes. On CodeGen/ARM/lsr-code-insertion.ll,
for example, this gives us code like:
add r8, r0, r5
str r6, [r8, #+4]
..
ble LBB1_4 @cond_next
LBB1_3: @cond_true
str r10, [r8, #+4]
LBB1_4: @cond_next
...
LBB1_5: @cond_true55
ldr r6, LCPI1_1
str r6, [r8, #+4]
instead of:
add r10, r0, r6
str r8, [r10, #+4]
...
ble LBB1_4 @cond_next
LBB1_3: @cond_true
add r8, r0, r6
str r10, [r8, #+4]
LBB1_4: @cond_next
...
LBB1_5: @cond_true55
add r8, r0, r6
ldr r10, LCPI1_1
str r10, [r8, #+4]
Besides being smaller and more efficient, this makes it immediately
obvious that it is profitable to predicate LBB1_3 now :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/SmallPtrSet.cpp')
0 files changed, 0 insertions, 0 deletions