forked from OSchip/llvm-project
[Hexagon] Enable auto-vectorization only when -fvectorize was given
llvm-svn: 329923
This commit is contained in:
parent
8aa6cd5cb9
commit
e4b0b6e374
|
@ -520,6 +520,13 @@ void HexagonToolChain::addClangTargetOptions(const ArgList &DriverArgs,
|
|||
CC1Args.push_back("-target-feature");
|
||||
CC1Args.push_back("+reserved-r19");
|
||||
}
|
||||
if (Arg *A = DriverArgs.getLastArg(options::OPT_fvectorize,
|
||||
options::OPT_fno_vectorize)) {
|
||||
if (A->getOption().matches(options::OPT_fvectorize)) {
|
||||
CC1Args.push_back("-mllvm");
|
||||
CC1Args.push_back("-hexagon-autohvx");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void HexagonToolChain::AddClangSystemIncludeArgs(const ArgList &DriverArgs,
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
// RUN: %clang -target hexagon -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-DEFAULT
|
||||
// RUN: %clang -target hexagon -fvectorize -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-VECTOR
|
||||
// RUN: %clang -target hexagon -fvectorize -fno-vectorize -### %s 2>&1 | FileCheck %s --check-prefix=CHECK-NOVECTOR
|
||||
|
||||
// CHECK-DEFAULT-NOT: hexagon-autohvx
|
||||
// CHECK-VECTOR: "-mllvm" "-hexagon-autohvx"
|
||||
// CHECK-NOVECTOR-NOT: hexagon-autohvx
|
Loading…
Reference in New Issue