[MCA] Don't add a name to the default code region.

This is done in preparation for a patch that fixes PR41523.

llvm-svn: 360243
This commit is contained in:
Andrea Di Biagio 2019-05-08 11:00:43 +00:00
parent 72a3b6b9e2
commit f8364cdaa4
4 changed files with 5 additions and 6 deletions

View File

@ -5,7 +5,7 @@
# LLVM-MCA-END
add %esi, %eax
# CHECK: [0] Code Region - Default
# CHECK: [0] Code Region
# CHECK: Iterations: 1
# CHECK-NEXT: Instructions: 1

View File

@ -18,7 +18,7 @@ namespace mca {
CodeRegions::CodeRegions(llvm::SourceMgr &S) : SM(S) {
// Create a default region for the input code sequence.
Regions.emplace_back(make_unique<CodeRegion>("Default", SMLoc()));
Regions.emplace_back(make_unique<CodeRegion>("", SMLoc()));
}
bool CodeRegion::isLocInRange(SMLoc Loc) const {

View File

@ -90,6 +90,8 @@ class CodeRegions {
CodeRegions &operator=(const CodeRegions &) = delete;
public:
CodeRegions(llvm::SourceMgr &S);
typedef std::vector<UniqueCodeRegion>::iterator iterator;
typedef std::vector<UniqueCodeRegion>::const_iterator const_iterator;
@ -103,8 +105,6 @@ public:
void addInstruction(const llvm::MCInst &Instruction);
llvm::SourceMgr &getSourceMgr() const { return SM; }
CodeRegions(llvm::SourceMgr &S);
llvm::ArrayRef<llvm::MCInst> getInstructionSequence(unsigned Idx) const {
return Regions[Idx]->getInstructions();
}

View File

@ -115,7 +115,6 @@ Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions() {
MCACommentConsumer CC(Regions);
Lexer.setCommentConsumer(&CC);
// Create a target-specific parser and perform the parse.
std::unique_ptr<MCTargetAsmParser> TAP(
TheTarget.createMCAsmParser(STI, *Parser, MCII, Opts));
if (!TAP)
@ -125,7 +124,7 @@ Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions() {
Parser->setTargetParser(*TAP);
Parser->Run(false);
// Get the assembler dialect from the input. llvm-mca will use this as the
// Set the assembler dialect from the input. llvm-mca will use this as the
// default dialect when printing reports.
AssemblerDialect = Parser->getAssemblerDialect();
return Regions;