]> granicus.if.org Git - llvm/commit
Fix crashes in IRCE caused by mismatched types
authorSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 22 Jan 2015 08:29:18 +0000 (08:29 +0000)
committerSanjoy Das <sanjoy@playingwithpointers.com>
Thu, 22 Jan 2015 08:29:18 +0000 (08:29 +0000)
commit49afc9109ebbfc006077dc25640925c2066ae3c3
tree83a5299748781a90f3fee811616ddb982addd3e1
parent5b657c48d84ffc42469adde4f0d4284e1a8da466
Fix crashes in IRCE caused by mismatched types

There are places where the inductive range check elimination pass
depends on two llvm::Values or llvm::SCEVs to be of the same
llvm::Type when they do not need to be. This patch relaxes those
restrictions (by bailing out of the optimization if the types
mismatch), and adds test cases to trigger those paths.

These issues were found by bootstrapping clang with IRCE running in
the -O3 pass ordering.

Differential Revision: http://reviews.llvm.org/D7082

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@226793 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp
test/Transforms/IRCE/bug-mismatched-types.ll [new file with mode: 0644]