summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@intel.com>2018-10-19 19:24:42 +0000
committerCraig Topper <craig.topper@intel.com>2018-10-19 19:24:42 +0000
commit5c81c6838589fb2ad73dcfb53398135b5fa56696 (patch)
tree4297a0b27104485441db7969eafa06e0e15141ec /llvm/lib/Target/X86
parent6214c11cb7ddb7813ecc2c37923ed95d35c53cef (diff)
downloadbcm5719-llvm-5c81c6838589fb2ad73dcfb53398135b5fa56696.tar.gz
bcm5719-llvm-5c81c6838589fb2ad73dcfb53398135b5fa56696.zip
[X86] In PostprocessISelDAG, start from allnodes_end, not the root.
There is no guarantee the root is at the end if isel created any nodes without morphing them. This includes the nodes created by manual isel from C++ code in X86ISelDAGToDAG. This is similar to r333415 from PowerPC which is where I originally stole the peephole loop from. I don't have a test case, but without this a future patch doesn't work which is how I found it. llvm-svn: 344808
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86ISelDAGToDAG.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
index d6bcdcdf149..efd6349871f 100644
--- a/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
+++ b/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
@@ -849,8 +849,7 @@ void X86DAGToDAGISel::PostprocessISelDAG() {
// Attempt to remove vectors moves that were inserted to zero upper bits.
- SelectionDAG::allnodes_iterator Position(CurDAG->getRoot().getNode());
- ++Position;
+ SelectionDAG::allnodes_iterator Position = CurDAG->allnodes_end();
while (Position != CurDAG->allnodes_begin()) {
SDNode *N = &*--Position;
OpenPOWER on IntegriCloud