Skip to content

Commit cfc0513

Browse files
author
Evan Cheng
committed
Do not use register as base ptr of pre- and post- inc/dec load / store nodes.
llvm-svn: 71098
1 parent 0626df4 commit cfc0513

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4536,7 +4536,7 @@ bool DAGCombiner::CombineToPreIndexedLoadStore(SDNode *N) {
45364536

45374537
// Check #1. Preinc'ing a frame index would require copying the stack pointer
45384538
// (plus the implicit offset) to a register to preinc anyway.
4539-
if (isa<FrameIndexSDNode>(BasePtr))
4539+
if (isa<FrameIndexSDNode>(BasePtr) || isa<RegisterSDNode>(BasePtr))
45404540
return false;
45414541

45424542
// Check #2.
@@ -4663,6 +4663,9 @@ bool DAGCombiner::CombineToPostIndexedLoadStore(SDNode *N) {
46634663
// nor a successor of N. Otherwise, if Op is folded that would
46644664
// create a cycle.
46654665

4666+
if (isa<FrameIndexSDNode>(BasePtr) || isa<RegisterSDNode>(BasePtr))
4667+
continue;
4668+
46664669
// Check for #1.
46674670
bool TryNext = false;
46684671
for (SDNode::use_iterator II = BasePtr.getNode()->use_begin(),
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
; RUN: llvm-as < %s | llc -mtriple=arm-linuxeabi-unknown-gnu -mattr=+v6
2+
; PR4166
3+
4+
%"byte[]" = type { i32, i8* }
5+
%tango.time.Time.Time = type { i64 }
6+
7+
define fastcc void @t() {
8+
entry:
9+
%tmp28 = call fastcc i1 null(i32* null, %"byte[]" undef, %"byte[]" undef, %tango.time.Time.Time* byval null) ; <i1> [#uses=0]
10+
ret void
11+
}

0 commit comments

Comments
 (0)