[all-commits] [llvm/llvm-project] 781a81: [llvm][Arm/AArch64] Format extension flags in CPU ...

David Spickett via All-commits all-commits at lists.llvm.org
Tue Dec 22 03:13:55 PST 2020


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 781a816d4cacbd0e73d36b12f82c87c0393b5a5b
      https://github.com/llvm/llvm-project/commit/781a816d4cacbd0e73d36b12f82c87c0393b5a5b
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2020-12-22 (Tue, 22 Dec 2020)

  Changed paths:
    M llvm/unittests/Support/TargetParserTest.cpp

  Log Message:
  -----------
  [llvm][Arm/AArch64] Format extension flags in CPU test failures

Previously you just two hex numbers you had to decode manually.
This change adds a predicate formatter for extension flags
to produce failure messages like:
```
[ RUN      ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2
<...>llvm/unittests/Support/TargetParserTest.cpp:862:
Failure
Expected extension flags: +fp-armv8, +crc, +crypto (0xe)
     Got extension flags: +fp-armv8, +neon, +crc, +crypto (0x1e)
[  FAILED  ] AArch64CPUTests/AArch64CPUTestFixture.testAArch64CPU/2,
where GetParam() = "cortex-a34", "armv8-a", <...>
```

>From there you can take the feature name and map it back
to the enum in ARM/AArch64TargetParser.def.
(which isn't perfect but you've probably got both files
open if you're editing these tests)

Note that AEK_NONE is not meant to be user facing in the compiler
but here it is part of the tests. So failures may show an
extension "none" where the normal target parser wouldn't.

The formatter is implemented as a template on ARM::ISAKind
because the predicate formatters assume all parameters are used
for comparison.
(e.g. PRED_FORMAT3 is for comparing 3 values, not having 3
arguments in general)

Reviewed By: MarkMurrayARM

Differential Revision: https://reviews.llvm.org/D93448




More information about the All-commits mailing list