Skip to content

Commit f62e532

Browse files
chbessonovaasl
authored andcommitted
[MSP430] Fix crash while lowering llvm.stacksave() and llvm.stackrestore()
1 parent 0fdd924 commit f62e532

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

src/llvm/lib/Target/MSP430/MSP430ISelLowering.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ MSP430TargetLowering::MSP430TargetLowering(const TargetMachine &TM,
9595
setOperationAction(ISD::SIGN_EXTEND, MVT::i16, Custom);
9696
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i8, Expand);
9797
setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i16, Expand);
98+
setOperationAction(ISD::STACKSAVE, MVT::Other, Expand);
99+
setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand);
98100

99101
setOperationAction(ISD::CTTZ, MVT::i8, Expand);
100102
setOperationAction(ISD::CTTZ, MVT::i16, Expand);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; RUN: llc < %s -march=msp430
2+
3+
target triple = "msp430"
4+
5+
define void @foo() #0 {
6+
entry:
7+
%0 = tail call i8* @llvm.stacksave()
8+
tail call void @llvm.stackrestore(i8* %0)
9+
ret void
10+
}
11+
12+
declare i8* @llvm.stacksave() #1
13+
declare void @llvm.stackrestore(i8*) #1

0 commit comments

Comments
 (0)