This would previously trigger an assertion error in AVRISelDAGToDAG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@289321
91177308-0d34-0410-b5e6-
96231b3b80d8
SDValue BasePtr = ST->getBasePtr();
// Early exit when the base pointer is a frame index node or a constant.
- if (isa<FrameIndexSDNode>(BasePtr) || isa<ConstantSDNode>(BasePtr)) {
+ if (isa<FrameIndexSDNode>(BasePtr) || isa<ConstantSDNode>(BasePtr) ||
+ BasePtr.isUndef()) {
return false;
}
--- /dev/null
+; RUN: llc < %s -mattr=avr6 | FileCheck %s
+
+; This test checks that we can successfully lower a store
+; to an undefined pointer.
+
+; CHECK-LABEL: foo
+define void @foo() {
+
+ ; CHECK: ldi [[SRC:r[0-9]+]], 0
+ ; CHECK-NEXT: st [[PTRREG:X|Y|Z]], [[SRC]]
+ store i8 0, i8* undef, align 4
+ ret void
+}