Skip to content

Commit 21f7c62

Browse files
authored
[LLVM][ARM] Latency mutations for cortex m55,m7 and m85 (#115153)
This patch adds latency mutations as a scheduling related speedup for the above mentioned cores. When benchmarking this pass on selected benchmarks we see a performance improvement of 1% on most benchmarks with some improving by up to 6%. Author: David Penry <[email protected]> Co-authored-by: Nashe Mncube <[email protected]
1 parent 7a31f3c commit 21f7c62

File tree

7 files changed

+1074
-0
lines changed

7 files changed

+1074
-0
lines changed

llvm/lib/Target/ARM/ARMBaseInstrInfo.h

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -973,6 +973,34 @@ unsigned getBLXOpcode(const MachineFunction &MF);
973973
unsigned gettBLXrOpcode(const MachineFunction &MF);
974974
unsigned getBLXpredOpcode(const MachineFunction &MF);
975975

976+
inline bool isMVEVectorInstruction(const MachineInstr *MI) {
977+
// This attempts to remove non-mve instructions (scalar shifts), which
978+
// are just DPU CX instruction.
979+
switch (MI->getOpcode()) {
980+
case ARM::MVE_SQSHL:
981+
case ARM::MVE_SRSHR:
982+
case ARM::MVE_UQSHL:
983+
case ARM::MVE_URSHR:
984+
case ARM::MVE_SQRSHR:
985+
case ARM::MVE_UQRSHL:
986+
case ARM::MVE_ASRLr:
987+
case ARM::MVE_ASRLi:
988+
case ARM::MVE_LSLLr:
989+
case ARM::MVE_LSLLi:
990+
case ARM::MVE_LSRL:
991+
case ARM::MVE_SQRSHRL:
992+
case ARM::MVE_SQSHLL:
993+
case ARM::MVE_SRSHRL:
994+
case ARM::MVE_UQRSHLL:
995+
case ARM::MVE_UQSHLL:
996+
case ARM::MVE_URSHRL:
997+
return false;
998+
}
999+
const MCInstrDesc &MCID = MI->getDesc();
1000+
uint64_t Flags = MCID.TSFlags;
1001+
return (Flags & ARMII::DomainMask) == ARMII::DomainMVE;
1002+
}
1003+
9761004
} // end namespace llvm
9771005

9781006
#endif // LLVM_LIB_TARGET_ARM_ARMBASEINSTRINFO_H

0 commit comments

Comments
 (0)