diff options
author | Hal Finkel <hfinkel@anl.gov> | 2016-10-07 02:01:03 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2016-10-07 02:01:03 +0000 |
commit | 5d41f032159c4e9dcd0f7bed5b0bf8218328a585 (patch) | |
tree | 3a56dd745773a2bc22640b3fb489d5ad039fd845 /llvm/tools/llvm-opt-report/OptReport.cpp | |
parent | bd5a172d9c35c2e55a2c518f72898b0338f3eb2b (diff) | |
download | bcm5719-llvm-5d41f032159c4e9dcd0f7bed5b0bf8218328a585.tar.gz bcm5719-llvm-5d41f032159c4e9dcd0f7bed5b0bf8218328a585.zip |
[llvm-opt-report] Left justify unrolling counts, etc.
In the left part of the reports, we have things like U<number>; if some of
these numbers use more digits than others, we don't want a space in between the
U and the start of the number. Instead, the space should come afterward. This
way it is clear that the number goes with the U and not any other optimization
indicator that might come later on the line.
Tests committed in r283518.
llvm-svn: 283519
Diffstat (limited to 'llvm/tools/llvm-opt-report/OptReport.cpp')
-rw-r--r-- | llvm/tools/llvm-opt-report/OptReport.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/llvm/tools/llvm-opt-report/OptReport.cpp b/llvm/tools/llvm-opt-report/OptReport.cpp index 0e5d7b7fbc6..b82a73b6d94 100644 --- a/llvm/tools/llvm-opt-report/OptReport.cpp +++ b/llvm/tools/llvm-opt-report/OptReport.cpp @@ -412,8 +412,12 @@ static bool writeReport(LocationInfoTy &LocationInfo) { auto UStr = [UCDigits](OptReportLocationInfo &LLI) { std::string R; raw_string_ostream RS(R); - if (!Succinct) - RS << llvm::format_decimal(LLI.UnrollCount, UCDigits); + + if (!Succinct) { + RS << LLI.UnrollCount; + RS << std::string(UCDigits - RS.str().size(), ' '); + } + return RS.str(); }; @@ -421,9 +425,12 @@ static bool writeReport(LocationInfoTy &LocationInfo) { ICDigits](OptReportLocationInfo &LLI) -> std::string { std::string R; raw_string_ostream RS(R); - if (!Succinct) - RS << llvm::format_decimal(LLI.VectorizationFactor, VFDigits) << - "," << llvm::format_decimal(LLI.InterleaveCount, ICDigits); + + if (!Succinct) { + RS << LLI.VectorizationFactor << "," << LLI.InterleaveCount; + RS << std::string(VFDigits + ICDigits + 1 - RS.str().size(), ' '); + } + return RS.str(); }; |