[PATCH] D23100: [wasm] Fix FastISel generating NoReg

Dominic Chen via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 3 14:30:17 PDT 2016


ddcc added inline comments.

================
Comment at: test/CodeGen/WebAssembly/noreg.ll:1
@@ +1,2 @@
+; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs | FileCheck %s
+
----------------
dschuff wrote:
> This command line shouldn't result in fast-isel even running, should it?
Portions of this pass are getting called through e.g. the generic FastISel.cpp:1417 and SelectionDAGISel.cpp:1369 for selecting return instructions.

================
Comment at: test/CodeGen/WebAssembly/noreg.ll:11
@@ +10,3 @@
+entry:
+  ret i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32)
+}
----------------
dschuff wrote:
> are these constexprs (and inttoptrs/casts) necessary to reproduce?
> Is the underlying problem is that the `getRegForValue` calls for the icmp are bailing, or something like that?
Yes, I believe they are necessary. The issue is that when optimization has been turned off in the front-end, instruction can have sufficiently complex operands that fail inside `getRegForValue` during FastISel, which will return zero. But previously we weren't checking these return values, putting NoReg into the generated instructions and causing problems later.


https://reviews.llvm.org/D23100





More information about the llvm-commits mailing list