[llvm-commits] [llvm] r163894 - /llvm/trunk/lib/Transforms/Scalar/SROA.cpp

Chandler Carruth chandlerc at gmail.com
Fri Sep 14 03:30:40 PDT 2012


Author: chandlerc
Date: Fri Sep 14 05:30:40 2012
New Revision: 163894

URL: http://llvm.org/viewvc/llvm-project?rev=163894&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/Transforms/Scalar/SROA.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/SROA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/SROA.cpp?rev=163894&r1=163893&r2=163894&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/SROA.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/SROA.cpp Fri Sep 14 05:30:40 2012
@@ -1300,10 +1300,13 @@
   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()))





More information about the llvm-commits mailing list