diff options
| author | Craig Topper <craig.topper@intel.com> | 2018-01-09 18:14:18 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@intel.com> | 2018-01-09 18:14:18 +0000 |
| commit | 243f20f1171e6730aa5b57ad28b10b50244dc2c9 (patch) | |
| tree | 4092744e3ebd8d5d2a915b40d52e63e88c561e8d /llvm/tools/lli/lli.cpp | |
| parent | 3e826f4f1b078f333af6e9bd3d3388bea87b1ebf (diff) | |
| download | bcm5719-llvm-243f20f1171e6730aa5b57ad28b10b50244dc2c9.tar.gz bcm5719-llvm-243f20f1171e6730aa5b57ad28b10b50244dc2c9.zip | |
[lli] Make lli support -mcpu=native for CPU autodetection
llc, opt, and clang can all autodetect the CPU and supported features. lli cannot as far as I could tell.
This patch uses the getCPUStr() and introduces a new getCPUFeatureList() and uses those in lli in place of MCPU and MAttrs.
Ideally, we would merge getCPUFeatureList and getCPUFeatureStr, but opt and llc need a string and lli wanted a list. Maybe we should just return the SubtargetFeature object and let the caller decide what it needs?
Differential Revision: https://reviews.llvm.org/D41833
llvm-svn: 322100
Diffstat (limited to 'llvm/tools/lli/lli.cpp')
| -rw-r--r-- | llvm/tools/lli/lli.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/tools/lli/lli.cpp b/llvm/tools/lli/lli.cpp index a33c51d7787..ede5ea751d6 100644 --- a/llvm/tools/lli/lli.cpp +++ b/llvm/tools/lli/lli.cpp @@ -378,8 +378,8 @@ int main(int argc, char **argv, char * const *envp) { std::string ErrorMsg; EngineBuilder builder(std::move(Owner)); builder.setMArch(MArch); - builder.setMCPU(MCPU); - builder.setMAttrs(MAttrs); + builder.setMCPU(getCPUStr()); + builder.setMAttrs(getFeatureList()); if (RelocModel.getNumOccurrences()) builder.setRelocationModel(RelocModel); if (CMModel.getNumOccurrences()) |

