[PATCH] R600/SI: Fix offset folding in some cases with shifted pointers.

Matt Arsenault Matthew.Arsenault at amd.com
Tue Aug 5 12:18:37 PDT 2014


Ordinarily (shl (add x, c1), c2) -> (add (shl x, c2), c1 << c2)
is only done if the add has one use. If the resulting constant
add can be folded into an addressing mode, force this to happen
for the pointer operand.
    
This ends up happening a lot because of how LDS objects are allocated.
Since the globals are allocated next to each other, acessing the first
element of the second object is directly indexed by a shifted pointer.

Depends on:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140728/229124.html

http://reviews.llvm.org/D4795

Files:
  lib/Target/R600/SIISelLowering.cpp
  lib/Target/R600/SIISelLowering.h
  test/CodeGen/R600/shl_add_ptr.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4795.12208.patch
Type: text/x-patch
Size: 17249 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140805/98131ef9/attachment.bin>


More information about the llvm-commits mailing list