Skip to content

Commit a0bff46

Browse files
ronliebsearlmc1
authored andcommitted
[A+A] fix llvm#2 swdev-283654 548.exchange2_r and 648.exchange2_s fail
Need to inspect for -fveclib=AMDLIBM in both clang and lld paths to trigger closed opt. Change-Id: I479b2b85e62f16d4dea80b16ab6db9bd9de093a5
1 parent 50b4b1a commit a0bff46

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

clang/lib/Driver/ToolChains/AmdOptArgs.cpp

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -116,28 +116,26 @@ static bool checkForPropOpts(const ToolChain &TC, const Driver &D,
116116
}
117117

118118
if (Arg *A = Args.getLastArg(options::OPT_fveclib)) {
119-
if (isLLD) {
120-
StringRef Name = A->getValue();
121-
if ((Name == "Accelerate") || (Name == "none") ||
122-
(Name == "MASSV") || (Name == "SVML") ||
123-
(Name == "AMDLIBM"))
119+
StringRef Name = A->getValue();
120+
if ((Name == "Accelerate") || (Name == "none") ||
121+
(Name == "MASSV") || (Name == "SVML") ||
122+
(Name == "AMDLIBM"))
123+
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
124+
Args.MakeArgString("-vector-library=" + Name));
125+
else if (( Name == "libmvec")) {
126+
switch(TC.getTriple().getArch()) {
127+
default:
128+
break;
129+
case llvm::Triple::x86_64:
124130
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
125-
Args.MakeArgString("-vector-library=" + Name));
126-
else if (( Name == "libmvec")) {
127-
switch(TC.getTriple().getArch()) {
128-
default:
129-
break;
130-
case llvm::Triple::x86_64:
131-
addCmdArgs(Args, CmdArgs, isLLD, checkOnly,
132-
Args.MakeArgString("-vector-library=LIBMVEC-X86"));
133-
break;
134-
}
135-
// fveclib supported prior to amd-opt, if its AMDLIBM then
136-
// we want to trigger closed compiler, otherwise not.
137-
if (Name == "AMDLIBM")
138-
ClosedToolChainNeeded = true;
131+
Args.MakeArgString("-vector-library=LIBMVEC-X86"));
132+
break;
139133
}
140134
}
135+
// fveclib supported prior to amd-opt, if its AMDLIBM then
136+
// we want to trigger closed compiler, otherwise not.
137+
if (Name == "AMDLIBM")
138+
ClosedToolChainNeeded = true;
141139
}
142140

143141
if (Arg *A = Args.getLastArg(options::OPT_fstruct_layout_EQ)) {

clang/test/Driver/A+A.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@
2222

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

0 commit comments

Comments
 (0)