[PATCH] D32575: Don't try to legalize Intermediate instructions (with generic types)

Aditya Nandakumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 27 12:31:42 PDT 2017


aditya_nandakumar updated this revision to Diff 96981.
aditya_nandakumar added a comment.

Updated based on feedback - now we don't add to the list


https://reviews.llvm.org/D32575

Files:
  lib/CodeGen/GlobalISel/Legalizer.cpp


Index: lib/CodeGen/GlobalISel/Legalizer.cpp
===================================================================
--- lib/CodeGen/GlobalISel/Legalizer.cpp
+++ lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -176,8 +176,13 @@
       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);
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32575.96981.patch
Type: text/x-patch
Size: 784 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170427/7d585ab0/attachment.bin>


More information about the llvm-commits mailing list