Generalize convergent check to handle invokes as well as calls.
[oota-llvm.git] / lib / Transforms / Scalar / LoopUnrollPass.cpp
index d9236a2c773b66b216418d93b282053506eed793..97c51dff84fb647ed40d4481722f9affb8ed52d5 100644 (file)
@@ -423,6 +423,12 @@ private:
     if (!CDS)
       return false;
 
+    // We might have a vector load from an array. FIXME: for now we just bail
+    // out in this case, but we should be able to resolve and simplify such
+    // loads.
+    if(!CDS->isElementTypeCompatible(I.getType()))
+      return false;
+
     int ElemSize = CDS->getElementType()->getPrimitiveSizeInBits() / 8U;
     assert(SimplifiedAddrOp->getValue().getActiveBits() < 64 &&
            "Unexpectedly large index value.");