[PATCH] D10496: Extending Vector GetElementPtr - please review

Elena Demikhovsky elena.demikhovsky at intel.com
Thu Jul 9 00:47:57 PDT 2015


delena closed this revision.
delena added a comment.

Committed. Thanks a lot to all reviewers.


================
Comment at: docs/LangRef.rst:6279
@@ +6278,3 @@
+    ; load 8 elements from array B into A
+    %A = call <8 x double> @llvm.masked.gather.v8f64(<8 x double*> %ptrs,
+         i32 8, <8 x i1> %mask, <8 x double> %passthru)
----------------
hfinkel wrote:
> Add this back in your patch for masked gather
This is unrelated to masked.gather optimization. The masked gather is a user of vector GEP with or without scalar arguments. 

Masked gather lowering will be more optimal if the base pointer is a scalar, but I'm not talking about this here.

================
Comment at: docs/LangRef.rst:6253
@@ +6252,3 @@
+
+     getelementptr  %struct.ST, <4 x %struct.ST*> %s, <8 x i64> %ind1,
+       <4 x i32> <i32 2, i32 2, i32 2, i32 2>,
----------------
greened wrote:
> I don't understand the <8 x i64> here.  Aren't the vector lengths supposed to agree?  The same issue carries through the example.
Thank you! It was a bug.

================
Comment at: include/llvm/IR/Instructions.h:861
@@ -855,1 +860,3 @@
+      assert(PointeeType == cast<PointerType>
+      (Ptr->getType()->getScalarType())->getElementType()->getScalarType());
     else
----------------
hfinkel wrote:
> Missing indent.
I'm removing this additional assert. I don't need it.

================
Comment at: lib/IR/Verifier.cpp:2565
@@ -2567,3 +2564,3 @@
     }
   }
   visitInstruction(GEP);
----------------
rengolin wrote:
> I think you should add an extra assert that the scalar types, if any, possibly must be pointers of the same family (int / float), but not necessarily the same width.
I added an assert - all indices should be integer.


http://reviews.llvm.org/D10496







More information about the llvm-commits mailing list