From b6e470744c22ff26fb96ce31e2cb4af365a35c09 Mon Sep 17 00:00:00 2001 From: Matt Arsenault Date: Thu, 30 Jun 2016 23:30:29 +0000 Subject: [PATCH] LoadStoreVectorizer: Skip optnone functions llvm-svn: 274296 --- lib/Transforms/Vectorize/LoadStoreVectorizer.cpp | 2 +- .../Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll diff --git a/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp b/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp index 2908caa9c6a..880be650ef3 100644 --- a/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp +++ b/lib/Transforms/Vectorize/LoadStoreVectorizer.cpp @@ -159,7 +159,7 @@ bool LoadStoreVectorizer::runOnFunction(Function &F) { ScalarEvolution &SE = getAnalysis().getSE(); // Don't vectorize when the attribute NoImplicitFloat is used. - if (F.hasFnAttribute(Attribute::NoImplicitFloat)) + if (F.hasFnAttribute(Attribute::NoImplicitFloat) || skipFunction(F)) return false; Vectorizer V(F, AA, DT, SE, VecRegSize); diff --git a/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll b/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll new file mode 100644 index 00000000000..42166f9986b --- /dev/null +++ b/test/Transforms/LoadStoreVectorizer/AMDGPU/optnone.ll @@ -0,0 +1,12 @@ +; RUN: opt -mtriple=amdgcn-amd-amdhsa -load-store-vectorizer -S -o - %s | FileCheck %s + +; CHECK-LABEL: @optnone( +; CHECK: store i32 +; CHECK: store i32 +define void @optnone(i32 addrspace(1)* %out) noinline optnone { + %out.gep.1 = getelementptr i32, i32 addrspace(1)* %out, i32 1 + + store i32 123, i32 addrspace(1)* %out.gep.1 + store i32 456, i32 addrspace(1)* %out + ret void +}