OSDN Git Service

[lli] Make lli support -mcpu=native for CPU autodetection
authorCraig Topper <craig.topper@intel.com>
Tue, 9 Jan 2018 18:14:18 +0000 (18:14 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 9 Jan 2018 18:14:18 +0000 (18:14 +0000)
commit3db29f781f04acf10e2f6781cebb87c16c92f4b8
tree7d81506e57616d21968221b9a8e28ad78d3b233c
parent21f75f812f8cca2ae96c2ed05c5ad8ad2f1a2f5b
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@322100 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/CommandFlags.def
tools/lli/lli.cpp