[llvm] r248369 - [ARM] Add option to force fast-isel

Oliver Stannard via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 02:19:54 PDT 2015


Author: olista01
Date: Wed Sep 23 04:19:54 2015
New Revision: 248369

URL: http://llvm.org/viewvc/llvm-project?rev=248369&view=rev
Log:
[ARM] Add option to force fast-isel

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.


Modified:
    llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp

Modified: llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp?rev=248369&r1=248368&r2=248369&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMSubtarget.cpp Wed Sep 23 04:19:54 2015
@@ -60,6 +60,12 @@ IT(cl::desc("IT block support"), cl::Hid
                          "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 Machine
 }
 
 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;




More information about the llvm-commits mailing list