[PATCH] R600/SI: Implement shouldConvertConstantLoadToIntImm

Daenzer, Michel Michel.Daenzer at amd.com
Mon Mar 17 20:16:10 PDT 2014


On Mon, 2014-03-17 at 10:26 -0700, Matt Arsenault wrote:
> http://llvm-reviews.chandlerc.com/D3101
> 
> Files:
>   lib/Target/R600/SIISelLowering.cpp
>   lib/Target/R600/SIISelLowering.h
>   lib/Target/R600/SIInstrInfo.cpp
>   lib/Target/R600/SIInstrInfo.h
> 
> Index: lib/Target/R600/SIISelLowering.cpp
> ===================================================================
> --- lib/Target/R600/SIISelLowering.cpp
> +++ lib/Target/R600/SIISelLowering.cpp
> @@ -215,6 +215,13 @@
>    return VT.bitsLE(MVT::i16);
>  }
>  
> +bool SITargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
> +                                                         Type *Ty) const {
> +  const SIInstrInfo *TII =
> +    static_cast<const SIInstrInfo*>(getTargetMachine().getInstrInfo());
> +  return TII->isInlineConstant(Imm);
> +}

What's the default behaviour without this? Not all source operands
support inline constants, but on the other hand even immediates which
cannot be encoded as inline constants can be encoded as literal
constants in some cases. So I wonder if this might not be either too
liberal or too strict.


-- 
Earthling Michel Dänzer            |                  http://www.amd.com
Libre software enthusiast          |                Mesa and X developer




More information about the llvm-commits mailing list