diff options
author | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-08-02 11:41:09 +0000 |
---|---|---|
committer | Ahmed Bougacha <ahmed.bougacha@gmail.com> | 2016-08-02 11:41:09 +0000 |
commit | a124aa18257e06d9c97434c9140c7694d1cff2ad (patch) | |
tree | adc3ddb8e9073e3ced666fdbc73f06a28c8b03e4 /lib | |
parent | 99853c1c1d76ebc18817a3efd8b7cd25f26f50d8 (diff) |
[GlobalISel] Don't legalize non-generic instructions.
They don't have types and should be legal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277446 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/GlobalISel/MachineLegalizePass.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp b/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp index 0b8264f613d..bf5025201ba 100644 --- a/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp +++ b/lib/CodeGen/GlobalISel/MachineLegalizePass.cpp @@ -54,6 +54,12 @@ bool MachineLegalizePass::runOnMachineFunction(MachineFunction &MF) { // Get the next Instruction before we try to legalize, because there's a // good chance MI will be deleted. NextMI = std::next(MI); + + // Only legalize pre-isel generic instructions: others don't have types + // and are assumed to be legal. + if (!isPreISelGenericOpcode(MI->getOpcode())) + continue; + auto Res = Helper.legalizeInstr(*MI, Legalizer); // Error out if we couldn't legalize this instruction. We may want to fall |