章明 via llvm-dev
2017-Nov-16 09:20 UTC
[llvm-dev] Looking for tests for class ARMConstantIslands
Hello, everyone! I have made a few modifications to the ARM constant island placement and branch shortening pass (i.e., class ARMConstantIslands) to suit the pass to my control flow checking algorithm. For now, I would like to test the modified pass alone. However it doesn't seem to be easy to find a program that exercises the pass. I think I need to find some existing tests, and probably will have to modify some tests to suit my needs. I am new to the LLVM test infrastructure. I am aware that a LLVM release comes together with a lot of regression tests in the test directory. But it seems to be impossible to tell which files are relevant to the pass by looking at the file names alone. In test/CodeGen/ARM, I found a few files baring a name containing the word "island" and "jump" (as in "jump table"): constant-island-crash.ll constant-islands.ll jump-table-islands.ll jump-table-islands-split.ll arm-position-independence-jump-table.ll jumptable-label.ll jump-table-tbh.ll In these files, I found little documentation. Are these all relevant to the pass? Are there other relevant tests? How do you test the pass? Is there a way to find all relevant regression tests easily? Thank you! Ming Zhang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171116/aac506df/attachment.html>
Tim Northover via llvm-dev
2017-Nov-16 11:04 UTC
[llvm-dev] Looking for tests for class ARMConstantIslands
Hi Ming, On 16 November 2017 at 09:20, 章明 via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Are these all relevant to the pass? Are there other relevant tests?Your best bet is probably what's called "MIR tests", which are written directly in the lower-level MachineInstr based representation and run only the relevant pass. This gives earlier passes less opportunity to mess with your code and break the really tight spacing requirements needed to trigger ARMConstantIslands. So take a look at constant-islands-cfg.mir and v6-jumptable-clobber.mir, especially the first which looks like it was written after the MIR representation improved (it has many fewer extra useless details). Cheers. Tim.