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

Hans Wennborg hans at chromium.org
Fri Nov 16 10:22:52 PST 2012


On Fri, Nov 16, 2012 at 4:32 PM, Hans Wennborg <hans at chromium.org> wrote:
> 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.

Looking around the code some more, I see that the vectorization stuff
does null-checks both on TTI and VTTI, so I guess it should be the
same for this case.

I went ahead and landed the patch in r168176.

Thanks,
Hans




More information about the llvm-commits mailing list