[llvm-commits] [Patch] Use TargetTransformInfo to control switch-to-lookup table transform

Duncan Sands baldrick at free.fr
Mon Oct 29 10:07:49 PDT 2012


Hi Eli,

>> nope, Hans added it to Local.h, not to TargetTransformImpl.cpp.
>
> I think you miscut the patch somehow; here's the relevant piece:

hrm, that's pretty mysterious!  I'm sure I checked twice since it was such a
strange place to put this routine.  I've checked again and indeed it was in
TTI, so I withdraw my objections!  Sorry for the noise.

Ciao, Duncan.

>
> diff --git a/lib/Target/TargetTransformImpl.cpp
> b/lib/Target/TargetTransformImpl.cpp
> index d3823a6..f21e2f1 100644
> --- a/lib/Target/TargetTransformImpl.cpp
> +++ b/lib/Target/TargetTransformImpl.cpp
> @@ -49,6 +49,12 @@ unsigned ScalarTargetTransformImpl::getJumpBufSize() const {
>     return TLI->getJumpBufSize();
>   }
>
> +bool ScalarTargetTransformImpl::shouldBuildLookupTables() const {
> +  return TLI->supportJumpTables() &&
> +      (TLI->isOperationLegalOrCustom(ISD::BR_JT, MVT::Other) ||
> +       TLI->isOperationLegalOrCustom(ISD::BRIND, MVT::Other));
> +}
> +
>   //===----------------------------------------------------------------------===//
>   //
>   // Calls used by the vectorizers.
>
> -Eli
>




More information about the llvm-commits mailing list