diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2012-09-14 10:30:40 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2012-09-14 10:30:40 +0000 |
commit | 8ed1ed8dfd2cf9215446c637a416a5a31f96051e (patch) | |
tree | c9aae58fa9999e188af804ebb408367ed295259f /lib | |
parent | 8615cd236ed9f9540b4a3ad05dd0a1d202a3f6b4 (diff) | |
download | external_llvm-8ed1ed8dfd2cf9215446c637a416a5a31f96051e.tar.gz external_llvm-8ed1ed8dfd2cf9215446c637a416a5a31f96051e.tar.bz2 external_llvm-8ed1ed8dfd2cf9215446c637a416a5a31f96051e.zip |
Add some comments clarifying that the GEP analysis for vector GEPs is
deeply suspicious and likely to go away eventually. Also fix a bogus
comment about one of the checks in the vector GEP analysis. Based on
review from Duncan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/SROA.cpp | 5 |
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())) |