summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/GlobalISel
diff options
context:
space:
mode:
authorAditya Nandakumar <aditya_nandakumar@apple.com>2017-05-04 22:00:42 +0000
committerAditya Nandakumar <aditya_nandakumar@apple.com>2017-05-04 22:00:42 +0000
commit21d8d317d6e2270a37e3f516531971a2853dbd29 (patch)
tree680f3030f3f41d3bea42f7d9a23b0b13dd2e053d /llvm/lib/CodeGen/GlobalISel
parent1f673d4450a45c47ffd6ba7f017316e88b165829 (diff)
downloadbcm5719-llvm-21d8d317d6e2270a37e3f516531971a2853dbd29.tar.gz
bcm5719-llvm-21d8d317d6e2270a37e3f516531971a2853dbd29.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/GlobalISel')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/Legalizer.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
index 74ed58e8d04..aec379197df 100644
--- a/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/Legalizer.cpp
@@ -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);
OpenPOWER on IntegriCloud