rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
95.11k stars 12.27k forks source link

MC/DC LLVM 19 intrinsics changes #126672

Open krasimirgg opened 4 weeks ago

krasimirgg commented 4 weeks ago

In LLVM 19 some details about MC/DC changed, removing and updating some intrinsics:

I tried naively to remove the reference to the removed intrinsic https://github.com/rust-lang/rust/pull/126582, but that's incomplete. Will need more work to adapt to this it seems:

krasimirgg commented 4 weeks ago

@ZhuUx

ZhuUx commented 4 weeks ago

As far as I know, works on mcdc need to be done for adapting to llvm 19 are:

  1. Eliminate the removed intrinsic function as you have done.
  2. Change the way to update condition bits as the new mechanism.
  3. Let ConditionId start from 0 rather than 1.

These changes are definite since they have been merged into llvm now, while still there are other changes may be introduced.

Given that 2 actually changes several arguments we passed to llvm and causes severe incompatibility, I'd wish to stop supporting mcdc on llvm-18 once if we switched to 19.

Edit. Other works have been done, but 2 introduces more break changes than I thought I'd need more time to adapt to it.

Zalathar commented 4 weeks ago

In the short-term, we can just adjust the tests to not run on LLVM 19.

After the in-tree LLVM has been updated to LLVM 19, then we can remove support for MC/DC under LLVM 18, and add support for MC/DC under LLVM 19.

(Unless someone wants to do the extra work of supporting MC/DC with LLVM 19 before the official upgrade.)

veera-sivarajan commented 3 weeks ago

@rustbot label -needs-triage +A-LLVM +T-compiler +C-enhancement

workingjubilee commented 3 weeks ago

After the in-tree LLVM has been updated to LLVM 19, then we can remove support for MC/DC under LLVM 18, and add support for MC/DC under LLVM 19.

This sounds acceptable if we defer stabilizing MC/DC until our minimum LLVM is 19+

ZhuUx commented 3 weeks ago

Filed #126733 to fix it and prepare for llvm 19.