Page MenuHomePhabricator

X86InstrInfo: Look across basic blocks in optimizeCompareInstr
AcceptedPublic

Authored by MatzeB on Thu, Sep 30, 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.Thu, Sep 30, 10:57 AM
MatzeB requested review of this revision.Thu, Sep 30, 10:57 AM
Herald added a project: Restricted Project. · View Herald TranscriptThu, Sep 30, 10:57 AM
MatzeB retitled this revision from X86InstrInfo: Extend optimizeCompareInstr to look across basic blocks. to X86InstrInfo: Look accross basic blocks in optimizeCompareInstr.Thu, Sep 30, 11:25 AM
craig.topper retitled this revision from X86InstrInfo: Look accross basic blocks in optimizeCompareInstr to X86InstrInfo: Look across basic blocks in optimizeCompareInstr.Thu, Sep 30, 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.Fri, Oct 1, 2:54 AM
llvm/lib/Target/X86/X86InstrInfo.cpp
4475–4478

Do we have a test for it?

foad added a subscriber: foad.Fri, Oct 1, 6:21 AM
MatzeB updated this revision to Diff 376574.Fri, Oct 1, 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.

4475–4478

Added one.

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

ping

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

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

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

rebase; update jump_sign.ll test

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

LGTM - cheers