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

Sebastian Pop spop at codeaurora.org
Wed Jan 30 23:58:32 PST 2013


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?

Thanks,
Sebastian
-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-LoopToScev-maps.patch
Type: text/x-diff
Size: 29635 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130131/100acc08/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-use-apply-and-ScevParameterRewriter-rewrite-instead-.patch
Type: text/x-diff
Size: 8262 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130131/100acc08/attachment-0001.patch>


More information about the llvm-commits mailing list