Skip to content

Capture variables from successful combination of sub-matches #65

@Declan-ARM

Description

@Declan-ARM

Hi there (cross-post from re2),

Hopefully not a silly question, but is there a way to capture the variables of all possible matches and perform checks with them?

For example, if I use the following made-up SPIR-V:

    %end = OpVariable %_ptr_Function_int Function
     %15 = OpLoad %int %n
     %16 = OpLoad %int %n
           OpStore %end %16

...the following checks will return false...

const std::string check = R"(
    CHECK:    [[END:%\w+]] = OpVariable
    CHECK: [[LOADED:%\w+]] = OpLoad %int %n
    CHECK:                   OpStore [[END]] [[LOADED]]
)";

...despite OpStore %end %16 being a possibility.

Is there a better syntactical way to capture all possible versions of what LOADED might be and return success if a match is found with one of these versions (instead of stopping after the first match)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions