[llvm] Decompose gep of complex type struct to its element type (PR #107848)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 24 02:11:15 PDT 2024


================
@@ -1555,6 +1555,17 @@ bool GetElementPtrInst::hasAllConstantIndices() const {
   return true;
 }
 
+/// hasAllZeroIndicesExceptLast - Return true if all of the indices of this GEP
+/// are zero except the last indice.
+bool GetElementPtrInst::hasAllZeroIndicesExceptLast() const {
+  for (unsigned i = 1, e = getNumOperands() - 1; i != e; ++i) {
+    ConstantInt *Val = dyn_cast<ConstantInt>(getOperand(i));
----------------
vfdff wrote:

support the vector case now, thanks

https://github.com/llvm/llvm-project/pull/107848


More information about the llvm-commits mailing list