[llvm-branch-commits] [llvm-branch] r182492 - Merging r182485:

Bill Wendling isanbard at gmail.com
Wed May 22 10:30:06 PDT 2013


Author: void
Date: Wed May 22 12:30:06 2013
New Revision: 182492

URL: http://llvm.org/viewvc/llvm-project?rev=182492&view=rev
Log:
Merging r182485:
------------------------------------------------------------------------
r182485 | arnolds | 2013-05-22 09:54:56 -0700 (Wed, 22 May 2013) | 7 lines

LoopVectorize: Make Value pointers that could be RAUW'ed a VH

The Value pointers we store in the induction variable list can be RAUW'ed by a
call to SCEVExpander::expandCodeFor, use a TrackingVH instead. Do the same thing
in some other places where we store pointers that could potentially be RAUW'ed.

Fixes PR16073.
------------------------------------------------------------------------

Added:
    llvm/branches/release_33/test/Transforms/LoopVectorize/value-ptr-bug.ll
      - copied unchanged from r182485, llvm/trunk/test/Transforms/LoopVectorize/value-ptr-bug.ll
Modified:
    llvm/branches/release_33/   (props changed)
    llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp

Propchange: llvm/branches/release_33/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed May 22 12:30:06 2013
@@ -1,3 +1,3 @@
 /llvm/branches/Apple/Pertwee:110850,110961
 /llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,181286,181296,181313,181363,181366,181397,181423,181450,181524,181529,181540,181576-181580,181586,181600,181678,181706,181792,181800,181842,181864,182072,182112-182113,182344,182364,182385,182387,182486
+/llvm/trunk:155241,181286,181296,181313,181363,181366,181397,181423,181450,181524,181529,181540,181576-181580,181586,181600,181678,181706,181792,181800,181842,181864,182072,182112-182113,182344,182364,182385,182387,182485-182486

Modified: llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=182492&r1=182491&r2=182492&view=diff
==============================================================================
--- llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/branches/release_33/lib/Transforms/Vectorize/LoopVectorize.cpp Wed May 22 12:30:06 2013
@@ -80,6 +80,7 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/PatternMatch.h"
 #include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/ValueHandle.h"
 #include "llvm/Target/TargetLibraryInfo.h"
 #include "llvm/Transforms/Scalar.h"
 #include "llvm/Transforms/Utils/BasicBlockUtils.h"
@@ -382,7 +383,7 @@ public:
 
     // The starting value of the reduction.
     // It does not have to be zero!
-    Value *StartValue;
+    TrackingVH<Value> StartValue;
     // The instruction who's value is used outside the loop.
     Instruction *LoopExitInstr;
     // The kind of the reduction.
@@ -427,7 +428,7 @@ public:
     /// This flag indicates if we need to add the runtime check.
     bool Need;
     /// Holds the pointers that we need to check.
-    SmallVector<Value*, 2> Pointers;
+    SmallVector<TrackingVH<Value>, 2> Pointers;
     /// Holds the pointer value at the beginning of the loop.
     SmallVector<const SCEV*, 2> Starts;
     /// Holds the pointer value at the end of the loop.
@@ -441,7 +442,7 @@ public:
     InductionInfo(Value *Start, InductionKind K) : StartValue(Start), IK(K) {}
     InductionInfo() : StartValue(0), IK(IK_NoInduction) {}
     /// Start value.
-    Value *StartValue;
+    TrackingVH<Value> StartValue;
     /// Induction kind.
     InductionKind IK;
   };





More information about the llvm-branch-commits mailing list