Hal Finkel
2012-Jan-26 20:49 UTC
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Thu, 2012-01-26 at 14:34 -0600, Sebastian Pop wrote:> On Tue, Jan 24, 2012 at 6:41 PM, Hal Finkel <hfinkel at anl.gov> wrote: > >> enabling vectorization gets the performance down by 80% on ARM. > >> I will prepare a reduced testcase and try to find out the reason. > >> As a first shot, I would say that this comes from the vectorization of > >> code in a loop and the overhead of transfer between scalar and > >> vector registers. > > > > This is good; as has been pointed out, we'll need to develop a > > vectorization cost model for this kind of thing to really be successful, > > and so we should start thinking about that. > > > > The pass, as implemented, has an semi-implicit cost model which says > > that permutations followed by another vector operation are free, scalar > > -> vector transfers are free, and vectorizing a memory operation is just > > as good as vectorizing an arithmetic operation. Depending on the system, > > these may all be untrue (although on some systems they are true). > > > > If you can generate a test case that would be great, I'd like to look at > > it. > > Here is the testcase with calls to gettimeofday to measure time spent > in the kernel and not in the ini/fini phases. > On ARM I saw around 5 to 6x slowdown in the vector version. > I haven't tried this on x86 yet but that should also produce slowdowns > as the cost between scalar and vector regs is non null there as well.Thanks! Did you compile with any non-default flags other than -mllvm -vectorize? -Hal> > Sebastian > -- > Qualcomm Innovation Center, Inc is a member of Code Aurora Forum-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory
Sebastian Pop
2012-Jan-26 21:12 UTC
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Thu, Jan 26, 2012 at 2:49 PM, Hal Finkel <hfinkel at anl.gov> wrote:> Thanks! Did you compile with any non-default flags other than -mllvm > -vectorize?I used -O3 and -vectorize, no other non-default flags. Sebastian -- Qualcomm Innovation Center, Inc is a member of Code Aurora Forum
Hal Finkel
2012-Jan-26 21:19 UTC
[LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
On Thu, 2012-01-26 at 15:12 -0600, Sebastian Pop wrote:> On Thu, Jan 26, 2012 at 2:49 PM, Hal Finkel <hfinkel at anl.gov> wrote: > > Thanks! Did you compile with any non-default flags other than -mllvm > > -vectorize? > > I used -O3 and -vectorize, no other non-default flags.If I run clang -O3 -mllvm -vectorize -S -emit-llvm -o test.ll test.c then I get no vectorization at all (the output is identical to that without the -vectorize). What target triple is your clang targeting? If I include -mllvm -debug-only=bb-vectorize then the relevant output is: BBV: fusing loop #1 for entry in main... BBV: found 0 instructions with candidate pairs BBV: done! BBV: fusing loop #1 for for.body in main... BBV: found 0 instructions with candidate pairs BBV: done! BBV: fusing loop #1 for for.end in main... BBV: found 0 instructions with candidate pairs BBV: done! BBV: fusing loop #1 for for.cond7.preheader in main... BBV: found 0 instructions with candidate pairs BBV: done! BBV: fusing loop #1 for for.body10 in main... BBV: found 16 instructions with candidate pairs BBV: found 62 pair connections. BBV: selected 0 pairs. BBV: done! BBV: fusing loop #1 for for.inc45 in main... BBV: found 0 instructions with candidate pairs BBV: done! BBV: fusing loop #1 for for.end47 in main... BBV: found 3 instructions with candidate pairs BBV: found 0 pair connections. BBV: done! -Hal> > Sebastian > -- > Qualcomm Innovation Center, Inc is a member of Code Aurora Forum-- Hal Finkel Postdoctoral Appointee Leadership Computing Facility Argonne National Laboratory
Reasonably Related Threads
- [LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
- [LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
- [LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
- [LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass
- [LLVMdev] [llvm-commits] [PATCH] BasicBlock Autovectorization Pass