[LLVMdev] LIT Any/All options

Renato Golin rengolin at systemcall.org
Wed Jun 6 08:20:50 PDT 2012


Hi folks,

I was wondering how easy would it be to add an All/Any in Lit, maybe
together with a multi-scan option.

As far as I know, you have things like "CHECK", "CHECK-NOT" and
"CHECK-NEXT", but sometimes the order of the output is less relevant
(especially for debug information, on both IR and Dwarf outputs).

So, my idea are:

1. CHECK-ANY/OR:

CHECK-ANY: %symbol1 = op %s2, %s3
CHECK-OR: %symbol = other-op %s2, other option, %s4
CHECK-OR: ...

In that case, either one of the three option (limited by ANY/OR
sequence) could match. If there is a match on any of them, all others
are ignored.

2. CHECK-ALL/AND:

CHECK-ALL: %symbol1 = op %s2, %s3
CHECK-AND: %symbol = other-op %s2, other option, %s4
CHECK-AND: ...

In that case, all three options (limited by ALL/AND sequence) must
match, in any order.

3. CHECK-MULTI:

If it doesn't match the first time, store that in a list to try again.
Stop when the number of items in the list doesn't reduce in size after
another pass.

This should only walk over the output multiple times, not re-execute
the command multiple times.

I'm unsure if MULTI should be a global option (as in, all CHECKs
should be checked multiple times within the same output) or not. So,
if you have two runs:

%run foo | lit CHECK
%run bar | lit CHECK2

and you say:

CHECK-MULTI

That'll mean that all "CHECK" checks will be done multiple times, but no CHECK2.

If MULTI is not a global option, than just the "CHECK-MULTI" line will
be recorded for future attempts in case of failure.

-- 
cheers,
--renato

http://systemcall.org/



More information about the llvm-dev mailing list