[llvm-commits] Global Merge Pass for ARM

Anton Korobeynikov anton at korobeynikov.info
Sat May 29 06:40:51 PDT 2010


Hi, Evan

> Yes, adding a target hook for this seems like the right thing. 
> Why do you need two though? Is getMinGlobalOffset necessary?
I'm thinking about the next series of iterations for this pass. The idea
is quite simple: many load/store instructions have signed offset fields
(e.g. on arm +-4095) and currently we don't exploit the negative offsets
at all. 

If we use as a global base the middle of the global, then we can address
with the same base as twice as we have right now.

The updated patch is attached (still inside Target/ARM, but can be moved
out)

> 1. Use SmallVector instead of std::vector?
Fixed

> 3. MaxOffset should not be initialized when the pass is created. What
> if we want to support switching between ARM / Thumb mode on a function
> to function basis? Can it use TargetLowering::isLegalAddressingMode()
> or something similar instead?
New hook to TLI was added, however for now we are using the result in a
same way as before. When we'll have separate handling for the functions
in ARM/Thumb mode, then we'll need to look into the users and infer the
maximum possible offset for each global depending on this. I've put a
fixme there.
> 
-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics & Mechanics, Saint Petersburg State University.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: globalmerge.patch
Type: text/x-patch
Size: 9711 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100529/3d96636c/attachment.bin>


More information about the llvm-commits mailing list