Skip to content

[CIR] Upstream missing tests from the ClangIR incubator #156747

@andykaylor

Description

@andykaylor

As we have been upstreaming code from the ClangIR incubator project, we have been creating highly targeted tests for each PR as it is reviewed. Often these tests are based on existing tests in the incubator, but in most cases at least part of the test must be omitted because it exercises a feature that is now yet supported upstream. There may also be other incubator tests which cover the new functionality which are not identified during the upstreaming process.

Over time, this is leading to a gap in depth of coverage between the incubator and the upstream implementation. It would be very helpful if someone could periodically assess the state of the incubator tests and upstream those tests which can be successfully executed with the upstream code. This will involve updating the checks in the tests to follow the upstream practices, such as testing codegen lowering to LLVM IR and adding the non-CIR LLVM IR codegen path as a point of reference. It may also be necessary to update the existing checks to account for minor differences in generated CIR.

This will be a large, ongoing task, but I believe it is suitable to someone who is new to the project. Here's how I imagine it working.

  1. Clone the incubator repository, and verify that you can build and test it successfully (directions can be found here)
  2. Clone the main LLVM repository, and verify that you can build and test with ClangIR enabled
  3. Create a new test subdirectory, clang/test/CIR-Incubator and copy the contents of clang/test/CIR from the incubator to that directory.
  4. Update the CMakeLists.txt and various lit configuration files in the new directory to create a new build target, clang-check-cir-incubator
  5. Run the tests with the new target
  6. Look for tests that are passing which are missing or partially missing in the upstream clang/test/CIR directory
  7. Creates PRs to add these tests, updating them to upstream project standards

My description of step 4 above should be read while imagining a good bit of hand-waving. Figuring out the details of that step will be the most difficult part of this task.

I have marked this as a "good first issue" but interested contributors should be aware that this may be challenging for those who are new to the LLVM project. I believe it is a good first issue because it provides a way to gain experience with LLVM's build and test system, while also performing useful work, without requiring specific prior understanding of any part of the LLVM code base.

I (Andy Kaylor, akaylor@nvidia.com) will be happy to provide guidance to anyone willing to put in serious effort for this task.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ClangIRAnything related to the ClangIR projectgood first issuehttps://github.com/llvm/llvm-project/contribute

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions