forked from OSchip/llvm-project
[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:
parent
18adcf331b
commit
d52a542e4c
|
@ -5,7 +5,7 @@
|
||||||
# LLVM-MCA-END
|
# LLVM-MCA-END
|
||||||
add %esi, %eax
|
add %esi, %eax
|
||||||
|
|
||||||
# CHECK: [0] Code Region - Default
|
# CHECK: [0] Code Region
|
||||||
|
|
||||||
# CHECK: Iterations: 1
|
# CHECK: Iterations: 1
|
||||||
# CHECK-NEXT: Instructions: 1
|
# CHECK-NEXT: Instructions: 1
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace mca {
|
||||||
|
|
||||||
CodeRegions::CodeRegions(llvm::SourceMgr &S) : SM(S) {
|
CodeRegions::CodeRegions(llvm::SourceMgr &S) : SM(S) {
|
||||||
// Create a default region for the input code sequence.
|
// 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 {
|
bool CodeRegion::isLocInRange(SMLoc Loc) const {
|
||||||
|
|
|
@ -90,6 +90,8 @@ class CodeRegions {
|
||||||
CodeRegions &operator=(const CodeRegions &) = delete;
|
CodeRegions &operator=(const CodeRegions &) = delete;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
CodeRegions(llvm::SourceMgr &S);
|
||||||
|
|
||||||
typedef std::vector<UniqueCodeRegion>::iterator iterator;
|
typedef std::vector<UniqueCodeRegion>::iterator iterator;
|
||||||
typedef std::vector<UniqueCodeRegion>::const_iterator const_iterator;
|
typedef std::vector<UniqueCodeRegion>::const_iterator const_iterator;
|
||||||
|
|
||||||
|
@ -103,8 +105,6 @@ public:
|
||||||
void addInstruction(const llvm::MCInst &Instruction);
|
void addInstruction(const llvm::MCInst &Instruction);
|
||||||
llvm::SourceMgr &getSourceMgr() const { return SM; }
|
llvm::SourceMgr &getSourceMgr() const { return SM; }
|
||||||
|
|
||||||
CodeRegions(llvm::SourceMgr &S);
|
|
||||||
|
|
||||||
llvm::ArrayRef<llvm::MCInst> getInstructionSequence(unsigned Idx) const {
|
llvm::ArrayRef<llvm::MCInst> getInstructionSequence(unsigned Idx) const {
|
||||||
return Regions[Idx]->getInstructions();
|
return Regions[Idx]->getInstructions();
|
||||||
}
|
}
|
||||||
|
|
|
@ -115,7 +115,6 @@ Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions() {
|
||||||
MCACommentConsumer CC(Regions);
|
MCACommentConsumer CC(Regions);
|
||||||
Lexer.setCommentConsumer(&CC);
|
Lexer.setCommentConsumer(&CC);
|
||||||
|
|
||||||
// Create a target-specific parser and perform the parse.
|
|
||||||
std::unique_ptr<MCTargetAsmParser> TAP(
|
std::unique_ptr<MCTargetAsmParser> TAP(
|
||||||
TheTarget.createMCAsmParser(STI, *Parser, MCII, Opts));
|
TheTarget.createMCAsmParser(STI, *Parser, MCII, Opts));
|
||||||
if (!TAP)
|
if (!TAP)
|
||||||
|
@ -125,7 +124,7 @@ Expected<const CodeRegions &> AsmCodeRegionGenerator::parseCodeRegions() {
|
||||||
Parser->setTargetParser(*TAP);
|
Parser->setTargetParser(*TAP);
|
||||||
Parser->Run(false);
|
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.
|
// default dialect when printing reports.
|
||||||
AssemblerDialect = Parser->getAssemblerDialect();
|
AssemblerDialect = Parser->getAssemblerDialect();
|
||||||
return Regions;
|
return Regions;
|
||||||
|
|
Loading…
Reference in New Issue