This is an archive of the discontinued LLVM Phabricator instance.

X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.
ClosedPublic

Authored by pcc on Jan 12 2017, 11:44 AM.

Details

Summary

This requires that we communicate to X86InstrInfo::optimizeCompareInstr
that the second operand is neither a register nor an immediate. The way we
do that is by setting CmpMask to zero.

Note that there were already instructions where the second operand was not a
register nor an immediate, namely X86::SUB*rm, so also set CmpMask to zero
for those instructions. This seems like a latent bug, but I was unable to
trigger it.

Diff Detail

Repository
rL LLVM

Event Timeline

pcc updated this revision to Diff 84154.Jan 12 2017, 11:44 AM
pcc retitled this revision from to X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols..
pcc updated this object.
pcc added reviewers: RKSimon, craig.topper.
pcc added a subscriber: llvm-commits.
RKSimon edited edge metadata.
RKSimon added a subscriber: andreadb.

Seems OK to me - @craig.topper @andreadb any comments?

andreadb accepted this revision.Feb 9 2017, 12:22 PM

Looks good to me too.

This revision is now accepted and ready to land.Feb 9 2017, 12:22 PM
This revision was automatically updated to reflect the committed changes.