[llvm] [AMDGPU][RFC] Combine asm and disasm tests. (PR #90214)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Fri May 17 14:25:15 PDT 2024


MaskRay wrote:

> Not until it's disassembled, I'm afraid, which is another RUN line, which is invovenient. And so is having two check lines where one would do, as Matt pointed out. Having two separate check lines also means they may match what is not a complete instruction, e.g., flat_load_d16_b16 v5, v[1:2] where the actual instruction may be flat_load_d16_b16 v5, v[1:2] offset:0.
>
> These details apart, I also must admit I don't quite follow this view that testing is not something of sufficient importance to be properly reflected in our code infrastructure and that it should instead seek its ways around, such as by using llvm-objdump. llvm-mc is, by design, a tool for internal use, testing and debugging, our interface to the MC layer, and I would expect it to cover whatever use cases we developers have for it. Same for specifically the MCAsmStreamer's logic emitting instruction codes, which by the way includes verbalisation of relocations/fix-ups that I'm not sure how we could test using llvm-objdump.

Not sure I am following. It seems that `-filetype=hex` output is piped to `llvm-mc -disassemble`.

```
llvm-mc -filetype=hex a.s | llvm-mc -disassemble
```

How is this more convenient than `llvm-mc -filetype=obj a.s | llvm-objdump -d -`?

Can you analyze a mini example including the assembly source and llvm-mc/llvm-objdump command lines for clearer evaluation?


https://github.com/llvm/llvm-project/pull/90214


More information about the llvm-commits mailing list