<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 31, 2016 at 12:42 PM Davide Italiano <<a href="mailto:davide@freebsd.org">davide@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Oct 31, 2016 at 11:15 AM, David Blaikie <<a href="mailto:dblaikie@gmail.com" class="gmail_msg" target="_blank">dblaikie@gmail.com</a>> wrote:<br class="gmail_msg">
> From the description it sounds like you're adding an unused function - yet<br class="gmail_msg">
> this commit included a test case? (if the function is unused it wouldn't<br class="gmail_msg">
> change the behavior of the compiler, so there would be nothing new to test,<br class="gmail_msg">
> right?)<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
It was a mistake, reverted couple of minutes later, sorry.<br class="gmail_msg"></blockquote><div><br></div><div>Ah, no worries - handy to follow-up with a reply to the original commit to help others looking for the story/how things happened. But not always necessary by any means - I certainly don't always/generally send a follow up like that.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br class="gmail_msg">
> & adding an unused function's probably not ideal either, and should probably<br class="gmail_msg">
> go in alongside its usage<br class="gmail_msg">
><br class="gmail_msg">
<br class="gmail_msg">
I used here. If you prefer I can include together with its usage in the future.<br class="gmail_msg"></blockquote><div><br></div><div>I think that'd be my call in this case - but it does vary, for sure. Usually I think it's good to include tests with the code, one way or another (either with unit tests, or by rolling the functionality up into the code where it becomes live/testable, etc)</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<a href="http://llvm.org/viewvc/llvm-project?rev=285371&view=rev" rel="noreferrer" class="gmail_msg" target="_blank">http://llvm.org/viewvc/llvm-project?rev=285371&view=rev</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> On Thu, Oct 27, 2016 at 4:48 PM Davide Italiano via llvm-commits<br class="gmail_msg">
> <<a href="mailto:llvm-commits@lists.llvm.org" class="gmail_msg" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br class="gmail_msg">
>><br class="gmail_msg">
>> 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:<br class="gmail_msg">
>> <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">
>> ==============================================================================<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">
>> +<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,<br class="gmail_msg">
>> IdxList)),<br class="gmail_msg">
>><br class="gmail_msg">
>> Added: llvm/trunk/test/Transforms/InstCombine/gep-vector.ll<br class="gmail_msg">
>> URL:<br class="gmail_msg">
>> <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">
>> ==============================================================================<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<br class="gmail_msg">
>> 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">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
--<br class="gmail_msg">
Davide<br class="gmail_msg">
<br class="gmail_msg">
"There are no solved problems; there are only problems that are more<br class="gmail_msg">
or less solved" -- Henri Poincare<br class="gmail_msg">
</blockquote></div></div>