summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2016-07-22 20:03:43 +0000
committerTim Northover <tnorthover@apple.com>2016-07-22 20:03:43 +0000
commit33b07d6725ab32e20ebeb62707be21c35a66390c (patch)
tree3347fbfe37618df37e8da560e0e29c65fda6d3c1 /llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
parente4a4f33daf7f05a058d7d72e5a3019f1194b597b (diff)
downloadbcm5719-llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.tar.gz
bcm5719-llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.zip
GlobalISel: implement legalization pass, with just one transformation.
This adds the actual MachineLegalizeHelper to do the work and a trivial pass wrapper that legalizes all instructions in a MachineFunction. Currently the only transformation supported is splitting up a vector G_ADD into one acting on smaller vectors. llvm-svn: 276461
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
index edd5ccfd9cd..600f7bc5973 100644
--- a/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/MachineLegalizer.cpp
@@ -28,10 +28,6 @@ MachineLegalizer::MachineLegalizer() : TablesInitialized(false) {
DefaultActions[TargetOpcode::G_ADD] = NarrowScalar;
}
-bool MachineLegalizer::legalizeInstr(MachineInstr &MI) const {
- llvm_unreachable("Unimplemented functionality");
-}
-
void MachineLegalizer::computeTables() {
for (auto &Op : Actions) {
LLT Ty = Op.first.second;
@@ -56,6 +52,11 @@ MachineLegalizer::getAction(unsigned Opcode, LLT Ty) const {
// These *have* to be implemented for now, they're the fundamental basis of
// how everything else is transformed.
+ // FIXME: the long-term plan calls for expansion in terms of load/store (if
+ // they're not legal).
+ if (Opcode == TargetOpcode::G_SEQUENCE || Opcode == TargetOpcode::G_EXTRACT)
+ return std::make_pair(Legal, Ty);
+
auto ActionIt = Actions.find(std::make_pair(Opcode, Ty));
if (ActionIt != Actions.end())
return findLegalAction(Opcode, Ty, ActionIt->second);
OpenPOWER on IntegriCloud