================ @@ -1034,7 +1034,11 @@ ErrorOr<LBREntry> DataAggregator::parseLBREntry() { if (std::error_code EC = MispredStrRes.getError()) return EC; StringRef MispredStr = MispredStrRes.get(); - if (MispredStr.size() != 1 || + // SPE brstack mispredicted flags might be two characters long: 'PN' or 'MN'. + bool ProperStrSize = (MispredStr.size() == 2 && opts::ArmSPE) + ? (MispredStr[1] == 'N') + : (MispredStr.size() == 1); + if (!ProperStrSize || (MispredStr[0] != 'P' && MispredStr[0] != 'M' && MispredStr[0] != '-')) { reportError("expected single char for mispred bit"); ---------------- paschalis-mpeis wrote:
Here you can show a relevant message for each case, eg the error might be specific to SPE's taken bit or both misspred/taken parsing errors may occur. You could extract the earlier `MispredStr[0]` checks on another boolean (say `PredictionBitErr`) and reuse? Also maybe ProperStrSize could get specialized to something like `SpeTakenBitErr`. https://github.com/llvm/llvm-project/pull/129231 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits