Index: llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp =================================================================== --- llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp +++ llvm/trunk/lib/Target/MSP430/MSP430ISelLowering.cpp @@ -95,6 +95,8 @@ setOperationAction(ISD::SIGN_EXTEND, MVT::i16, Custom); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i8, Expand); setOperationAction(ISD::DYNAMIC_STACKALLOC, MVT::i16, Expand); + setOperationAction(ISD::STACKSAVE, MVT::Other, Expand); + setOperationAction(ISD::STACKRESTORE, MVT::Other, Expand); setOperationAction(ISD::CTTZ, MVT::i8, Expand); setOperationAction(ISD::CTTZ, MVT::i16, Expand); Index: llvm/trunk/test/CodeGen/MSP430/stacksave_restore.ll =================================================================== --- llvm/trunk/test/CodeGen/MSP430/stacksave_restore.ll +++ llvm/trunk/test/CodeGen/MSP430/stacksave_restore.ll @@ -0,0 +1,13 @@ +; RUN: llc < %s -march=msp430 + +target triple = "msp430" + +define void @foo() { +entry: + %0 = tail call i8* @llvm.stacksave() + tail call void @llvm.stackrestore(i8* %0) + ret void +} + +declare i8* @llvm.stacksave() +declare void @llvm.stackrestore(i8*)