[llvm] r210599 - Move AArch64InstrInfo to AArch64Subtarget.

Eric Christopher echristo at gmail.com
Tue Jun 10 17:15:17 PDT 2014


On Tue, Jun 10, 2014 at 5:08 PM, Tom Stellard <tom at stellard.net> wrote:
> On Tue, Jun 10, 2014 at 10:57:26PM -0000, Eric Christopher wrote:
>> Author: echristo
>> Date: Tue Jun 10 17:57:25 2014
>> New Revision: 210599
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=210599&view=rev
>> Log:
>> Move AArch64InstrInfo to AArch64Subtarget.
>>
>
> Hi Eric,
>
> What is the purpose of this change, and are you planning to make the
> same change for all targets?

See this thread here:

http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20140519/218383.html

and ultimately yes depending on how much I want to clean up the
TargetMachine API to avoid subtargets. The motivating factor is to be
able to have a subtarget based on features attached to the function
though.

-eric

>
> -Tom
>
>> Modified:
>>     llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp
>>     llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h
>>     llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp
>>     llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h
>>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp?rev=210599&r1=210598&r2=210599&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp (original)
>> +++ llvm/trunk/lib/Target/AArch64/AArch64Subtarget.cpp Tue Jun 10 17:57:25 2014
>> @@ -44,7 +44,7 @@ AArch64Subtarget::AArch64Subtarget(const
>>               ? "e-m:o-i64:64-i128:128-n32:64-S128"
>>               : (LittleEndian ? "e-m:e-i64:64-i128:128-n32:64-S128"
>>                               : "E-m:e-i64:64-i128:128-n32:64-S128")),
>> -      FrameLowering(), TSInfo(&DL) {
>> +      FrameLowering(), InstrInfo(*this), TSInfo(&DL) {
>>    // Determine default and user-specified characteristics
>>
>>    if (CPUString.empty())
>>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h?rev=210599&r1=210598&r2=210599&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h (original)
>> +++ llvm/trunk/lib/Target/AArch64/AArch64Subtarget.h Tue Jun 10 17:57:25 2014
>> @@ -14,6 +14,7 @@
>>  #ifndef AArch64SUBTARGET_H
>>  #define AArch64SUBTARGET_H
>>
>> +#include "AArch64InstrInfo.h"
>>  #include "AArch64FrameLowering.h"
>>  #include "AArch64RegisterInfo.h"
>>  #include "AArch64SelectionDAGInfo.h"
>> @@ -54,6 +55,7 @@ protected:
>>
>>    const DataLayout DL;
>>    AArch64FrameLowering FrameLowering;
>> +  AArch64InstrInfo InstrInfo;
>>    AArch64SelectionDAGInfo TSInfo;
>>
>>  public:
>> @@ -66,6 +68,7 @@ public:
>>    const AArch64FrameLowering *getFrameLowering() const {
>>      return &FrameLowering;
>>    }
>> +  const AArch64InstrInfo *getInstrInfo() const { return &InstrInfo; }
>>    const DataLayout *getDataLayout() const { return &DL; }
>>    bool enableMachineScheduler() const override { return true; }
>>
>>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp?rev=210599&r1=210598&r2=210599&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp (original)
>> +++ llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.cpp Tue Jun 10 17:57:25 2014
>> @@ -77,8 +77,7 @@ AArch64TargetMachine::AArch64TargetMachi
>>                                             CodeGenOpt::Level OL,
>>                                             bool LittleEndian)
>>      : LLVMTargetMachine(T, TT, CPU, FS, Options, RM, CM, OL),
>> -      Subtarget(TT, CPU, FS, LittleEndian),
>> -      InstrInfo(Subtarget), TLInfo(*this) {
>> +      Subtarget(TT, CPU, FS, LittleEndian), TLInfo(*this) {
>>    initAsmInfo();
>>  }
>>
>>
>> Modified: llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h?rev=210599&r1=210598&r2=210599&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h (original)
>> +++ llvm/trunk/lib/Target/AArch64/AArch64TargetMachine.h Tue Jun 10 17:57:25 2014
>> @@ -30,7 +30,6 @@ protected:
>>    AArch64Subtarget Subtarget;
>>
>>  private:
>> -  AArch64InstrInfo InstrInfo;
>>    AArch64TargetLowering TLInfo;
>>
>>  public:
>> @@ -51,9 +50,11 @@ public:
>>    const AArch64FrameLowering *getFrameLowering() const override {
>>      return getSubtargetImpl()->getFrameLowering();
>>    }
>> -  const AArch64InstrInfo *getInstrInfo() const override { return &InstrInfo; }
>> +  const AArch64InstrInfo *getInstrInfo() const override {
>> +    return getSubtargetImpl()->getInstrInfo();
>> +  }
>>    const AArch64RegisterInfo *getRegisterInfo() const override {
>> -    return &InstrInfo.getRegisterInfo();
>> +    return &getInstrInfo()->getRegisterInfo();
>>    }
>>    const AArch64SelectionDAGInfo *getSelectionDAGInfo() const override {
>>      return getSubtargetImpl()->getSelectionDAGInfo();
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list