HomePhabricator

[llvm-mca] Initial implementation of serialization using JSON. The views

Authored by wolfgangp on Jan 21 2021, 2:04 PM.

Description

[llvm-mca] Initial implementation of serialization using JSON. The views
implemented at this time are Summary, Timeline, ResourcePressure and InstructionInfo.
Use --json on the command line to obtain JSON output.

Details

Committed
wolfgangpJan 21 2021, 3:15 PM
Parents
rG922b26cde4d1: Add Python bindings for the builtin dialect
Branches
Unknown
Tags
Unknown

Event Timeline

Hi. It seems this commit is causing this failure on our aarch64 bulder (https://luci-milo.appspot.com/p/fuchsia/builders/ci/clang-linux-arm64/b8857452110716658368):

FAIL: LLVM :: tools/llvm-mca/JSON/X86/views.s (39931 of 41943)
******************** TEST 'LLVM :: tools/llvm-mca/JSON/X86/views.s' FAILED ********************
Script:
--
: 'RUN: at line 5';   /opt/s/w/ir/x/w/staging/llvm_build/bin/llvm-mca -mcpu=haswell --json --timeline-max-iterations=1 --timeline < /opt/s/w/ir/x/w/llvm-project/llvm/test/tools/llvm-mca/JSON/X86/views.s | /opt/s/w/ir/x/w/staging/llvm_build/bin/FileCheck /opt/s/w/ir/x/w/llvm-project/llvm/test/tools/llvm-mca/JSON/X86/views.s
--
Exit Code: 2

Command Output (stderr):
--
'haswell' is not a recognized processor for this target (ignoring processor)
'haswell' is not a recognized processor for this target (ignoring processor)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /opt/s/w/ir/x/w/staging/llvm_build/bin/FileCheck /opt/s/w/ir/x/w/llvm-project/llvm/test/tools/llvm-mca/JSON/X86/views.s

--

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  LLVM :: tools/llvm-mca/JSON/X86/views.s

Would you mind taking a look? I'm guessing the test just needs a REQUIRES: line.

Hi. It seems this commit is causing this failure on our aarch64 bulder (https://luci-milo.appspot.com/p/fuchsia/builders/ci/clang-linux-arm64/b8857452110716658368):

Would you mind taking a look? I'm guessing the test just needs a REQUIRES: line.

Yeah, I think it was missing a triple on the command line. It should be fixed now.

nlguillemot added inline comments.
/llvm/tools/llvm-mca/Views/InstructionInfoView.cpp
96

FYI: Seeing a warning with Wrange-loop-analysis:

warning: loop variable 'I' is always a copy because the range of type 'detail::zippy<detail::zip_shortest, ArrayRef<MCInst>, MutableArrayRef<InstructionInfoViewData> &>' does not return a reference

The usual fix for this warning is to remove the ampersand.