mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-09 17:43:57 +00:00
Revert r357256 "[DAGCombine] Improve Lifetime node chains."
As it caused a pathological compile-time regressionin V8, see PR41352. > Improve both start and end lifetime nodes chain dependencies. > > Reviewers: courbet > > Reviewed By: courbet > > Subscribers: hiraditya, llvm-commits > > Tags: #llvm > > Differential Revision: https://reviews.llvm.org/D59795 This also reverts the follow-up r357309: > [DAGCombiner] Rewrite ImproveLifetimeNodeChain to avoid DAG loop. > > Avoid EXPENSIVE_CHECK failure. NFCI. llvm-svn: 357563
This commit is contained in:
parent
2374bff376
commit
94b867dc7c
@ -427,10 +427,6 @@ namespace {
|
||||
SDValue replaceStoreOfFPConstant(StoreSDNode *ST);
|
||||
|
||||
SDValue visitSTORE(SDNode *N);
|
||||
|
||||
SDValue ImproveLifetimeNodeChain(SDNode *N);
|
||||
|
||||
SDValue visitLIFETIME_START(SDNode *N);
|
||||
SDValue visitLIFETIME_END(SDNode *N);
|
||||
SDValue visitINSERT_VECTOR_ELT(SDNode *N);
|
||||
SDValue visitEXTRACT_VECTOR_ELT(SDNode *N);
|
||||
@ -1654,7 +1650,6 @@ SDValue DAGCombiner::visit(SDNode *N) {
|
||||
case ISD::MLOAD: return visitMLOAD(N);
|
||||
case ISD::MSCATTER: return visitMSCATTER(N);
|
||||
case ISD::MSTORE: return visitMSTORE(N);
|
||||
case ISD::LIFETIME_START: return visitLIFETIME_START(N);
|
||||
case ISD::LIFETIME_END: return visitLIFETIME_END(N);
|
||||
case ISD::FP_TO_FP16: return visitFP_TO_FP16(N);
|
||||
case ISD::FP16_TO_FP: return visitFP16_TO_FP(N);
|
||||
@ -15705,33 +15700,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
|
||||
return ReduceLoadOpStoreWidth(N);
|
||||
}
|
||||
|
||||
SDValue DAGCombiner::ImproveLifetimeNodeChain(SDNode *N) {
|
||||
auto Chain = N->getOperand(0);
|
||||
auto NewChain = FindBetterChain(N, Chain);
|
||||
if (NewChain != Chain) {
|
||||
LifetimeSDNode *LN = cast<LifetimeSDNode>(N);
|
||||
// Create New Node to prevent loop in CombineTo.
|
||||
SDValue NewN = DAG.getLifetimeNode(N->getOpcode() == ISD::LIFETIME_START,
|
||||
SDLoc(N), NewChain, LN->getFrameIndex(),
|
||||
LN->hasOffset() ? LN->getSize() : -1,
|
||||
LN->hasOffset() ? LN->getOffset() : -1);
|
||||
AddToWorklist(NewN.getNode());
|
||||
auto TF = DAG.getNode(ISD::TokenFactor, SDLoc(N), MVT::Other, Chain, NewN);
|
||||
return CombineTo(N, TF);
|
||||
}
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
SDValue DAGCombiner::visitLIFETIME_START(SDNode *N) {
|
||||
if (SDValue V = ImproveLifetimeNodeChain(N))
|
||||
return V;
|
||||
return SDValue();
|
||||
}
|
||||
|
||||
SDValue DAGCombiner::visitLIFETIME_END(SDNode *N) {
|
||||
if (SDValue V = ImproveLifetimeNodeChain(N))
|
||||
return V;
|
||||
|
||||
const auto *LifetimeEnd = cast<LifetimeSDNode>(N);
|
||||
if (!LifetimeEnd->hasOffset())
|
||||
return SDValue();
|
||||
|
@ -94,6 +94,7 @@ define dso_local void @twoallocs(i8* nocapture %a, i8* nocapture %b) local_unnam
|
||||
; AA-LABEL: twoallocs:
|
||||
; AA: # %bb.0: # %entry
|
||||
; AA-NEXT: vmovups (%rdi), %xmm0
|
||||
; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
|
||||
; AA-NEXT: vmovups %xmm0, (%rsi)
|
||||
; AA-NEXT: retq
|
||||
entry:
|
||||
@ -124,6 +125,7 @@ define dso_local void @onealloc_readback_1(i8* nocapture %a, i8* nocapture %b) l
|
||||
; AA-LABEL: onealloc_readback_1:
|
||||
; AA: # %bb.0: # %entry
|
||||
; AA-NEXT: vmovups (%rsi), %xmm0
|
||||
; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
|
||||
; AA-NEXT: vmovups %xmm0, (%rdi)
|
||||
; AA-NEXT: retq
|
||||
entry:
|
||||
@ -153,6 +155,7 @@ define dso_local void @onealloc_readback_2(i8* nocapture %a, i8* nocapture %b) l
|
||||
; AA-LABEL: onealloc_readback_2:
|
||||
; AA: # %bb.0: # %entry
|
||||
; AA-NEXT: vmovups (%rsi), %xmm0
|
||||
; AA-NEXT: vmovaps %xmm0, -{{[0-9]+}}(%rsp)
|
||||
; AA-NEXT: vmovups %xmm0, (%rdi)
|
||||
; AA-NEXT: retq
|
||||
entry:
|
||||
|
@ -80,6 +80,19 @@
|
||||
; CHECK: ScopeEndSym {
|
||||
; CHECK: Kind: S_END {{.*}}
|
||||
; CHECK: }
|
||||
; CHECK: BlockSym {
|
||||
; CHECK: Kind: S_BLOCK32 {{.*}}
|
||||
; CHECK: BlockName:
|
||||
; CHECK: }
|
||||
; CHECK: ScopeEndSym {
|
||||
; CHECK: }
|
||||
; CHECK: BlockSym {
|
||||
; CHECK: Kind: S_BLOCK32 {{.*}}
|
||||
; CHECK: BlockName:
|
||||
; CHECK: }
|
||||
; CHECK: ScopeEndSym {
|
||||
; CHECK: Kind: S_END {{.*}}
|
||||
; CHECK: }
|
||||
; CHECK: ProcEnd {
|
||||
; CHECK: }
|
||||
;
|
||||
|
Loading…
Reference in New Issue
Block a user