From f1a7318d1a22db12cc24c91c7e77e96f5f559ef5 Mon Sep 17 00:00:00 2001 From: Jonas Paulsson Date: Mon, 23 Jul 2018 15:08:35 +0000 Subject: [PATCH] [SystemZ] Fix dumpSU() method in SystemZHazardRecognizer. 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 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Target/SystemZ/SystemZHazardRecognizer.cpp b/lib/Target/SystemZ/SystemZHazardRecognizer.cpp index 9e8acdaabd9..d300d1d88ab 100644 --- a/lib/Target/SystemZ/SystemZHazardRecognizer.cpp +++ b/lib/Target/SystemZ/SystemZHazardRecognizer.cpp @@ -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) -- 2.50.1