]> granicus.if.org Git - llvm/commit
X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.
authorPeter Collingbourne <peter@pcc.me.uk>
Thu, 9 Feb 2017 21:58:24 +0000 (21:58 +0000)
committerPeter Collingbourne <peter@pcc.me.uk>
Thu, 9 Feb 2017 21:58:24 +0000 (21:58 +0000)
commitce00de82c2b4d49d63b475dffe910bc71bcf5aa3
tree674be280dd607539f2de5ffa4e3bf906c487cbe4
parentbf8cee85a50cf521d0dd50f32716c4044f28810a
X86: Teach X86InstrInfo::analyzeCompare to recognize compares of symbols.

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.

Differential Revision: https://reviews.llvm.org/D28621

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@294634 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86InstrInfo.cpp
test/CodeGen/X86/compare-global.ll