[LLVMdev] proposed change to class BasicTTI

Reed Kotler rkotler at mips.com
Fri Mar 22 09:43:28 PDT 2013

Another way to do this would to be to have a reset virtual function 
which is passed the Function, and the address of TLI so that it could be 

This seems somewhat cleaner.

The reset virtual function would be added to base class TargetLoweringBase.

On 03/22/2013 09:22 AM, reed kotler wrote:
> For being able to change subtargets within a compilation unit, among
> other things, I need to be able to change the target lowering class that
> is used by BasicTTI
> For example we have a mips16 and non mips16 version.
> On the original call that creates this class, I'd like to pass the
> address of the address of the TargetLoweringBase class.
> That way I can insert a function pass before this pass which examines
> the function attributes and changes the pointer.
> So we would get:
> ImmutablePass *
> llvm::createBasicTargetTransformInfoPass(const TargetLoweringBase **TLI_) {
>    return new BasicTTI(TLI);
> }
> we would add the variable
> TargetLoweringBase **TLI_
> and at the beginning of each pass
> TLI = *TLI_;
> Maybe there is a more elegant way to do this but this is essentially
> what I need to do.

More information about the llvm-dev mailing list