diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-02 02:26:54 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-02 02:26:54 +0000 |
commit | 3d606bbc92b5bbed17492b38b4f80728e676179f (patch) | |
tree | c02f8b51ecdee7d903c51eb3034f88b359c203a0 /lib/Transforms/Scalar/LoopUnswitch.cpp | |
parent | f96f1e013c4fb89e2d63764d1155e593542df31e (diff) |
fix a crash in loop unswitch on a loop invariant vector condition.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95055 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopUnswitch.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/LoopUnswitch.cpp b/lib/Transforms/Scalar/LoopUnswitch.cpp index 527a7b51e1..e5fba28374 100644 --- a/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -169,6 +169,10 @@ Pass *llvm::createLoopUnswitchPass(bool Os) { /// invariant in the loop, or has an invariant piece, return the invariant. /// Otherwise, return null. static Value *FindLIVLoopCondition(Value *Cond, Loop *L, bool &Changed) { + // We can never unswitch on vector conditions. + if (isa<VectorType>(Cond->getType())) + return 0; + // Constants should be folded, not unswitched on! if (isa<Constant>(Cond)) return 0; @@ -401,7 +405,7 @@ bool LoopUnswitch::IsTrivialUnswitchCondition(Value *Cond, Constant **Val, /// UnswitchIfProfitable - We have found that we can unswitch currentLoop when /// LoopCond == Val to simplify the loop. If we decide that this is profitable, /// unswitch the loop, reprocess the pieces, then return true. -bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val){ +bool LoopUnswitch::UnswitchIfProfitable(Value *LoopCond, Constant *Val) { initLoopData(); |