[AVR] Support stores to undefined pointers
This would previously trigger an assertion error in AVRISelDAGToDAG.
llvm-svn: 289321
diff --git a/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp b/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
index 098ee61b..9ef9874 100644
--- a/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
+++ b/llvm/lib/Target/AVR/AVRISelDAGToDAG.cpp
@@ -328,7 +328,8 @@
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;
}