[llvm] r317312 - [ARM GlobalISel] Move the check for Thumb higher up

Diana Picus via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 3 03:30:12 PDT 2017


Author: rovka
Date: Fri Nov  3 03:30:12 2017
New Revision: 317312

URL: http://llvm.org/viewvc/llvm-project?rev=317312&view=rev
Log:
[ARM GlobalISel] Move the check for Thumb higher up

We're currently bailing out for Thumb targets while lowering formal
parameters, but there used to be some other checks before it, which
could've caused some functions (e.g. those without formal parameters) to
sneak through unnoticed.

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

Modified: llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp?rev=317312&r1=317311&r2=317312&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMCallLowering.cpp Fri Nov  3 03:30:12 2017
@@ -417,6 +417,12 @@ struct FormalArgHandler : public Incomin
 bool ARMCallLowering::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
                                            const Function &F,
                                            ArrayRef<unsigned> VRegs) const {
+  auto &TLI = *getTLI<ARMTargetLowering>();
+  auto Subtarget = TLI.getSubtarget();
+
+  if (Subtarget->isThumb())
+    return false;
+
   // Quick exit if there aren't any args
   if (F.arg_empty())
     return true;
@@ -427,12 +433,6 @@ bool ARMCallLowering::lowerFormalArgumen
   auto &MF = MIRBuilder.getMF();
   auto &MBB = MIRBuilder.getMBB();
   auto DL = MF.getDataLayout();
-  auto &TLI = *getTLI<ARMTargetLowering>();
-
-  auto Subtarget = TLI.getSubtarget();
-
-  if (Subtarget->isThumb())
-    return false;
 
   for (auto &Arg : F.args())
     if (!isSupportedType(DL, TLI, Arg.getType()))




More information about the llvm-commits mailing list