Page MenuHomePhabricator

X86InstrInfo: Look across basic blocks in optimizeCompareInstr
ClosedPublic

Authored by MatzeB on Sep 30 2021, 10:57 AM.

Details

Summary

This extends optimizeCompareInstr to continue the backwards search when it reached the beginning of a basic block. If there is a single predecessor block then we can just continue the search in that block and mark the EFLAGS register as live-in.

Diff Detail

Event Timeline

MatzeB created this revision.Sep 30 2021, 10:57 AM
MatzeB requested review of this revision.Sep 30 2021, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2021, 10:57 AM
MatzeB retitled this revision from X86InstrInfo: Extend optimizeCompareInstr to look across basic blocks. to X86InstrInfo: Look accross basic blocks in optimizeCompareInstr.Sep 30 2021, 11:25 AM
craig.topper retitled this revision from X86InstrInfo: Look accross basic blocks in optimizeCompareInstr to X86InstrInfo: Look across basic blocks in optimizeCompareInstr.Sep 30 2021, 8:33 PM
craig.topper added inline comments.
llvm/lib/Target/X86/X86InstrInfo.cpp
4291

Should this be in the first patch where this comment was created?

pengfei added inline comments.Oct 1 2021, 2:54 AM
llvm/lib/Target/X86/X86InstrInfo.cpp
4476–4479

Do we have a test for it?

foad added a subscriber: foad.Oct 1 2021, 6:21 AM
MatzeB updated this revision to Diff 376574.Oct 1 2021, 10:56 AM
MatzeB marked 2 inline comments as done.
MatzeB added inline comments.
llvm/lib/Target/X86/X86InstrInfo.cpp
4291

just dropped the change instead.

4476–4479

Added one.

MatzeB marked 2 inline comments as done.Oct 13 2021, 5:07 PM

ping

pengfei accepted this revision.Oct 13 2021, 8:51 PM

LGTM. Please wait for 1 or 2 days for other reviewers' comments.

This revision is now accepted and ready to land.Oct 13 2021, 8:51 PM
MatzeB updated this revision to Diff 379774.Oct 14 2021, 10:58 AM

rebase; update jump_sign.ll test

RKSimon accepted this revision.Oct 14 2021, 12:28 PM

LGTM - cheers