[llvm] 6533c1d - Revert "[MIR] Fix a bug in MIR printer."

Michael Liao via llvm-commits llvm-commits at lists.llvm.org
Wed May 6 08:26:54 PDT 2020


Author: Michael Liao
Date: 2020-05-06T11:26:42-04:00
New Revision: 6533c1da7fab454b380ce9c2f29842ec2270583a

URL: https://github.com/llvm/llvm-project/commit/6533c1da7fab454b380ce9c2f29842ec2270583a
DIFF: https://github.com/llvm/llvm-project/commit/6533c1da7fab454b380ce9c2f29842ec2270583a.diff

LOG: Revert "[MIR] Fix a bug in MIR printer."

This reverts commit e38018b80d8e60206268740c688236734dea7b86.

Added: 
    

Modified: 
    llvm/lib/CodeGen/MIRPrinter.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/MIRPrinter.cpp b/llvm/lib/CodeGen/MIRPrinter.cpp
index 973bf3c06fcb..5e01af25bdd8 100644
--- a/llvm/lib/CodeGen/MIRPrinter.cpp
+++ b/llvm/lib/CodeGen/MIRPrinter.cpp
@@ -365,7 +365,7 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF,
   const TargetRegisterInfo *TRI = MF.getSubtarget().getRegisterInfo();
   // Process fixed stack objects.
   unsigned ID = 0;
-  for (int I = MFI.getObjectIndexBegin(); I < 0; ++I) {
+  for (int I = MFI.getObjectIndexBegin(); I < 0; ++I, ++ID) {
     if (MFI.isDeadObjectIndex(I))
       continue;
 
@@ -383,13 +383,11 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF,
     YMF.FixedStackObjects.push_back(YamlObject);
     StackObjectOperandMapping.insert(
         std::make_pair(I, FrameIndexOperand::createFixed(ID)));
-    ++ID;
-    assert(YMF.FixedStackObjects.size() == ID);
   }
 
   // Process ordinary stack objects.
   ID = 0;
-  for (int I = 0, E = MFI.getObjectIndexEnd(); I < E; ++I) {
+  for (int I = 0, E = MFI.getObjectIndexEnd(); I < E; ++I, ++ID) {
     if (MFI.isDeadObjectIndex(I))
       continue;
 
@@ -411,8 +409,6 @@ void MIRPrinter::convertStackObjects(yaml::MachineFunction &YMF,
     YMF.StackObjects.push_back(YamlObject);
     StackObjectOperandMapping.insert(std::make_pair(
         I, FrameIndexOperand::create(YamlObject.Name.Value, ID)));
-    ++ID;
-    assert(YMF.StackObjects.size() == ID);
   }
 
   for (const auto &CSInfo : MFI.getCalleeSavedInfo()) {


        


More information about the llvm-commits mailing list