diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp index 84876eda33a6..9ead5fa4308c 100644 --- a/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -96,6 +96,7 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() { initializeARMExpandPseudoPass(Registry); initializeThumb2SizeReducePass(Registry); initializeMVEVPTBlockPass(Registry); + initializeMVEVPTOptimisationsPass(Registry); initializeMVETailPredicationPass(Registry); initializeARMLowOverheadLoopsPass(Registry); initializeMVEGatherScatterLoweringPass(Registry); @@ -243,7 +244,14 @@ ARMBaseTargetMachine::ARMBaseTargetMachine(const Target &T, const Triple &TT, this->Options.NoTrapAfterNoreturn = true; } + // ARM supports the debug entry values. + setSupportsDebugEntryValues(true); + initAsmInfo(); + + // ARM supports the MachineOutliner. + setMachineOutliner(true); + setSupportsDefaultOutlining(false); } ARMBaseTargetMachine::~ARMBaseTargetMachine() = default; @@ -359,6 +367,7 @@ public: void addPreRegAlloc() override; void addPreSched2() override; void addPreEmitPass() override; + void addPreEmitPass2() override; std::unique_ptr<CSEConfigBase> getCSEConfig() const override; }; @@ -483,6 +492,8 @@ bool ARMPassConfig::addGlobalInstructionSelect() { void ARMPassConfig::addPreRegAlloc() { if (getOptLevel() != CodeGenOpt::None) { + addPass(createMVEVPTOptimisationsPass()); + addPass(createMLxExpansionPass()); if (EnableARMLoadStoreOpt) @@ -507,9 +518,12 @@ void ARMPassConfig::addPreSched2() { addPass(createARMExpandPseudoPass()); if (getOptLevel() != CodeGenOpt::None) { - // in v8, IfConversion depends on Thumb instruction widths + // When optimising for size, always run the Thumb2SizeReduction pass before + // IfConversion. Otherwise, check whether IT blocks are restricted + // (e.g. in v8, IfConversion depends on Thumb instruction widths) addPass(createThumb2SizeReductionPass([this](const Function &F) { - return this->TM->getSubtarget<ARMSubtarget>(F).restrictIT(); + return this->TM->getSubtarget<ARMSubtarget>(F).hasMinSize() || + this->TM->getSubtarget<ARMSubtarget>(F).restrictIT(); })); addPass(createIfConverter([](const MachineFunction &MF) { @@ -538,7 +552,9 @@ void ARMPassConfig::addPreEmitPass() { // Don't optimize barriers at -O0. if (getOptLevel() != CodeGenOpt::None) addPass(createARMOptimizeBarriersPass()); +} +void ARMPassConfig::addPreEmitPass2() { addPass(createARMConstantIslandPass()); addPass(createARMLowOverheadLoopsPass()); |