diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-04-05 21:52:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-04-05 21:52:40 +0000 |
commit | 13bbe1f52e8d57151e2730db49094e1c62a4c793 (patch) | |
tree | c644c0db1f3b93e2cd324aba10133cfe7cbaee05 /include/llvm/Target | |
parent | b6cfeb63f8192724362565567a4cb4aa642baa1d (diff) | |
download | llvm-13bbe1f52e8d57151e2730db49094e1c62a4c793.tar.gz llvm-13bbe1f52e8d57151e2730db49094e1c62a4c793.tar.bz2 llvm-13bbe1f52e8d57151e2730db49094e1c62a4c793.tar.xz |
Use the target options specified on a function to reset the back-end.
During LTO, the target options on functions within the same Module may
change. This would necessitate resetting some of the back-end. Do this for X86,
because it's a Friday afternoon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178917 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Target')
-rw-r--r-- | include/llvm/Target/TargetLowering.h | 18 | ||||
-rw-r--r-- | include/llvm/Target/TargetOptions.h | 1 |
2 files changed, 16 insertions, 3 deletions
diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 1786bd28f3..cb62ed33a1 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -135,6 +135,11 @@ public: const TargetLoweringObjectFile *TLOF); virtual ~TargetLoweringBase(); +protected: + /// \brief Initialize all of the actions to default values. + void initActions(); + +public: const TargetMachine &getTargetMachine() const { return TM; } const DataLayout *getDataLayout() const { return TD; } const TargetLoweringObjectFile &getObjFileLowering() const { return TLOF; } @@ -851,6 +856,9 @@ public: // the derived class constructor to configure this object for the target. // + /// \brief Reset the operation actions based on target options. + virtual void resetOperationActions() {} + protected: /// setBooleanContents - Specify how the target extends the result of a /// boolean value from i1 to a wider type. See getBooleanContents. @@ -951,13 +959,17 @@ protected: RegClassForVT[VT.SimpleTy] = RC; } - /// clearRegisterClasses - remove all register classes + /// clearRegisterClasses - Remove all register classes. void clearRegisterClasses() { - for (unsigned i = 0 ; i<array_lengthof(RegClassForVT); i++) - RegClassForVT[i] = 0; + memset(RegClassForVT, 0,MVT::LAST_VALUETYPE * sizeof(TargetRegisterClass*)); + AvailableRegClasses.clear(); } + /// \brief Remove all operation actions. + void clearOperationActions() { + } + /// findRepresentativeClass - Return the largest legal super-reg register class /// of the register class for the specified type and its associated "cost". virtual std::pair<const TargetRegisterClass*, uint8_t> diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h index c31db24490..c763a595dd 100644 --- a/include/llvm/Target/TargetOptions.h +++ b/include/llvm/Target/TargetOptions.h @@ -208,6 +208,7 @@ namespace llvm { /// the value of this option. FPOpFusion::FPOpFusionMode AllowFPOpFusion; + bool operator==(const TargetOptions &); }; } // End llvm namespace |