Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 1 | //===-- TargetSubtargetInfo.cpp - General Target Information ---------------==// |
Nate Begeman | f26625e | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Nate Begeman | f26625e | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file describes the general parts of a Subtarget. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Andrew Trick | 71e8bb6 | 2013-09-26 05:53:35 +0000 | [diff] [blame] | 14 | #include "llvm/Support/CommandLine.h" |
David Goodwin | 0d412c2 | 2009-11-10 00:48:55 +0000 | [diff] [blame] | 15 | #include "llvm/ADT/SmallVector.h" |
Chandler Carruth | 8a8cd2b | 2014-01-07 11:48:04 +0000 | [diff] [blame] | 16 | #include "llvm/Target/TargetSubtargetInfo.h" |
Nate Begeman | f26625e | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 17 | using namespace llvm; |
| 18 | |
| 19 | //--------------------------------------------------------------------------- |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 20 | // TargetSubtargetInfo Class |
Nate Begeman | f26625e | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 21 | // |
Duncan P. N. Exon Smith | 754e21f | 2015-07-10 22:43:42 +0000 | [diff] [blame] | 22 | TargetSubtargetInfo::TargetSubtargetInfo( |
Daniel Sanders | 50f1723 | 2015-09-15 16:17:27 +0000 | [diff] [blame] | 23 | const Triple &TT, StringRef CPU, StringRef FS, |
Duncan P. N. Exon Smith | 754e21f | 2015-07-10 22:43:42 +0000 | [diff] [blame] | 24 | ArrayRef<SubtargetFeatureKV> PF, ArrayRef<SubtargetFeatureKV> PD, |
| 25 | const SubtargetInfoKV *ProcSched, const MCWriteProcResEntry *WPR, |
| 26 | const MCWriteLatencyEntry *WL, const MCReadAdvanceEntry *RA, |
| 27 | const InstrStage *IS, const unsigned *OC, const unsigned *FP) |
| 28 | : MCSubtargetInfo(TT, CPU, FS, PF, PD, ProcSched, WPR, WL, RA, IS, OC, FP) { |
| 29 | } |
Nate Begeman | f26625e | 2005-07-12 01:41:54 +0000 | [diff] [blame] | 30 | |
Evan Cheng | 0d639a2 | 2011-07-01 21:01:15 +0000 | [diff] [blame] | 31 | TargetSubtargetInfo::~TargetSubtargetInfo() {} |
David Goodwin | 0d412c2 | 2009-11-10 00:48:55 +0000 | [diff] [blame] | 32 | |
Robin Morisset | 59c23cd | 2014-08-21 21:50:01 +0000 | [diff] [blame] | 33 | bool TargetSubtargetInfo::enableAtomicExpand() const { |
Eric Christopher | c40e5ed | 2014-06-19 21:03:04 +0000 | [diff] [blame] | 34 | return true; |
| 35 | } |
| 36 | |
Andrew Trick | 108c88c | 2012-11-13 08:47:29 +0000 | [diff] [blame] | 37 | bool TargetSubtargetInfo::enableMachineScheduler() const { |
| 38 | return false; |
| 39 | } |
| 40 | |
Eric Christopher | 5f141b0 | 2015-03-11 22:56:10 +0000 | [diff] [blame] | 41 | bool TargetSubtargetInfo::enableJoinGlobalCopies() const { |
| 42 | return enableMachineScheduler(); |
| 43 | } |
| 44 | |
Quentin Colombet | 5caa6a2 | 2014-07-02 18:32:04 +0000 | [diff] [blame] | 45 | bool TargetSubtargetInfo::enableRALocalReassignment( |
| 46 | CodeGenOpt::Level OptLevel) const { |
| 47 | return true; |
| 48 | } |
| 49 | |
Matthias Braun | 39a2afc | 2015-06-13 03:42:16 +0000 | [diff] [blame] | 50 | bool TargetSubtargetInfo::enablePostRAScheduler() const { |
Pete Cooper | 1175945 | 2014-09-02 17:43:54 +0000 | [diff] [blame] | 51 | return getSchedModel().PostRAScheduler; |
David Goodwin | 0d412c2 | 2009-11-10 00:48:55 +0000 | [diff] [blame] | 52 | } |
| 53 | |
Hal Finkel | b350ffd | 2013-08-29 03:25:05 +0000 | [diff] [blame] | 54 | bool TargetSubtargetInfo::useAA() const { |
| 55 | return false; |
| 56 | } |