aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/LLVMTargetMachine.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/LLVMTargetMachine.cpp
parente4a4f33daf7f05a058d7d72e5a3019f1194b597b (diff)
downloadllvm-33b07d6725ab32e20ebeb62707be21c35a66390c.zip
llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.tar.gz
llvm-33b07d6725ab32e20ebeb62707be21c35a66390c.tar.bz2
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/LLVMTargetMachine.cpp')
-rw-r--r--llvm/lib/CodeGen/LLVMTargetMachine.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LLVMTargetMachine.cpp b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
index 9eb43d2..b18a186 100644
--- a/llvm/lib/CodeGen/LLVMTargetMachine.cpp
+++ b/llvm/lib/CodeGen/LLVMTargetMachine.cpp
@@ -165,6 +165,11 @@ addPassesToGenerateCode(LLVMTargetMachine *TM, PassManagerBase &PM,
if (PassConfig->addIRTranslator())
return nullptr;
+ PassConfig->addPreLegalizeMachineIR();
+
+ if (PassConfig->addLegalizeMachineIR())
+ return nullptr;
+
// Before running the register bank selector, ask the target if it
// wants to run some passes.
PassConfig->addPreRegBankSelect();