From d7dd65ad7c0eb8ba0345154af23b10f2c4be4e8e Mon Sep 17 00:00:00 2001 From: Peter Collingbourne Date: Thu, 9 Feb 2017 21:58:24 +0000 Subject: 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 llvm-svn: 294634 --- llvm/test/CodeGen/X86/compare-global.ll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/test') diff --git a/llvm/test/CodeGen/X86/compare-global.ll b/llvm/test/CodeGen/X86/compare-global.ll index 8e3d3a93a56..747595c1a89 100644 --- a/llvm/test/CodeGen/X86/compare-global.ll +++ b/llvm/test/CodeGen/X86/compare-global.ll @@ -7,7 +7,7 @@ target triple = "i686-pc-windows-msvc18.0.0" define void @f(i8* %c) { entry: - ; CHECK: subl $_foo, %eax + ; CHECK: cmpl $_foo, 4(%esp) %cmp = icmp eq i8* %c, @foo br i1 %cmp, label %if.then, label %if.end -- cgit v1.2.3