[WebAssembly] Fix fast-isel optimization of branch conditions.
authorDan Gohman <dan433584@gmail.com>
Mon, 2 Jul 2018 19:45:57 +0000 (19:45 +0000)
committerDan Gohman <dan433584@gmail.com>
Mon, 2 Jul 2018 19:45:57 +0000 (19:45 +0000)
commitb01d87622b02cf0b9225984270e0f388b334ff35
treed3c7a875103fb0a8596d5b11956033f0b500495c
parent0705829e405ebfd480cb365667c834445e19dc14
[WebAssembly] Fix fast-isel optimization of branch conditions.

LLVM doesn't guarantee anything about the high bits of a register holding
an i1 value at the IR level, so don't translate LLVM IR i1 values directly
into WebAssembly conditional branch operands. WebAssembly's conditional
branches do demand all 32 bits be valid.

Fixes PR38019.

llvm-svn: 336138
llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
llvm/test/CodeGen/WebAssembly/fast-isel-br-i1.ll [new file with mode: 0644]