[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

llvm-svn: 302199
This commit is contained in:
Aditya Nandakumar 2017-05-04 22:00:42 +00:00
parent 1f673d4450
commit 21d8d317d6
1 changed files with 7 additions and 2 deletions

View File

@ -176,8 +176,13 @@ bool Legalizer::runOnMachineFunction(MachineFunction &MF) {
unsigned NumNewInsns = 0;
SmallVector<MachineInstr *, 4> WorkList;
Helper.MIRBuilder.recordInsertions([&](MachineInstr *MI) {
++NumNewInsns;
WorkList.push_back(MI);
// Only legalize pre-isel generic instructions.
// 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);