[WebAssembly] Fast-isel support for calls, arguments, and selects.

llvm-svn: 269273
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp
index b3da786..1e9a773 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyStoreResults.cpp
@@ -115,9 +115,11 @@
     O.setReg(ToReg);
 
     // If the store's def was previously dead, it is no longer.
-    MI.getOperand(0).setIsDead(false);
+    if (!O.isUndef()) {
+      MI.getOperand(0).setIsDead(false);
 
-    Indices.push_back(WhereIdx.getRegSlot());
+      Indices.push_back(WhereIdx.getRegSlot());
+    }
   }
 
   if (Changed) {