[llvm] r357121 - [DAGCombiner] Teach TokenFactor pruning to peek through lifetime nodes
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 27 13:37:08 PDT 2019
Author: niravd
Date: Wed Mar 27 13:37:08 2019
New Revision: 357121
URL: http://llvm.org/viewvc/llvm-project?rev=357121&view=rev
Log:
[DAGCombiner] Teach TokenFactor pruning to peek through lifetime nodes
Summary: Lifetime nodes were inhibiting TokenFactor simplification inhibiting chain-based optimizations.
Reviewers: courbet, jyknight
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D59897
Modified:
llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/trunk/test/CodeGen/X86/swap.ll
llvm/trunk/test/DebugInfo/COFF/inlining.ll
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp?rev=357121&r1=357120&r2=357121&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/DAGCombiner.cpp Wed Mar 27 13:37:08 2019
@@ -1837,6 +1837,8 @@ SDValue DAGCombiner::visitTokenFactor(SD
for (const SDValue &Op : CurNode->op_values())
AddToWorklist(i, Op.getNode(), CurOpNumber);
break;
+ case ISD::LIFETIME_START:
+ case ISD::LIFETIME_END:
case ISD::CopyFromReg:
case ISD::CopyToReg:
AddToWorklist(i, CurNode->getOperand(0).getNode(), CurOpNumber);
Modified: llvm/trunk/test/CodeGen/X86/swap.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/swap.ll?rev=357121&r1=357120&r2=357121&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/swap.ll (original)
+++ llvm/trunk/test/CodeGen/X86/swap.ll Wed Mar 27 13:37:08 2019
@@ -119,14 +119,11 @@ define dso_local void @onealloc_readback
; NOAA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; NOAA-NEXT: vmovups (%rsi), %xmm0
; NOAA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
-; NOAA-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
; NOAA-NEXT: vmovups %xmm0, (%rdi)
; NOAA-NEXT: retq
;
; AA-LABEL: onealloc_readback_1:
; AA: # %bb.0: # %entry
-; AA-NEXT: vmovups (%rdi), %xmm0
-; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; AA-NEXT: vmovups (%rsi), %xmm0
; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; AA-NEXT: vmovups %xmm0, (%rdi)
@@ -152,14 +149,11 @@ define dso_local void @onealloc_readback
; NOAA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; NOAA-NEXT: vmovups (%rsi), %xmm0
; NOAA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
-; NOAA-NEXT: vmovaps -{{[0-9]+}}(%rsp), %xmm0
; NOAA-NEXT: vmovups %xmm0, (%rdi)
; NOAA-NEXT: retq
;
; AA-LABEL: onealloc_readback_2:
; AA: # %bb.0: # %entry
-; AA-NEXT: vmovups (%rdi), %xmm0
-; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; AA-NEXT: vmovups (%rsi), %xmm0
; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
; AA-NEXT: vmovups %xmm0, (%rdi)
Modified: llvm/trunk/test/DebugInfo/COFF/inlining.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/COFF/inlining.ll?rev=357121&r1=357120&r2=357121&view=diff
==============================================================================
--- llvm/trunk/test/DebugInfo/COFF/inlining.ll (original)
+++ llvm/trunk/test/DebugInfo/COFF/inlining.ll Wed Mar 27 13:37:08 2019
@@ -29,7 +29,6 @@
; ASM: .cv_loc 1 1 9 5 # t.cpp:9:5
; ASM: addl $4, "?x@@3HC"
; ASM: .cv_inline_site_id 2 within 1 inlined_at 1 10 3
-; ASM: .cv_loc 2 1 3 7 # t.cpp:3:7
; ASM: .cv_loc 2 1 4 5 # t.cpp:4:5
; ASM: addl {{.*}}, "?x@@3HC"
; ASM: .cv_loc 2 1 5 5 # t.cpp:5:5
@@ -172,7 +171,7 @@
; OBJ: PtrParent: 0x0
; OBJ: PtrEnd: 0x0
; OBJ: PtrNext: 0x0
-; OBJ: CodeSize: 0x3C
+; OBJ: CodeSize: 0x35
; OBJ: DbgStart: 0x0
; OBJ: DbgEnd: 0x0
; OBJ: FunctionType: baz (0x1004)
@@ -189,9 +188,9 @@
; OBJ: Inlinee: bar (0x1002)
; OBJ: BinaryAnnotations [
; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x8, LineOffset: 1}
-; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x7, LineOffset: 1}
+; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x9, LineOffset: 1}
; OBJ-NEXT: ChangeLineOffset: 1
-; OBJ-NEXT: ChangeCodeOffset: 0x1D
+; OBJ-NEXT: ChangeCodeOffset: 0x14
; OBJ-NEXT: ChangeCodeLength: 0x7
; OBJ: ]
; OBJ: }
@@ -200,8 +199,8 @@
; OBJ: PtrEnd: 0x0
; OBJ: Inlinee: foo (0x1003)
; OBJ: BinaryAnnotations [
-; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0xF, LineOffset: 1}
-; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x9, LineOffset: 1}
+; OBJ-NEXT: ChangeLineOffset: 2
+; OBJ-NEXT: ChangeCodeOffset: 0x11
; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x6, LineOffset: 1}
; OBJ-NEXT: ChangeCodeOffsetAndLineOffset: {CodeOffset: 0x7, LineOffset: 1}
; OBJ-NEXT: ChangeCodeLength: 0x7
More information about the llvm-commits
mailing list