Page MenuHomePhabricator

[X86] Update MachineLoopInfo in CMOV conversion.
ClosedPublic

Authored by tianqing on Jun 21 2021, 1:46 AM.

Details

Summary

If a CMOV is in a loop and is converted to branches, CMOV conversion wouldn't
add newly created basic blocks to loop info. Since the candidates is collected
based on loops, instructions in these basic blocks will be ignored.

Diff Detail

Event Timeline

tianqing created this revision.Jun 21 2021, 1:46 AM
tianqing requested review of this revision.Jun 21 2021, 1:46 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 21 2021, 1:46 AM
xbolva00 added inline comments.
llvm/test/CodeGen/X86/x86-cmov-converter.ll
494

Full checks? Use script to generate checks

pengfei added inline comments.Jun 21 2021, 5:50 AM
llvm/lib/Target/X86/X86CmovConversion.cpp
854

Is it possible the MBB is in more than one loop, e.g. nested?

llvm/test/CodeGen/X86/x86-cmov-converter.ll
494

Maybe you can commit the test first, then show the diff in this patch.

tianqing added inline comments.Jun 21 2021, 11:47 PM
llvm/lib/Target/X86/X86CmovConversion.cpp
854

addBasicBlockToLoop() already handles nested loop.

llvm/test/CodeGen/X86/x86-cmov-converter.ll
494

See D104692.

pengfei accepted this revision.Tue, Jun 29, 1:41 AM

LGTM.

This revision is now accepted and ready to land.Tue, Jun 29, 1:41 AM
tianqing updated this revision to Diff 355759.Wed, Jun 30, 8:23 PM

Update test.

Matt added a subscriber: Matt.Thu, Jul 1, 10:42 AM
This revision was automatically updated to reflect the committed changes.