From 2ababf68d78be7b4dcd76a04f1becfd92b791e66 Mon Sep 17 00:00:00 2001 From: Nadav Rotem Date: Thu, 20 Dec 2012 20:24:40 +0000 Subject: LoopVectorize: Fix a bug in the scalarization of instructions. Before if-conversion we could check if a value is loop invariant if it was declared inside the basic block. Now that loops have multiple blocks this check is incorrect. This fixes External/SPEC/CINT95/099_go/099_go llvm-svn: 170756 --- llvm/test/Transforms/LoopVectorize/scalar-store.ll | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 llvm/test/Transforms/LoopVectorize/scalar-store.ll (limited to 'llvm/test/Transforms/LoopVectorize') diff --git a/llvm/test/Transforms/LoopVectorize/scalar-store.ll b/llvm/test/Transforms/LoopVectorize/scalar-store.ll new file mode 100644 index 00000000000..5d207f94454 --- /dev/null +++ b/llvm/test/Transforms/LoopVectorize/scalar-store.ll @@ -0,0 +1,48 @@ +; RUN: opt < %s -loop-vectorize -force-vector-width=4 -dce -instcombine -licm -S -enable-if-conversion | FileCheck %s + +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-apple-macosx10.9.0" + +; When we scalarize a store, make sure that the addresses are extracted +; from a vector. We had a bug where the addresses were the old scalar +; addresses. + +; CHECK: @foo +; CHECK: select +; CHECK: extractelement +; CHECK-NEXT: store +; CHECK: extractelement +; CHECK-NEXT: store +; CHECK: extractelement +; CHECK-NEXT: store +; CHECK: extractelement +; CHECK-NEXT: store +; CHECK: ret +define i32 @foo(i32* nocapture %a) nounwind uwtable ssp { + br label %1 + +;