[polly][vectorizer] do not emit bitcast i32** to <1 x i32*>*

Tobias Grosser tobias at grosser.es
Wed Oct 16 16:04:38 PDT 2013


On 10/15/2013 06:33 PM, Sebastian Pop wrote:
> Hi Tobi,
>
> Sebastian Pop wrote:
>> Tobias Grosser wrote:
>>> 1) Bitcast patch
>>>
>>> The patch goes definitely in the right direction. However, it would
>>> be nice if you could besides modifying the existing test cases also
>>> provide a test cases that fail without these changes.
>>
>> I will reduce a testcase and repost the patch for review.
>
> Here is a C reduced testcase: (thanks to http://embed.cs.utah.edu/creduce/ )

Thanks.

> I was not able to write a Polly specific testcase that would fail with opt.
> Tobi, can you help extracting a testcase?

Yes, attached.

Run it with:

polly-opt -O3 -polly -polly-vectorizer=polly -polly-ignore-aliasing

It would be nice if we can change it such that the 
'-polly-ignore-aliasing' flag would not even be needed.

> Also wondering, is there a way to add C testcases to Polly?

No. Why would we need C test cases?

Cheers,
Tobias

-------------- next part --------------
; ModuleID = 'test.c'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.P = type { [0 x i16] }

@a = common global %struct.P* null, align 8
@b = common global [4 x i32] zeroinitializer, align 16

; Function Attrs: nounwind uwtable
define void @fn1() #0 {
entry:
  br label %entry.split

entry.split:                                      ; preds = %entry
  br label %for.body

for.body:                                         ; preds = %entry.split, %for.body
  %indvar = phi i64 [ 0, %entry.split ], [ %indvar.next, %for.body ]
  %arrayidx1 = getelementptr [4 x i32]* @b, i64 0, i64 %indvar
  %0 = load %struct.P** @a, align 8
  %arrayidx = getelementptr inbounds %struct.P* %0, i64 0, i32 0, i64 0
  %1 = load i16* %arrayidx, align 2
  %conv = sext i16 %1 to i32
  store i32 %conv, i32* %arrayidx1, align 4
  %indvar.next = add i64 %indvar, 1
  %exitcond = icmp ne i64 %indvar.next, 4
  br i1 %exitcond, label %for.body, label %for.end

for.end:                                          ; preds = %for.body
  ret void
}

attributes #0 = { nounwind uwtable "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="8" "unsafe-fp-math"="false" "use-soft-float"="false" }


More information about the llvm-commits mailing list