summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-mca/llvm-mca.cpp
diff options
context:
space:
mode:
authorAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-05-09 15:18:09 +0000
committerAndrea Di Biagio <Andrea_DiBiagio@sn.scee.net>2019-05-09 15:18:09 +0000
commit4e62554bfae2703b797ddff64e583aed0c4a7e35 (patch)
treeee12951bd5d713feca753fed7c926773509513e1 /llvm/tools/llvm-mca/llvm-mca.cpp
parentdcdb3c6650e67c99e9f5df079044dbbf412514e9 (diff)
downloadbcm5719-llvm-4e62554bfae2703b797ddff64e583aed0c4a7e35.tar.gz
bcm5719-llvm-4e62554bfae2703b797ddff64e583aed0c4a7e35.zip
[MCA] Add support for nested and overlapping region markers
This patch fixes PR41523 https://bugs.llvm.org/show_bug.cgi?id=41523 Regions can now nest/overlap provided that they have different names. Anonymous regions cannot overlap. Region end markers must specify the region name. The only exception is for when there is only one user-defined region; in that particular case, the region end marker doesn't need to specify a name. Incorrect region end markers are no longer ignored. Instead, the tool reports an error and we exit with an error code. Added test cases to verify the new diagnostic error messages. Updated the llvm-mca docs to reflect this feature change. Differential Revision: https://reviews.llvm.org/D61676 llvm-svn: 360351
Diffstat (limited to 'llvm/tools/llvm-mca/llvm-mca.cpp')
-rw-r--r--llvm/tools/llvm-mca/llvm-mca.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/tools/llvm-mca/llvm-mca.cpp b/llvm/tools/llvm-mca/llvm-mca.cpp
index 861b6a5809a..e70c8f627ef 100644
--- a/llvm/tools/llvm-mca/llvm-mca.cpp
+++ b/llvm/tools/llvm-mca/llvm-mca.cpp
@@ -364,6 +364,11 @@ int main(int argc, char **argv) {
return 1;
}
const mca::CodeRegions &Regions = *RegionsOrErr;
+
+ // Early exit if errors were found by the code region parsing logic.
+ if (!Regions.isValid())
+ return 1;
+
if (Regions.empty()) {
WithColor::error() << "no assembly instructions found.\n";
return 1;
OpenPOWER on IntegriCloud