This is an archive of the discontinued LLVM Phabricator instance.

[mlir][test] Require JIT support in JIT tests
ClosedPublic

Authored by ro on Aug 4 2022, 2:41 AM.

Details

Summary

A number of mlir tests FAIL on Solaris/sparcv9 with Target has no JIT support. This patch fixes that by mimicing clang/test/lit.cfg.py which implements a host-supports-jit keyword for this. The gtest-based unit tests don't support REQUIRES:, so lack of support needs to be hardcoded there.

Tested on amd64-pc-solaris2.11 (check-mlir results unchanged) and sparcv9-sun-solaris2.11 (only one unrelated failure left).

Diff Detail

Event Timeline

ro created this revision.Aug 4 2022, 2:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 4 2022, 2:41 AM
ro requested review of this revision.Aug 4 2022, 2:41 AM

The dependency on clang-repl does not seems like something we should have here.
I'd rather define this host-supports-jit by checking native and filtering the known unsupported targets.

Alternatively, what about adding the host-supports-jit feature from clang-rep to mlir-cpu-runner itself? Seems like a handful of lines from what I can see.

ro added a comment.Aug 4 2022, 4:16 AM

Alternatively, what about adding the host-supports-jit feature from clang-rep to mlir-cpu-runner itself? Seems like a handful of lines from what I can see.

Seems like the better option to me, rather than having multiple (possibly diverging) hardcoded exclude lists. I'll have a look.

ro updated this revision to Diff 449964.Aug 4 2022, 7:05 AM
  • Move --host-supports-jit to mlir::JitRunnerMain.
  • Use it via mlir-cpu-runner.

Had to do it this way because mlir::JitRunnerMain calls llvm::cl::ParseCommandLineOptions: an earlier call in mlir-cpu-runner.cpp didn't work.

ro edited the summary of this revision. (Show Details)Aug 4 2022, 7:06 AM
ro added a comment.Aug 17 2022, 3:33 AM

Ping? There's been no response since I updated the patch as requested almost two weeks ago. It would be good to get this into the 15.x branch, too. Thanks.

mehdi_amini accepted this revision.Aug 17 2022, 4:02 AM

Apologies: I wrote this inline comment and I thought I approved but didn't click "submit" at the time apparently.

mlir/lib/ExecutionEngine/JitRunner.cpp
91

Can you add a description for the flag?

This revision is now accepted and ready to land.Aug 17 2022, 4:02 AM

Also: LLVM policy is to ping patches every week to get updates, but feel free to ping me more quickly: in particular when there is a timely concern like a release branch involved.

stellaraccident accepted this revision.Aug 17 2022, 5:50 AM

Thanks and sorry for missing this. Ditto to what Mehdi said about pinging for things that have direct impacts like this.

ro marked an inline comment as done.Aug 18 2022, 2:20 AM

Apologies: I wrote this inline comment and I thought I approved but didn't click "submit" at the time apparently.

No worries: I'm on vacation right now and have been away for a week.

Also: LLVM policy is to ping patches every week to get updates, but feel free to ping me more quickly: in particular when there is a timely concern like a release branch involved.

I know, but sometimes forget. On top of that, flang/mlir are currently tested only for releases, thus they aren't as crucial as the rest of LLVM.

mlir/lib/ExecutionEngine/JitRunner.cpp
91

Sure. However, it will have no visible effect given the use of llvm::cl::Hidden, which I took from clang-repl.

ro updated this revision to Diff 453582.Aug 18 2022, 2:22 AM
ro marked an inline comment as done.

Add description for --host-supports-jit.

This revision was landed with ongoing or failed builds.Aug 18 2022, 2:26 AM
This revision was automatically updated to reflect the committed changes.