[llvm-commits] (trivial) [PATCH] check for NULL when asking for ScalarTargetTransformInfo in switch..case simplification

Hans Wennborg hans at chromium.org
Fri Nov 16 08:32:26 PST 2012


On Fri, Nov 16, 2012 at 3:44 PM, Pekka Jääskeläinen
<pekka.jaaskelainen at tut.fi> wrote:
> Hi,
>
> The attached trivial patch fixes the compilation of switch..cases for
> targets which do not have ScalarTargetTransformInfo set. It assumes a NULL
> value means the jump tables should not be generated.

Hi Pekka,

I was assuming that if there is a TargetTransformInfo, then that would
provide a ScalarTargetTransformInfo. If some target doesn't want to
define one, it could use the default implementation. That way, other
passes wouldn't have to do a null-check on both TTI and STTI.

I don't know if that was the intention, though. I'm cc'ing Nadav who
wrote TargetTransformInfo to ask his opinion.

Thanks,
Hans




More information about the llvm-commits mailing list