diff options
| author | Diego Caballero <diego.caballero@intel.com> | 2018-06-15 18:46:03 +0000 |
|---|---|---|
| committer | Diego Caballero <diego.caballero@intel.com> | 2018-06-15 18:46:03 +0000 |
| commit | 72aed5e5dc7126be84a0d90063b441b6406b73f7 (patch) | |
| tree | d29277cb7dd7ff5bb6cf4ba811d9da2d901337c8 /llvm/test/Transforms/LoopVectorize/X86 | |
| parent | f5ecd8d50db8dc832e87628d4935f2e1db283f8f (diff) | |
| download | bcm5719-llvm-72aed5e5dc7126be84a0d90063b441b6406b73f7.tar.gz bcm5719-llvm-72aed5e5dc7126be84a0d90063b441b6406b73f7.zip | |
Move redundant-vf2-cost.ll test to X86 directory
redundant-vf2-cost.ll is X86 specific. Moved from
test/Transforms/LoopVectorize/redundant-vf2-cost.ll to
test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll
llvm-svn: 334854
Diffstat (limited to 'llvm/test/Transforms/LoopVectorize/X86')
| -rw-r--r-- | llvm/test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/llvm/test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll b/llvm/test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll new file mode 100644 index 00000000000..bd69d27d2d5 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/X86/redundant-vf2-cost.ll @@ -0,0 +1,34 @@ +; RUN: opt < %s -loop-vectorize -mtriple x86_64 -debug -disable-output 2>&1 | FileCheck %s +; REQUIRES: asserts + +; Check that cost model is not executed twice for VF=2 when vectorization is +; forced for a particular loop. + +; CHECK: LV: Found an estimated cost of {{[0-9]+}} for VF 2 For instruction: %{{[0-9]+}} = load i32 +; CHECK: LV: Found an estimated cost of {{[0-9]+}} for VF 2 For instruction: store i32 +; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF 2 For instruction: %{{[0-9]+}} = load i32 +; CHECK-NOT: LV: Found an estimated cost of {{[0-9]+}} for VF 2 For instruction: store i32 +; CHECK: LV: Vector loop of width 2 costs: {{[0-9]+}}. + +define i32 @foo(i32* %A, i32 %n) { +entry: + %cmp3.i = icmp eq i32 %n, 0 + br i1 %cmp3.i, label %exit, label %for.body.i + +for.body.i: + %iv = phi i32 [ %add.i, %for.body.i ], [ 0, %entry ] + %ld_addr = getelementptr inbounds i32, i32* %A, i32 %iv + %0 = load i32, i32* %ld_addr, align 4 + %val = add i32 %0, 1 + store i32 %val, i32* %ld_addr, align 4 + %add.i = add nsw i32 %iv, 1 + %cmp.i = icmp eq i32 %add.i, %n + br i1 %cmp.i, label %exit, label %for.body.i, !llvm.loop !0 + +exit: + %__init.addr.0.lcssa.i = phi i32 [ 0, %entry ], [ %add.i, %for.body.i ] + ret i32 %__init.addr.0.lcssa.i +} + +!0 = !{!0, !1} +!1 = !{!"llvm.loop.vectorize.enable", i1 true} |

