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

Pekka Jääskeläinen pekka.jaaskelainen at tut.fi
Fri Nov 16 07:44:31 PST 2012


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.

I do not know if this is a problem for other targets than TCE which has the
target classes generated "on the fly" and doesn't have a full LLVM in-tree
target description. The particular problem here is that this info is queried
in the frontend's LLVM IR generation, and we generate the backends for the LLVM
code generation only.

The proper fix would be to add some static TCE target info to the LLVM
tree also, but I prefer to do it in the LLVM 3.3 cycle as it is too
intrusive at this point of the 3.2 release.

Please apply to the 3.2.

Thanks!
-- 
--Pekka

-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-3.2-scalar-tti-can-be-null.patch
Type: text/x-diff
Size: 692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121116/c41c2663/attachment.patch>


More information about the llvm-commits mailing list