aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp27
1 files changed, 20 insertions, 7 deletions
diff --git a/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp
index 237ef54c8339..ae7ea7c2f415 100644
--- a/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/contrib/llvm-project/llvm/lib/Target/ARM/ARMTargetMachine.cpp
@@ -47,6 +47,7 @@
#include "llvm/Target/TargetLoweringObjectFile.h"
#include "llvm/Target/TargetOptions.h"
#include "llvm/Transforms/CFGuard.h"
+#include "llvm/Transforms/IPO.h"
#include "llvm/Transforms/Scalar.h"
#include <cassert>
#include <memory>
@@ -96,12 +97,13 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeARMTarget() {
initializeARMExpandPseudoPass(Registry);
initializeThumb2SizeReducePass(Registry);
initializeMVEVPTBlockPass(Registry);
- initializeMVEVPTOptimisationsPass(Registry);
+ initializeMVETPAndVPTOptimisationsPass(Registry);
initializeMVETailPredicationPass(Registry);
initializeARMLowOverheadLoopsPass(Registry);
initializeARMBlockPlacementPass(Registry);
initializeMVEGatherScatterLoweringPass(Registry);
initializeARMSLSHardeningPass(Registry);
+ initializeMVELaneInterleavingPass(Registry);
}
static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) {
@@ -273,8 +275,7 @@ ARMBaseTargetMachine::getSubtargetImpl(const Function &F) const {
// function before we can generate a subtarget. We also need to use
// it as a key for the subtarget since that can be the only difference
// between two functions.
- bool SoftFloat =
- F.getFnAttribute("use-soft-float").getValueAsString() == "true";
+ bool SoftFloat = F.getFnAttribute("use-soft-float").getValueAsBool();
// If the soft float attribute is set on the function turn on the soft float
// subtarget feature.
if (SoftFloat)
@@ -416,6 +417,7 @@ void ARMPassConfig::addIRPasses() {
}));
addPass(createMVEGatherScatterLoweringPass());
+ addPass(createMVELaneInterleavingPass());
TargetPassConfig::addIRPasses();
@@ -461,6 +463,14 @@ bool ARMPassConfig::addPreISel() {
if (TM->getOptLevel() != CodeGenOpt::None) {
addPass(createHardwareLoopsPass());
addPass(createMVETailPredicationPass());
+ // FIXME: IR passes can delete address-taken basic blocks, deleting
+ // corresponding blockaddresses. ARMConstantPoolConstant holds references to
+ // address-taken basic blocks which can be invalidated if the function
+ // containing the blockaddress has already been codegen'd and the basic
+ // block is removed. Work around this by forcing all IR passes to run before
+ // any ISel takes place. We should have a more principled way of handling
+ // this. See D99707 for more details.
+ addPass(createBarrierNoopPass());
}
return false;
@@ -487,13 +497,13 @@ bool ARMPassConfig::addRegBankSelect() {
}
bool ARMPassConfig::addGlobalInstructionSelect() {
- addPass(new InstructionSelect());
+ addPass(new InstructionSelect(getOptLevel()));
return false;
}
void ARMPassConfig::addPreRegAlloc() {
if (getOptLevel() != CodeGenOpt::None) {
- addPass(createMVEVPTOptimisationsPass());
+ addPass(createMVETPAndVPTOptimisationsPass());
addPass(createMLxExpansionPass());
@@ -564,7 +574,10 @@ void ARMPassConfig::addPreEmitPass2() {
addPass(createARMConstantIslandPass());
addPass(createARMLowOverheadLoopsPass());
- // Identify valid longjmp targets for Windows Control Flow Guard.
- if (TM->getTargetTriple().isOSWindows())
+ if (TM->getTargetTriple().isOSWindows()) {
+ // Identify valid longjmp targets for Windows Control Flow Guard.
addPass(createCFGuardLongjmpPass());
+ // Identify valid eh continuation targets for Windows EHCont Guard.
+ addPass(createEHContGuardCatchretPass());
+ }
}