[PATCH] D42956: [ELF] - Allow set CPU string with -plugin-opt=mcpu=<xxx>
George Rimar via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 7 00:52:32 PST 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLD324459: [ELF] - Allow set CPU string with -plugin-opt=mcpu=<xxx> (authored by grimar, committed by ).
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D42956
Files:
ELF/Driver.cpp
test/ELF/lto-plugin-ignore.s
test/ELF/lto/cpu-string.ll
Index: test/ELF/lto-plugin-ignore.s
===================================================================
--- test/ELF/lto-plugin-ignore.s
+++ test/ELF/lto-plugin-ignore.s
@@ -3,8 +3,7 @@
# RUN: llvm-mc -filetype=obj -triple=x86_64-unknown-linux %s -o %t
# RUN: ld.lld %t -plugin-opt=/foo/bar -plugin-opt=-fresolution=zed \
# RUN: -plugin-opt=-pass-through=-lgcc -plugin-opt=-function-sections \
-# RUN: -plugin-opt=-data-sections -plugin-opt=mcpu=x86-64 \
-# RUN: -plugin-opt=thinlto -o /dev/null
+# RUN: -plugin-opt=-data-sections -plugin-opt=thinlto -o /dev/null
# RUN: not ld.lld %t -plugin-opt=-data-sectionxxx \
# RUN: -plugin-opt=-function-sectionxxx 2>&1 | FileCheck %s
Index: test/ELF/lto/cpu-string.ll
===================================================================
--- test/ELF/lto/cpu-string.ll
+++ test/ELF/lto/cpu-string.ll
@@ -3,14 +3,16 @@
; RUN: ld.lld %t.o -o %t.so -shared
; RUN: llvm-objdump -d -section=".text" -no-leading-addr -no-show-raw-insn %t.so | FileCheck %s
+; CHECK: nop{{$}}
; RUN: ld.lld -mllvm -mcpu=znver1 %t.o -o %t.znver1.so -shared
; RUN: llvm-objdump -d -section=".text" -no-leading-addr -no-show-raw-insn %t.znver1.so | FileCheck -check-prefix=ZNVER1 %s
-
-; CHECK: nop{{$}}
-
; ZNVER1: nopw
+; Check we are able to use -plugin-opt=mcpu=<CPU> to set CPU string.
+; RUN: ld.lld -plugin-opt=mcpu=znver1 %t.o -o %t.znver1.so -shared
+; RUN: llvm-objdump -d -section=".text" -no-leading-addr -no-show-raw-insn %t.znver1.so | FileCheck -check-prefix=ZNVER1 %s
+
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
Index: ELF/Driver.cpp
===================================================================
--- ELF/Driver.cpp
+++ ELF/Driver.cpp
@@ -703,9 +703,10 @@
Config->LTOPartitions = parseInt(S.substr(15), Arg);
else if (S.startswith("jobs="))
Config->ThinLTOJobs = parseInt(S.substr(5), Arg);
+ else if (S.startswith("mcpu="))
+ LTOOptions.push_back(Saver.save("-" + S).data());
else if (!S.startswith("/") && !S.startswith("-fresolution=") &&
- !S.startswith("-pass-through=") && !S.startswith("mcpu=") &&
- !S.startswith("thinlto"))
+ !S.startswith("-pass-through=") && !S.startswith("thinlto"))
LTOOptions.push_back(S.data());
}
// Parse and evaluate -mllvm options.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42956.133167.patch
Type: text/x-patch
Size: 2376 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180207/97035d81/attachment.bin>
More information about the llvm-commits
mailing list