diff options
author | Adam Nemet <anemet@apple.com> | 2014-05-20 21:47:07 +0000 |
---|---|---|
committer | Adam Nemet <anemet@apple.com> | 2014-05-20 21:47:07 +0000 |
commit | 2ba6492b7bfd3211e37492219a50b90215f0037c (patch) | |
tree | 1fc0b66859c43e23d00670573463a2691c43ddbe /llvm/lib | |
parent | 9c785294fb4777283e2a5d291a07b5f0e349a415 (diff) | |
download | bcm5719-llvm-2ba6492b7bfd3211e37492219a50b90215f0037c.tar.gz bcm5719-llvm-2ba6492b7bfd3211e37492219a50b90215f0037c.zip |
[ARM64] PR19792: Fix cycle in DAG after performPostLD1Combine
Povray and dealII currently assert with "Overran sorted position" in
AssignTopologicalOrder. The problem is that performPostLD1Combine can
introduce cycles.
Consider:
(insert_vector_elt (INSERT_SUBREG undef,
(load (add %vreg0, Constant<8>), undef), <= A
TargetConstant<2>),
(load %vreg0, undef), <= B
Constant<1>)
This is turned into a LD1LANEpost node. However the address in A is not a
valid user of the post-incremented address of B in LD1LANEpost.
llvm-svn: 209242
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM64/ARM64ISelLowering.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp index 538360cf39d..385373116de 100644 --- a/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp +++ b/llvm/lib/Target/ARM64/ARM64ISelLowering.cpp @@ -7298,6 +7298,7 @@ static SDValue performPostLD1Combine(SDNode *N, } SDValue Addr = LD->getOperand(1); + SDValue Vector = N->getOperand(0); // Search for a use of the address operand that is an increment. for (SDNode::use_iterator UI = Addr.getNode()->use_begin(), UE = Addr.getNode()->use_end(); UI != UE; ++UI) { @@ -7310,6 +7311,10 @@ static SDValue performPostLD1Combine(SDNode *N, // would create a cycle. if (User->isPredecessorOf(LD) || LD->isPredecessorOf(User)) continue; + // Also check that add is not used in the vector operand. This would also + // create a cycle. + if (User->isPredecessorOf(Vector.getNode())) + continue; // If the increment is a constant, it must match the memory ref size. SDValue Inc = User->getOperand(User->getOperand(0) == Addr ? 1 : 0); @@ -7324,7 +7329,7 @@ static SDValue performPostLD1Combine(SDNode *N, SmallVector<SDValue, 8> Ops; Ops.push_back(LD->getOperand(0)); // Chain if (IsLaneOp) { - Ops.push_back(N->getOperand(0)); // The vector to be inserted + Ops.push_back(Vector); // The vector to be inserted Ops.push_back(N->getOperand(2)); // The lane to be inserted in the vector } Ops.push_back(Addr); |