<div dir="ltr">From the description it sounds like you're adding an unused function - yet this commit included a test case? (if the function is unused it wouldn't change the behavior of the compiler, so there would be nothing new to test, right?)<br><br>& adding an unused function's probably not ideal either, and should probably go in alongside its usage</div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 27, 2016 at 4:48 PM Davide Italiano via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: davide<br class="gmail_msg">
Date: Thu Oct 27 18:38:51 2016<br class="gmail_msg">
New Revision: 285365<br class="gmail_msg">
<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=285365&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=285365&view=rev</a><br class="gmail_msg">
Log:<br class="gmail_msg">
[IR] Reintroduce getGEPReturnType(), it will be used in a later patch.<br class="gmail_msg">
<br class="gmail_msg">
Added:<br class="gmail_msg">
    llvm/trunk/test/Transforms/InstCombine/gep-vector.ll<br class="gmail_msg">
Modified:<br class="gmail_msg">
    llvm/trunk/include/llvm/IR/Instructions.h<br class="gmail_msg">
<br class="gmail_msg">
Modified: llvm/trunk/include/llvm/IR/Instructions.h<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=285365&r1=285364&r2=285365&view=diff" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=285365&r1=285364&r2=285365&view=diff</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/include/llvm/IR/Instructions.h (original)<br class="gmail_msg">
+++ llvm/trunk/include/llvm/IR/Instructions.h Thu Oct 27 18:38:51 2016<br class="gmail_msg">
@@ -959,6 +959,11 @@ public:<br class="gmail_msg">
<br class="gmail_msg">
   /// Returns the pointer type returned by the GEP<br class="gmail_msg">
   /// instruction, which may be a vector of pointers.<br class="gmail_msg">
+  static Type *getGEPReturnType(Value *Ptr, ArrayRef<Value *> IdxList) {<br class="gmail_msg">
+    return getGEPReturnType(<br class="gmail_msg">
+      cast<PointerType>(Ptr->getType()->getScalarType())->getElementType(),<br class="gmail_msg">
+      Ptr, IdxList);<br class="gmail_msg">
+  }<br class="gmail_msg">
   static Type *getGEPReturnType(Type *ElTy, Value *Ptr,<br class="gmail_msg">
                                 ArrayRef<Value *> IdxList) {<br class="gmail_msg">
     Type *PtrTy = PointerType::get(checkGEPType(getIndexedType(ElTy, IdxList)),<br class="gmail_msg">
<br class="gmail_msg">
Added: llvm/trunk/test/Transforms/InstCombine/gep-vector.ll<br class="gmail_msg">
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/gep-vector.ll?rev=285365&view=auto" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/InstCombine/gep-vector.ll?rev=285365&view=auto</a><br class="gmail_msg">
==============================================================================<br class="gmail_msg">
--- llvm/trunk/test/Transforms/InstCombine/gep-vector.ll (added)<br class="gmail_msg">
+++ llvm/trunk/test/Transforms/InstCombine/gep-vector.ll Thu Oct 27 18:38:51 2016<br class="gmail_msg">
@@ -0,0 +1,15 @@<br class="gmail_msg">
+; RUN: opt -instcombine %s -S | FileCheck %s<br class="gmail_msg">
+<br class="gmail_msg">
+; CHECK-LABEL: patatino<br class="gmail_msg">
+; CHECK-NEXT: ret <8 x i64*> undef<br class="gmail_msg">
+define <8 x i64*> @patatino() {<br class="gmail_msg">
+  %el = getelementptr i64, <8 x i64*> undef, <8 x i64> undef<br class="gmail_msg">
+  ret <8 x i64*> %el<br class="gmail_msg">
+}<br class="gmail_msg">
+<br class="gmail_msg">
+; CHECK-LABEL: patatino2<br class="gmail_msg">
+; CHECK-NEXT: ret <8 x i64*> undef<br class="gmail_msg">
+define <8 x i64*> @patatino2() {<br class="gmail_msg">
+  %el = getelementptr inbounds i64, i64* undef, <8 x i64> undef<br class="gmail_msg">
+  ret <8 x i64*> %el<br class="gmail_msg">
+}<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
llvm-commits mailing list<br class="gmail_msg">
<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br class="gmail_msg">
</blockquote></div>