diff options
author | Devang Patel <dpatel@apple.com> | 2009-10-13 22:56:32 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2009-10-13 22:56:32 +0000 |
commit | a6771369003f884d6ab99b66c040703a08cdc374 (patch) | |
tree | 09d4a0097c1ffc7f5c5ed8a7a89f0762fe06cb84 /llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | |
parent | fbd2d493980877a4aeb615d6ff5a155026328ec9 (diff) | |
download | bcm5719-llvm-a6771369003f884d6ab99b66c040703a08cdc374.tar.gz bcm5719-llvm-a6771369003f884d6ab99b66c040703a08cdc374.zip |
Check void type before using RAUWd.
llvm-svn: 84049
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopUnswitch.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopUnswitch.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp index 07ee071d00f..a217a32db00 100644 --- a/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp @@ -781,7 +781,10 @@ void LoopUnswitch::RemoveBlockIfDead(BasicBlock *BB, // Anything that uses the instructions in this basic block should have their // uses replaced with undefs. - I->replaceAllUsesWith(UndefValue::get(I->getType())); + // If I is not void type then replaceAllUsesWith undef. + // This allows ValueHandlers and custom metadata to adjust itself. + if (I->getType() != Type::getVoidTy(I->getContext())) + I->replaceAllUsesWith(UndefValue::get(I->getType())); } // If this is the edge to the header block for a loop, remove the loop and |