summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
diff options
context:
space:
mode:
authorDiana Picus <diana.picus@linaro.org>2017-02-17 11:25:17 +0000
committerDiana Picus <diana.picus@linaro.org>2017-02-17 11:25:17 +0000
commit7cab0786bdcca1300cf9150788d3b1f5abd9923c (patch)
tree49534aa4da1c77375df990c1a3933ca89e14df53 /llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
parentd2f3ba71c9bc1f972c1353a55d9fe58346d8698a (diff)
downloadbcm5719-llvm-7cab0786bdcca1300cf9150788d3b1f5abd9923c.tar.gz
bcm5719-llvm-7cab0786bdcca1300cf9150788d3b1f5abd9923c.zip
[ARM] GlobalISel: Use Subtarget in Legalizer
Start using the Subtarget to make decisions about what's legal. In particular, we only mark floating point operations as legal if we have VFP2, which is something we should've done from the very start. llvm-svn: 295439
Diffstat (limited to 'llvm/lib/Target/ARM/ARMLegalizerInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMLegalizerInfo.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
index a4f93b433f6..ceebc39e898 100644
--- a/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMLegalizerInfo.cpp
@@ -12,6 +12,7 @@
//===----------------------------------------------------------------------===//
#include "ARMLegalizerInfo.h"
+#include "ARMSubtarget.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/IR/DerivedTypes.h"
#include "llvm/IR/Type.h"
@@ -23,7 +24,7 @@ using namespace llvm;
#error "You shouldn't build this"
#endif
-ARMLegalizerInfo::ARMLegalizerInfo() {
+ARMLegalizerInfo::ARMLegalizerInfo(const ARMSubtarget &ST) {
using namespace TargetOpcode;
const LLT p0 = LLT::pointer(0, 32);
@@ -40,11 +41,6 @@ ARMLegalizerInfo::ARMLegalizerInfo() {
setAction({G_LOAD, Ty}, Legal);
setAction({G_LOAD, 1, p0}, Legal);
- // FIXME: This is strictly for loading double-precision floating point values,
- // if the hardware allows it. We rely on the instruction selector to complain
- // otherwise.
- setAction({G_LOAD, s64}, Legal);
-
for (auto Ty : {s1, s8, s16, s32})
setAction({G_ADD, Ty}, Legal);
@@ -54,10 +50,12 @@ ARMLegalizerInfo::ARMLegalizerInfo() {
setAction({Op, 1, Ty}, Legal);
}
- // FIXME: This is a bit sloppy, but for now we'll just rely on the instruction
- // selector to complain if it doesn't support floating point.
- setAction({G_FADD, s32}, Legal);
- setAction({G_FADD, s64}, Legal);
+ if (ST.hasVFP2()) {
+ setAction({G_FADD, s32}, Legal);
+ setAction({G_FADD, s64}, Legal);
+
+ setAction({G_LOAD, s64}, Legal);
+ }
computeTables();
}
OpenPOWER on IntegriCloud