diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-02-09 21:58:24 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-02-09 21:58:24 +0000 |
| commit | d7dd65ad7c0eb8ba0345154af23b10f2c4be4e8e (patch) | |
| tree | f0aa6d3722248216e996da6837056750afa27371 /llvm/test/CodeGen | |
| parent | 0beb3323c5f18b9ed867ebd4eeb207dcd8f95e77 (diff) | |
| download | bcm5719-llvm-d7dd65ad7c0eb8ba0345154af23b10f2c4be4e8e.tar.gz bcm5719-llvm-d7dd65ad7c0eb8ba0345154af23b10f2c4be4e8e.zip | |
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
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/compare-global.ll | 2 |
1 files changed, 1 insertions, 1 deletions
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 |

