[GISel]:Skip legalizing Intermediate inst(with generic types)

During legalization, targets can create Pseudo Instructions with
generic types. We shouldn't try to legalize them.

Reviewed by Quentin, dsanders
https://reviews.llvm.org/D32575

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302199 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Aditya Nandakumar 2017-05-04 22:00:42 +00:00
parent 195a2d9be0
commit 7d7f10bcdd

View File

@ -176,8 +176,13 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) {
unsigned NumNewInsns = 0; unsigned NumNewInsns = 0;
SmallVector<MachineInstr *, 4> WorkList; SmallVector<MachineInstr *, 4> WorkList;
Helper.MIRBuilder.recordInsertions([&](MachineInstr *MI) { Helper.MIRBuilder.recordInsertions([&](MachineInstr *MI) {
++NumNewInsns; // Only legalize pre-isel generic instructions.
WorkList.push_back(MI); // Legalization process could generate Target specific pseudo
// instructions with generic types. Don't record them
if (isPreISelGenericOpcode(MI->getOpcode())) {
++NumNewInsns;
WorkList.push_back(MI);
}
}); });
WorkList.push_back(&*MI); WorkList.push_back(&*MI);