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

Aditya Nandakumar via llvm-commits llvm-commits at lists.llvm.org
Thu May 4 15:00:42 PDT 2017


Author: aditya_nandakumar
Date: Thu May  4 17:00:42 2017
New Revision: 302199

URL: http://llvm.org/viewvc/llvm-project?rev=302199&view=rev
Log:
[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

Modified:
    llvm/trunk/lib/CodeGen/GlobalISel/Legalizer.cpp

Modified: llvm/trunk/lib/CodeGen/GlobalISel/Legalizer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GlobalISel/Legalizer.cpp?rev=302199&r1=302198&r2=302199&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GlobalISel/Legalizer.cpp (original)
+++ llvm/trunk/lib/CodeGen/GlobalISel/Legalizer.cpp Thu May  4 17:00:42 2017
@@ -176,8 +176,13 @@ bool Legalizer::runOnMachineFunction(Mac
       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);
 




More information about the llvm-commits mailing list