|
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 |
|
@@ -8284,7 +8289,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments( |
8284 | 8289 | if (Subtarget->hasCustomCallingConv()) |
8285 | 8290 | Subtarget->getRegisterInfo()->UpdateCustomCalleeSavedRegs(MF); |
8286 | 8291 |
|
8287 | | - if (!Subtarget->useNewSMEABILowering() || Attrs.hasAgnosticZAInterface()) { |
| 8292 | + if (!getTM().useNewSMEABILowering() || Attrs.hasAgnosticZAInterface()) { |
8288 | 8293 | // Old SME ABI lowering (deprecated): |
8289 | 8294 | // Create a 16 Byte TPIDR2 object. The dynamic buffer |
8290 | 8295 | // will be expanded and stored in the static object later using a |
@@ -8348,7 +8353,7 @@ SDValue AArch64TargetLowering::LowerFormalArguments( |
8348 | 8353 | } |
8349 | 8354 | } |
8350 | 8355 |
|
8351 | | - if (Subtarget->useNewSMEABILowering()) { |
| 8356 | + if (getTM().useNewSMEABILowering()) { |
8352 | 8357 | // Clear new ZT0 state. TODO: Move this to the SME ABI pass. |
8353 | 8358 | if (Attrs.isNewZT0()) |
8354 | 8359 | Chain = DAG.getNode( |
@@ -9070,7 +9075,7 @@ AArch64TargetLowering::LowerCall(CallLoweringInfo &CLI, |
9070 | 9075 |
|
9071 | 9076 | // Determine whether we need any streaming mode changes. |
9072 | 9077 | SMECallAttrs CallAttrs = getSMECallAttrs(MF.getFunction(), *this, CLI); |
9073 | | - bool UseNewSMEABILowering = Subtarget->useNewSMEABILowering(); |
| 9078 | + bool UseNewSMEABILowering = getTM().useNewSMEABILowering(); |
9074 | 9079 | bool IsAgnosticZAFunction = CallAttrs.caller().hasAgnosticZAInterface(); |
9075 | 9080 | auto ZAMarkerNode = [&]() -> std::optional<unsigned> { |
9076 | 9081 | // TODO: Handle agnostic ZA functions. |
|
0 commit comments