[PATCH] D30521: Introduce llc/ExecuteTestCommands pass

Matthias Braun via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 3 11:30:40 PST 2017


MatzeB added a comment.

In https://reviews.llvm.org/D30521#691568, @kparzysz wrote:

> This is really nice, but I have a few questions:
>
> - Will the testCommands be limited to functions that can take immediate values (i.e no functions taking pointers to MachineInstr or MachineBasicBlock)?


In general I think it would be wrong to put too much effort into this language, if this becomes more than invocing a few functions then we should probably go back to writing unit tests.
That said there is already getMBB(number) and getMI(number) implemented in the current pass which allows you to pass an instr or block as the "this" parameter to the next function.

> - Are users expected to be adding more functions to ExecuteTestCommands.cpp as they create new tests?

Yes.



================
Comment at: test/CodeGen/AMDGPU/handlemove.mir:54
+    S_NOP 0, implicit %0
+testCommands: getMBB(0).handleMove(2,1)"
+---
----------------
kparzysz wrote:
> Is the " at the end a typo?
Yes (a previous version was using a special instruction to carry the commands in a string, I forgot to remove this when I switched to the `testCommands:` version).


Repository:
  rL LLVM

https://reviews.llvm.org/D30521





More information about the llvm-commits mailing list