[llvm-branch-commits] [llvm-branch] r155985 - in /llvm/branches/release_31: ./ lib/Transforms/Scalar/Reassociate.cpp test/Transforms/Reassociate/pr12245.ll

Bill Wendling isanbard at gmail.com
Wed May 2 03:00:50 PDT 2012


Author: void
Date: Wed May  2 05:00:50 2012
New Revision: 155985

URL: http://llvm.org/viewvc/llvm-project?rev=155985&view=rev
Log:
Merging r155984:
------------------------------------------------------------------------
r155984 | void | 2012-05-02 02:59:45 -0700 (Wed, 02 May 2012) | 4 lines

The value held in the vector may be RAUW'ed by some of the canonicalization
methods. Use a weak value handle to keep up with this.
PR12245

------------------------------------------------------------------------

Added:
    llvm/branches/release_31/test/Transforms/Reassociate/pr12245.ll
      - copied unchanged from r155984, llvm/trunk/test/Transforms/Reassociate/pr12245.ll
Modified:
    llvm/branches/release_31/   (props changed)
    llvm/branches/release_31/lib/Transforms/Scalar/Reassociate.cpp

Propchange: llvm/branches/release_31/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May  2 05:00:50 2012
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155166,155230,155284-155288,155307,155342,155466,155536,155668,155809,155813,155817-155818,155844,155895,155902,155954
+/llvm/trunk:155166,155230,155284-155288,155307,155342,155466,155536,155668,155809,155813,155817-155818,155844,155895,155902,155954,155984

Modified: llvm/branches/release_31/lib/Transforms/Scalar/Reassociate.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_31/lib/Transforms/Scalar/Reassociate.cpp?rev=155985&r1=155984&r2=155985&view=diff
==============================================================================
--- llvm/branches/release_31/lib/Transforms/Scalar/Reassociate.cpp (original)
+++ llvm/branches/release_31/lib/Transforms/Scalar/Reassociate.cpp Wed May  2 05:00:50 2012
@@ -559,7 +559,8 @@
 
 /// EmitAddTreeOfValues - Emit a tree of add instructions, summing Ops together
 /// and returning the result.  Insert the tree before I.
-static Value *EmitAddTreeOfValues(Instruction *I, SmallVectorImpl<Value*> &Ops){
+static Value *EmitAddTreeOfValues(Instruction *I,
+                                  SmallVectorImpl<WeakVH> &Ops){
   if (Ops.size() == 1) return Ops.back();
   
   Value *V1 = Ops.back();
@@ -833,7 +834,7 @@
     // from an expression will drop a use of maxocc, and this can cause 
     // RemoveFactorFromExpression on successive values to behave differently.
     Instruction *DummyInst = BinaryOperator::CreateAdd(MaxOccVal, MaxOccVal);
-    SmallVector<Value*, 4> NewMulOps;
+    SmallVector<WeakVH, 4> NewMulOps;
     for (unsigned i = 0; i != Ops.size(); ++i) {
       // Only try to remove factors from expressions we're allowed to.
       BinaryOperator *BOp = dyn_cast<BinaryOperator>(Ops[i].Op);





More information about the llvm-branch-commits mailing list