|
17 | 17 | #include "AArch64PerfectShuffle.h" |
18 | 18 | #include "AArch64RegisterInfo.h" |
19 | 19 | #include "AArch64Subtarget.h" |
| 20 | +#include "AArch64TargetMachine.h" |
20 | 21 | #include "MCTargetDesc/AArch64AddressingModes.h" |
21 | 22 | #include "Utils/AArch64BaseInfo.h" |
22 | 23 | #include "Utils/AArch64SMEAttributes.h" |
@@ -1998,6 +1999,10 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, |
1998 | 1999 | setOperationAction(Op, MVT::f16, Promote); |
1999 | 2000 | } |
2000 | 2001 |
|
| 2002 | +const AArch64TargetMachine &AArch64TargetLowering::getTM() const { |
| 2003 | + return static_cast<const AArch64TargetMachine &>(getTargetMachine()); |
| 2004 | +} |
| 2005 | + |
2001 | 2006 | void AArch64TargetLowering::addTypeForNEON(MVT VT) { |
2002 | 2007 | assert(VT.isVector() && "VT should be a vector type"); |
2003 | 2008 |
|
@@ -8244,7 +8249,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments( |
8244 | 8249 | if (Subtarget->hasCustomCallingConv()) |
8245 | 8250 | Subtarget->getRegisterInfo()->UpdateCustomCalleeSavedRegs(MF); |
8246 | 8251 |
|
8247 | | - if (!Subtarget->useNewSMEABILowering() || Attrs.hasAgnosticZAInterface()) { |
| 8252 | + if (!getTM().useNewSMEABILowering() || Attrs.hasAgnosticZAInterface()) { |
8248 | 8253 | // Old SME ABI lowering (deprecated): |
8249 | 8254 | // Create a 16 Byte TPIDR2 object. The dynamic buffer |
8250 | 8255 | // will be expanded and stored in the static object later using a |
@@ -8308,7 +8313,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments( |
8308 | 8313 | } |
8309 | 8314 | } |
8310 | 8315 |
|
8311 | | - if (Subtarget->useNewSMEABILowering()) { |
| 8316 | + if (getTM().useNewSMEABILowering()) { |
8312 | 8317 | // Clear new ZT0 state. TODO: Move this to the SME ABI pass. |
8313 | 8318 | if (Attrs.isNewZT0()) |
8314 | 8319 | Chain = DAG.getNode( |
@@ -9024,7 +9029,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, |
9024 | 9029 |
|
9025 | 9030 | // Determine whether we need any streaming mode changes. |
9026 | 9031 | SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), CLI); |
9027 | | - bool UseNewSMEABILowering = Subtarget->useNewSMEABILowering(); |
| 9032 | + bool UseNewSMEABILowering = getTM().useNewSMEABILowering(); |
9028 | 9033 | bool IsAgnosticZAFunction = CallAttrs.caller().hasAgnosticZAInterface(); |
9029 | 9034 | auto ZAMarkerNode = [&]() -> std::optional<unsigned> { |
9030 | 9035 | // TODO: Handle agnostic ZA functions. |
|
0 commit comments