diff options
author | Sam Parker <sam.parker@arm.com> | 2019-06-25 10:45:51 +0000 |
---|---|---|
committer | Sam Parker <sam.parker@arm.com> | 2019-06-25 10:45:51 +0000 |
commit | a6fd919cb3f5e72fb07b961a567c658192782e83 (patch) | |
tree | ccd6464fa10064c090220f6c43d8919bafec36cb /llvm/lib/Target/ARM/ARMTargetMachine.cpp | |
parent | ecd9348aa176aa535cd041ab848a043a10824b9d (diff) | |
download | bcm5719-llvm-a6fd919cb3f5e72fb07b961a567c658192782e83.tar.gz bcm5719-llvm-a6fd919cb3f5e72fb07b961a567c658192782e83.zip |
[ARM] DLS/LE low-overhead loop code generation
Introduce three pseudo instructions to be used during DAG ISel to
represent v8.1-m low-overhead loops. One maps to set_loop_iterations
while loop_decrement_reg is lowered to two, so that we can separate
the decrement and branching operations. The pseudo instructions are
expanded pre-emission, where we can still decide whether we actually
want to generate a low-overhead loop, in a new pass:
ARMLowOverheadLoops. The pass currently bails, reverting to an sub,
icmp and br, in the cases where a call or stack spill/restore happens
between the decrement and branching instructions, or if the loop is
too large.
Differential Revision: https://reviews.llvm.org/D63476
llvm-svn: 364288
Diffstat (limited to 'llvm/lib/Target/ARM/ARMTargetMachine.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMTargetMachine.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMTargetMachine.cpp b/llvm/lib/Target/ARM/ARMTargetMachine.cpp index bd8c5d0b1b6..7f0aae1739b 100644 --- a/llvm/lib/Target/ARM/ARMTargetMachine.cpp +++ b/llvm/lib/Target/ARM/ARMTargetMachine.cpp @@ -96,6 +96,7 @@ extern "C" void LLVMInitializeARMTarget() { initializeARMExpandPseudoPass(Registry); initializeThumb2SizeReducePass(Registry); initializeMVEVPTBlockPass(Registry); + initializeARMLowOverheadLoopsPass(Registry); } static std::unique_ptr<TargetLoweringObjectFile> createTLOF(const Triple &TT) { @@ -446,6 +447,9 @@ bool ARMPassConfig::addPreISel() { MergeExternalByDefault)); } + if (TM->getOptLevel() != CodeGenOpt::None) + addPass(createHardwareLoopsPass()); + return false; } @@ -526,4 +530,5 @@ void ARMPassConfig::addPreEmitPass() { addPass(createARMOptimizeBarriersPass()); addPass(createARMConstantIslandPass()); + addPass(createARMLowOverheadLoopsPass()); } |