[PATCH] D28621: X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 11:44:56 PST 2017


pcc created this revision.
pcc added reviewers: RKSimon, craig.topper.
pcc added a subscriber: llvm-commits.

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.


https://reviews.llvm.org/D28621

Files:
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/test/CodeGen/X86/compare-global.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28621.84154.patch
Type: text/x-patch
Size: 4166 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170112/d5d32621/attachment.bin>


More information about the llvm-commits mailing list