Add a skeleton Thumb2 instruction size reduction pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78456 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/ARMTargetMachine.cpp b/lib/Target/ARM/ARMTargetMachine.cpp
index a580890..5666740 100644
--- a/lib/Target/ARM/ARMTargetMachine.cpp
+++ b/lib/Target/ARM/ARMTargetMachine.cpp
@@ -26,6 +26,8 @@
cl::desc("Disable load store optimization pass"));
static cl::opt<bool> DisableIfConversion("disable-arm-if-conversion",cl::Hidden,
cl::desc("Disable if-conversion pass"));
+static cl::opt<bool> Thumb2Shrink("shrink-thumb2-instructions", cl::Hidden,
+ cl::desc("Shrink 32-bit Thumb2 instructions to 16-bit ones"));
extern "C" void LLVMInitializeARMTarget() {
// Register the target.
@@ -113,8 +115,11 @@
!DisableIfConversion && !Subtarget.isThumb())
PM.add(createIfConverterPass());
- if (Subtarget.isThumb2())
+ if (Subtarget.isThumb2()) {
PM.add(createThumb2ITBlockPass());
+ if (Thumb2Shrink)
+ PM.add(createThumb2SizeReductionPass());
+ }
PM.add(createARMConstantIslandPass());
return true;