[llvm-branch-commits] [llvm-branch] r90889 - in /llvm/branches/Apple/Zoidberg: lib/Transforms/Scalar/SCCP.cpp test/Transforms/IPConstantProp/user-with-multiple-uses.ll
Bill Wendling
isanbard at gmail.com
Tue Dec 8 14:21:11 PST 2009
Author: void
Date: Tue Dec 8 16:21:11 2009
New Revision: 90889
URL: http://llvm.org/viewvc/llvm-project?rev=90889&view=rev
Log:
$ svn merge -c 89658 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r89658 into '.':
A test/Transforms/IPConstantProp/user-with-multiple-uses.ll
U lib/Transforms/Scalar/SCCP.cpp
Added:
llvm/branches/Apple/Zoidberg/test/Transforms/IPConstantProp/user-with-multiple-uses.ll
- copied unchanged from r89658, llvm/trunk/test/Transforms/IPConstantProp/user-with-multiple-uses.ll
Modified:
llvm/branches/Apple/Zoidberg/lib/Transforms/Scalar/SCCP.cpp
Modified: llvm/branches/Apple/Zoidberg/lib/Transforms/Scalar/SCCP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Transforms/Scalar/SCCP.cpp?rev=90889&r1=90888&r2=90889&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Transforms/Scalar/SCCP.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Transforms/Scalar/SCCP.cpp Tue Dec 8 16:21:11 2009
@@ -1871,8 +1871,12 @@
BasicBlock *DeadBB = BlocksToErase[i];
for (Value::use_iterator UI = DeadBB->use_begin(), UE = DeadBB->use_end();
UI != UE; ) {
+ // Grab the user and then increment the iterator early, as the user
+ // will be deleted. Step past all adjacent uses from the same user.
+ Instruction *I = dyn_cast<Instruction>(*UI);
+ do { ++UI; } while (UI != UE && *UI == I);
+
// Ignore blockaddress users; BasicBlock's dtor will handle them.
- Instruction *I = dyn_cast<Instruction>(*UI++);
if (!I) continue;
bool Folded = ConstantFoldTerminator(I->getParent());
More information about the llvm-branch-commits
mailing list