[llvm-commits] Global Merge Pass for ARM

Evan Cheng evan.cheng at apple.com
Thu Jun 3 22:38:43 PDT 2010


On May 29, 2010, at 6:40 AM, Anton Korobeynikov wrote:

> 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.

The patch looks good in general. My concern with getMaximalGlobalOffset is it's too inflexible. It's basically only useful for G +/- offset address mode. Contrast it with isLegalAddressingMode(), it uses struct AddrMode, which can describe a different types of address modes. Any ideas?

Evan

>> 
> -- 
> With best regards, Anton Korobeynikov.
> 
> Faculty of Mathematics & Mechanics, Saint Petersburg State University.
> <globalmerge.patch>





More information about the llvm-commits mailing list