summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMCallLowering.cpp
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2017-11-03 10:30:12 +0000
committerDiana Picus <diana.picus@linaro.org>2017-11-03 10:30:12 +0000
commitacf4bf21ab7aa9131bbd1d4a7331f8e0214974a8 (patch)
tree7fed76c4e095e98a2326401a4c3bed3db15f420d /llvm/lib/Target/ARM/ARMCallLowering.cpp
parent4b77f463d0838bc2bae34b05e2dab9e1d7387dae (diff)
downloadbcm5719-llvm-acf4bf21ab7aa9131bbd1d4a7331f8e0214974a8.tar.gz
bcm5719-llvm-acf4bf21ab7aa9131bbd1d4a7331f8e0214974a8.zip
[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. llvm-svn: 317312
Diffstat (limited to 'llvm/lib/Target/ARM/ARMCallLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMCallLowering.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/ARM/ARMCallLowering.cpp b/llvm/lib/Target/ARM/ARMCallLowering.cpp
index e1323cd9427..9c10a1c79a4 100644
--- a/llvm/lib/Target/ARM/ARMCallLowering.cpp
+++ b/llvm/lib/Target/ARM/ARMCallLowering.cpp
@@ -417,6 +417,12 @@ struct FormalArgHandler : public IncomingValueHandler {
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::lowerFormalArguments(MachineIRBuilder &MIRBuilder,
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()))
OpenPOWER on IntegriCloud