[LLVMdev] [polly] scev codegen (first step to remove the dependence on ivcanon pass)

Tobias Grosser tobias at grosser.es
Mon Feb 4 09:00:09 PST 2013


On 01/31/2013 08:58 AM, Sebastian Pop wrote:
> Tobias Grosser wrote:
>>>>> > >>>diff --git a/test/Cloog/CodeGen/simple_vec_call_2.ll b/test/Cloog/CodeGen/simple_vec_call_2.ll
>>>>> > >>>index bb2a680..645599f 100644
>>>>> > >>>--- a/test/Cloog/CodeGen/simple_vec_call_2.ll
>>>>> > >>>+++ b/test/Cloog/CodeGen/simple_vec_call_2.ll
>>>>> > >>>@@ -58,4 +58,4 @@ return:
>>>>> > >>>  ; CHECK-SCEV: %5 = insertelement <4 x float**> %4, float** %p_result1, i32 1
>>>>> > >>>  ; CHECK-SCEV: %6 = insertelement <4 x float**> %5, float** %p_result2, i32 2
>>>>> > >>>  ; CHECK-SCEV: %7 = insertelement <4 x float**> %6, float** %p_result3, i32 3
>>>>> > >>>-; CHECK-SCEV: store <4 x float**> %7, <4 x float**>* bitcast ([1024 x float**]* @B to <4 x float**>*), align
>>>>> > >>>+; CHECK-SCEV: store <4 x float**> %7, <4 x float**>* bitcast (float*** getelementptr inbounds ([1024 x float**]* @B, i64 0, i64 3) to <4 x float**>*), align
>>>> > >>
>>>> > >>I don't understand this test case change. As I am especially
>>>> > >>surprised due to the second operand of the getelementptr. Why is it
>>>> > >>'i64 3' and not 'i64 0'? Does this change change the semantics of
>>>> > >>the generated code?
>>> > >
>>> > >I was puzzled by this change as well: the 4 patches are not supposed to change
>>> > >the semantics of the vectorizer: it looks like what changes is the store access
>>> > >function, from a reference to B to a gep in B.  I will investigate a bit more.
>> >
>> >Changing from the reference to a gep is not worrying me. The
>> >surprising thing from my point is that there are non-zero
>> >coefficients in the gep.
> It turned out that the first patch, introducing the LoopToScev maps, was not
> correct for vector lanes: it would always associate the last lane's value to a
> given dimension. That ends up generating a scev apply 3 for all the vector lanes.
>
> I'm attaching the revised patches that pass make polly-test.
> Ok to commit?

LGTM.

Thanks,
Tobi




More information about the llvm-commits mailing list