]> granicus.if.org Git - llvm/commitdiff
[SystemZ] Fix dumpSU() method in SystemZHazardRecognizer.
authorJonas Paulsson <paulsson@linux.vnet.ibm.com>
Mon, 23 Jul 2018 15:08:35 +0000 (15:08 +0000)
committerJonas Paulsson <paulsson@linux.vnet.ibm.com>
Mon, 23 Jul 2018 15:08:35 +0000 (15:08 +0000)
Two minor issues: The new MCD SchedWrite name does not contain "Unit" like
all the others, so a check is needed. Also, print "LSU" instead of "LS".

Review: Ulrich Weigand

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337700 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/SystemZ/SystemZHazardRecognizer.cpp

index 9e8acdaabd97df0717803c4bbad1cc3765a3e76a..d300d1d88abc78efb917352c2f80651b9c265c18 100644 (file)
@@ -151,7 +151,11 @@ void SystemZHazardRecognizer::dumpSU(SUnit *SU, raw_ostream &OS) const {
     std::string FU(PRD.Name);
     // trim e.g. Z13_FXaUnit -> FXa
     FU = FU.substr(FU.find("_") + 1);
-    FU.resize(FU.find("Unit"));
+    size_t Pos = FU.find("Unit");
+    if (Pos != std::string::npos)
+      FU.resize(Pos);
+    if (FU == "LS") // LSUnit -> LSU
+      FU = "LSU";
     OS << "/" << FU;
 
     if (PI->Cycles > 1)