This is an archive of the discontinued LLVM Phabricator instance.

[InstCombine][NFC] Add tests for preserving metadata
ClosedPublic

Authored by chfast on Jul 18 2023, 6:22 AM.

Diff Detail

Event Timeline

chfast created this revision.Jul 18 2023, 6:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 6:22 AM
Herald added a subscriber: StephenFan. · View Herald Transcript
chfast requested review of this revision.Jul 18 2023, 6:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 18 2023, 6:22 AM
chfast added inline comments.Jul 18 2023, 6:31 AM
llvm/test/Transforms/InstCombine/select_meta.ll
351

Here !unpredictable can be preserved because if !a is unpredictable the a is also. But !prof must be swapped.

chfast updated this revision to Diff 541925.Jul 19 2023, 2:57 AM

Focus on select+binop, add more test cases.

chfast added inline comments.Jul 19 2023, 2:58 AM
llvm/test/Transforms/InstCombine/select_meta.ll
351

This test case was removed.

chfast retitled this revision from [InstCombine][NFC] Add tests for preserving !unreachable to [InstCombine][NFC] Add tests for preserving metadata.Jul 19 2023, 3:01 AM
nikic accepted this revision.Jul 19 2023, 3:27 AM

LGTM

llvm/test/Transforms/InstCombine/select_meta.ll
353–400

It would be better to run update_test_checks.py with --check-globals option so these get auto-generated.

This revision is now accepted and ready to land.Jul 19 2023, 3:27 AM
chfast updated this revision to Diff 541940.Jul 19 2023, 3:43 AM

Update tests with --check-globals

chfast added inline comments.Jul 19 2023, 4:11 AM
llvm/test/Transforms/InstCombine/select_meta.ll
353–400

I updated tests with --check-globals and removed "enhancement to include metadata checking." Does it look good?

nikic added inline comments.Jul 19 2023, 4:48 AM
llvm/test/Transforms/InstCombine/select_meta.ll
353–400

Yes, looks good!

This revision was automatically updated to reflect the committed changes.