Skip to content

Commit

Permalink
[A+A] fix llvm#2 swdev-283654 548.exchange2_r and 648.exchange2_s fail
Browse files Browse the repository at this point in the history
Need to inspect for -fveclib=AMDLIBM in both clang and lld paths
to trigger closed opt.

Change-Id: I479b2b85e62f16d4dea80b16ab6db9bd9de093a5
  • Loading branch information
ronlieb committed Apr 30, 2021
1 parent 6e51841 commit b08863e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
36 changes: 17 additions & 19 deletions clang/lib/Driver/ToolChains/AmdOptArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,28 +116,26 @@ static bool checkForPropOpts(const ToolChain &TC, const Driver &D,
}

if (Arg *A = Args.getLastArg(options::OPT_fveclib)) {
if (isLLD) {
StringRef Name = A->getValue();
if ((Name == "Accelerate") || (Name == "none") ||
(Name == "MASSV") || (Name == "SVML") ||
(Name == "AMDLIBM"))
StringRef Name = A->getValue();
if ((Name == "Accelerate") || (Name == "none") ||
(Name == "MASSV") || (Name == "SVML") ||
(Name == "AMDLIBM"))
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
Args.MakeArgString("-vector-library=" + Name));
else if (( Name == "libmvec")) {
switch(TC.getTriple().getArch()) {
default:
break;
case llvm::Triple::x86_64:
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
Args.MakeArgString("-vector-library=" + Name));
else if (( Name == "libmvec")) {
switch(TC.getTriple().getArch()) {
default:
break;
case llvm::Triple::x86_64:
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
Args.MakeArgString("-vector-library=LIBMVEC-X86"));
break;
}
// fveclib supported prior to amd-opt, if its AMDLIBM then
// we want to trigger closed compiler, otherwise not.
if (Name == "AMDLIBM")
ClosedToolChainNeeded = true;
Args.MakeArgString("-vector-library=LIBMVEC-X86"));
break;
}
}
// fveclib supported prior to amd-opt, if its AMDLIBM then
// we want to trigger closed compiler, otherwise not.
if (Name == "AMDLIBM")
ClosedToolChainNeeded = true;
}

if (Arg *A = Args.getLastArg(options::OPT_fstruct_layout_EQ)) {
Expand Down
2 changes: 2 additions & 0 deletions clang/test/Driver/A+A.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@

// RUN: %clang -famd-opt -O3 -### %s 2>&1 | FileCheck --check-prefix=CHECK-ALT-MISS %s
// CHECK-ALT-MISS: warning: The [AMD] proprietary optimization compiler installation was not found
// RUN: %clang -fveclib=AMDLIBM -O3 -### %s 2>&1 | FileCheck --check-prefix=CHECK-VECLIB %s
// CHECK-VECLIB: warning: The [AMD] proprietary optimization compiler installation was not found

0 comments on commit b08863e

Please sign in to comment.