aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/Transforms/Scalar/SROA.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Scalar/SROA.cpp b/lib/Transforms/Scalar/SROA.cpp
index acfa87a32e..97c28d442a 100644
--- a/lib/Transforms/Scalar/SROA.cpp
+++ b/lib/Transforms/Scalar/SROA.cpp
@@ -1300,10 +1300,13 @@ static Value *getNaturalGEPRecursively(IRBuilder<> &IRB, const TargetData &TD,
if (Ty->isPointerTy())
return 0;
+ // We try to analyze GEPs over vectors here, but note that these GEPs are
+ // extremely poorly defined currently. The long-term goal is to remove GEPing
+ // over a vector from the IR completely.
if (VectorType *VecTy = dyn_cast<VectorType>(Ty)) {
unsigned ElementSizeInBits = VecTy->getScalarSizeInBits();
if (ElementSizeInBits % 8)
- return 0; // GEPs over multiple of 8 size vector elements are invalid.
+ return 0; // GEPs over non-multiple of 8 size vector elements are invalid.
APInt ElementSize(Offset.getBitWidth(), ElementSizeInBits / 8);
APInt NumSkippedElements = Offset.udiv(ElementSize);
if (NumSkippedElements.ugt(VecTy->getNumElements()))