Skip to content

Commit 938ee7a

Browse files
committed
[AVR] Temp fix in getPostIndexedAddressParts()
1 parent 03692aa commit 938ee7a

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

llvm/lib/Target/AVR/AVRISelLowering.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,12 @@ bool AVRTargetLowering::getPostIndexedAddressParts(SDNode *N, SDNode *Op,
11141114
if (AVR::isProgramMemoryAccess(LD))
11151115
return false;
11161116

1117+
// FIXME: We temporarily apply a test which prevents generating incorrect code
1118+
// (see https://github.com/llvm/llvm-project/issues/143247 )
1119+
// until we determined and fixed the root cause.
1120+
if (Op->getOperand(0)->hasOneUse())
1121+
return false;
1122+
11171123
Base = Op->getOperand(0);
11181124
Offset = DAG.getConstant(RHSC, DL, MVT::i8);
11191125
AM = ISD::POST_INC;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
; RUN: llc < %s -O=2 -mtriple=avr-none --mcpu=avr128db28 -verify-machineinstrs | FileCheck %s
2+
3+
declare dso_local void @nil(i16 noundef) local_unnamed_addr addrspace(1) #1
4+
!3 = !{!4, !4, i64 0}
5+
!4 = !{!"omnipotent char", !5, i64 0}
6+
!5 = !{!"Simple C/C++ TBAA"}
7+
8+
define void @complex_sbi() {
9+
; CHECK: sbi 1, 7
10+
entry:
11+
br label %while.cond
12+
while.cond: ; preds = %while.cond, %entry
13+
%s.0 = phi i16 [ 0, %entry ], [ %inc, %while.cond ]
14+
%inc = add nuw nsw i16 %s.0, 1
15+
%0 = load volatile i8, ptr inttoptr (i16 1 to ptr), align 1, !tbaa !3
16+
%or = or i8 %0, -128
17+
store volatile i8 %or, ptr inttoptr (i16 1 to ptr), align 1, !tbaa !3
18+
%and = and i16 %inc, 15
19+
%add = add nuw nsw i16 %and, 1
20+
tail call addrspace(1) void @nil(i16 noundef %add) #2
21+
br label %while.cond
22+
}
23+

0 commit comments

Comments
 (0)