This is an archive of the discontinued LLVM Phabricator instance.

[X86][Codegen] Remove dead code for ADCX/ADOX
ClosedPublic

Authored by skan on Aug 11 2023, 7:30 AM.

Details

Summary

There is no pattern for ADCX/ADOX and they are never selected during
ISEL. So we remove the cases in some MIR optimizations in this patch.

Diff Detail

Event Timeline

skan created this revision.Aug 11 2023, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 7:30 AM
skan requested review of this revision.Aug 11 2023, 7:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2023, 7:30 AM
craig.topper added inline comments.Aug 11 2023, 8:54 AM
llvm/lib/Target/X86/X86InstrArithmetic.td
1377 ↗(On Diff #549389)

Why delete the predcate?

skan added inline comments.Aug 12 2023, 6:11 AM
llvm/lib/Target/X86/X86InstrArithmetic.td
1377 ↗(On Diff #549389)

Except assembler predicate like In64BitMode, a predicate only has effect when the pattern is not empty.
There is no pattern for ADCX/ADOX, so I remove the pattern.

craig.topper added inline comments.Aug 12 2023, 10:22 AM
llvm/lib/Target/X86/X86InstrArithmetic.td
1377 ↗(On Diff #549389)

I thought it could be used by https://reviews.llvm.org/D148516 that can use it to filter illegal instructions from llvm-exegesis testing. But I guess that uses the AssemblerPredicate so only filters In64BitMode. That seems kind of broken for its intended usage.

skan updated this revision to Diff 549772.Aug 13 2023, 6:59 PM

Address review comments: keep the predicate

skan marked 2 inline comments as done.Aug 13 2023, 6:59 PM
skan added inline comments.
llvm/lib/Target/X86/X86InstrArithmetic.td
1377 ↗(On Diff #549389)

I see. It seems that you prefer to keep the predicate. Let me revert the change in this file.

This revision is now accepted and ready to land.Aug 13 2023, 7:00 PM
skan edited the summary of this revision. (Show Details)Aug 13 2023, 7:00 PM
This revision was landed with ongoing or failed builds.Aug 13 2023, 7:23 PM
This revision was automatically updated to reflect the committed changes.
skan marked an inline comment as done.
llvm/test/CodeGen/X86/flags-copy-lowering.mir