[ARM] Add option to force fast-isel
authorOliver Stannard <oliver.stannard@arm.com>
Wed, 23 Sep 2015 09:19:54 +0000 (09:19 +0000)
committerOliver Stannard <oliver.stannard@arm.com>
Wed, 23 Sep 2015 09:19:54 +0000 (09:19 +0000)
The ARM backend has some logic that only allows the fast-isel to be enabled for
subtargets where it is known to be stable. This adds a backend option to
override this and force the fast-isel to be used for any target, to allow it to
be tested.

This is an ARM-specific option, because no other backend disables the fast-isel
on a per-subtarget basis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@248369 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMSubtarget.cpp

index 56ce171e4ca1b92ad76824c33474557cd6316b12..0b070710c1237603d0a92718e73daff721a5f1b2 100644 (file)
@@ -60,6 +60,12 @@ IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT),
                          "Allow IT blocks based on ARMv7"),
               clEnumValEnd));
 
+/// ForceFastISel - Use the fast-isel, even for subtargets where it is not
+/// currently supported (for testing only).
+static cl::opt<bool>
+ForceFastISel("arm-force-fast-isel",
+               cl::init(false), cl::Hidden);
+
 /// initializeSubtargetDependencies - Initializes using a CPU and feature string
 /// so that we can use initializer lists for subtarget initialization.
 ARMSubtarget &ARMSubtarget::initializeSubtargetDependencies(StringRef CPU,
@@ -298,6 +304,10 @@ bool ARMSubtarget::useMovt(const MachineFunction &MF) const {
 }
 
 bool ARMSubtarget::useFastISel() const {
+  // Enable fast-isel for any target, for testing only.
+  if (ForceFastISel)
+    return true;
+
   // Limit fast-isel to the targets that are or have been tested.
   if (!hasV6Ops())
     return false;