diff options
author | Craig Topper <craig.topper@intel.com> | 2019-04-24 18:02:07 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@intel.com> | 2019-04-24 18:02:07 +0000 |
commit | 882ca6d48483938bd1f3b42c279f9aa8364149a7 (patch) | |
tree | b44a21e7a28a2e10751610393824f1af161743e8 /llvm/test/CodeGen/X86/fold-and-shift.ll | |
parent | 25c6a5073dfc9573bf14dcc0ed1d0f1950175eba (diff) | |
download | bcm5719-llvm-882ca6d48483938bd1f3b42c279f9aa8364149a7.tar.gz bcm5719-llvm-882ca6d48483938bd1f3b42c279f9aa8364149a7.zip |
[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
Diffstat (limited to 'llvm/test/CodeGen/X86/fold-and-shift.ll')
-rw-r--r-- | llvm/test/CodeGen/X86/fold-and-shift.ll | 12 |
1 files changed, 6 insertions, 6 deletions
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 |