From 882ca6d48483938bd1f3b42c279f9aa8364149a7 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 24 Apr 2019 18:02:07 +0000 Subject: [X86] Remove dead nodes left after ReplaceAllUsesWith calls during address matching ReplaceAllUsesWith doesn't remove the node that was replaced. So its left around in the graph messing up use counts on other nodes. One thing to note, is that this isn't valid if the node being deleted is the root node of an LEA match that gets rejected. In that case the node needs to stay alive because the isel table walking code would still have a reference to it that its going to try to match next. I don't think that's the case here though because the nodes being deleted here should be "and", "srl", and "zero_extend" none of which can be the root node of an LEA match. Differential Revision: https://reviews.llvm.org/D61048 llvm-svn: 359121 --- llvm/test/CodeGen/X86/fold-and-shift.ll | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'llvm/test/CodeGen/X86/fold-and-shift.ll') diff --git a/llvm/test/CodeGen/X86/fold-and-shift.ll b/llvm/test/CodeGen/X86/fold-and-shift.ll index 39c91d90017..e14e337ea89 100644 --- a/llvm/test/CodeGen/X86/fold-and-shift.ll +++ b/llvm/test/CodeGen/X86/fold-and-shift.ll @@ -5,8 +5,8 @@ define i32 @t1(i8* %X, i32 %i) { ; CHECK-LABEL: t1: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax -; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx -; CHECK-NEXT: movzbl %cl, %ecx +; CHECK-NEXT: movl $255, %ecx +; CHECK-NEXT: andl {{[0-9]+}}(%esp), %ecx ; CHECK-NEXT: movl (%eax,%ecx,4), %eax ; CHECK-NEXT: retl @@ -23,8 +23,8 @@ define i32 @t2(i16* %X, i32 %i) { ; CHECK-LABEL: t2: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax -; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx -; CHECK-NEXT: movzwl %cx, %ecx +; CHECK-NEXT: movl $65535, %ecx # imm = 0xFFFF +; CHECK-NEXT: andl {{[0-9]+}}(%esp), %ecx ; CHECK-NEXT: movl (%eax,%ecx,4), %eax ; CHECK-NEXT: retl @@ -111,8 +111,8 @@ define i8 @t6(i8* %X, i32 %i) { ; CHECK-LABEL: t6: ; CHECK: # %bb.0: # %entry ; CHECK-NEXT: movl {{[0-9]+}}(%esp), %eax -; CHECK-NEXT: movl {{[0-9]+}}(%esp), %ecx -; CHECK-NEXT: andl $-255, %ecx +; CHECK-NEXT: movl $-255, %ecx +; CHECK-NEXT: andl {{[0-9]+}}(%esp), %ecx ; CHECK-NEXT: movb (%eax,%ecx,4), %al ; CHECK-NEXT: retl -- cgit v1.2.3