[llvm-commits] [llvm] r49056 - /llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
Tanya Lattner
lattner at apple.com
Tue Apr 1 16:39:34 PDT 2008
This has been reverted.
-Tanya
On Apr 1, 2008, at 3:55 PM, Owen Anderson wrote:
> David,
>
> This is breaking the build. Please fix.
>
> --Owen
>
> On Apr 1, 2008, at 5:14 PM, David Greene wrote:
>
>> Author: greened
>> Date: Tue Apr 1 17:14:23 2008
>> New Revision: 49056
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=49056&view=rev
>> Log:
>>
>> Iterators folloring a SmallVector erased element are invalidated so
>> don't access cached iterators from after the erased element.
>>
>> Modified:
>> llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
>>
>> Modified: llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/
>> Scalar/LoopIndexSplit.cpp?rev=49056&r1=49055&r2=49056&view=diff
>>
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =
>> =====================================================================
>> =
>> --- llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp (original)
>> +++ llvm/trunk/lib/Transforms/Scalar/LoopIndexSplit.cpp Tue Apr 1
>> 17:14:23 2008
>> @@ -232,8 +232,8 @@
>> return false;
>>
>> // First see if it is possible to eliminate loop itself or not.
>> - for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin(),
>> - E = SplitData.end(); SI != E;) {
>> + for (SmallVector<SplitInfo, 4>::iterator SI = SplitData.begin();
>> + SI != SplitData.end();) {
>> SplitInfo &SD = *SI;
>> ICmpInst *CI = dyn_cast<ICmpInst>(SD.SplitCondition);
>> if (SD.SplitCondition->getOpcode() == Instruction::And) {
>> @@ -244,8 +244,7 @@
>> return Changed;
>> } else {
>> SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
>> - ++SI;
>> - SplitData.erase(Delete_SI);
>> + SI = SplitData.erase(Delete_SI);
>> }
>> }
>> else if (CI && CI->getPredicate() == ICmpInst::ICMP_EQ) {
>> @@ -256,8 +255,7 @@
>> return Changed;
>> } else {
>> SmallVector<SplitInfo, 4>::iterator Delete_SI = SI;
>> - ++SI;
>> - SplitData.erase(Delete_SI);
>> + SI = SplitData.erase(Delete_SI);
>> }
>> } else
>> ++SI;
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list