diff options
author | Dan Gohman <dan433584@gmail.com> | 2018-07-02 19:45:57 +0000 |
---|---|---|
committer | Dan Gohman <dan433584@gmail.com> | 2018-07-02 19:45:57 +0000 |
commit | b01d87622b02cf0b9225984270e0f388b334ff35 (patch) | |
tree | d3c7a875103fb0a8596d5b11956033f0b500495c /llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | |
parent | 0705829e405ebfd480cb365667c834445e19dc14 (diff) | |
download | bcm5719-llvm-b01d87622b02cf0b9225984270e0f388b334ff35.tar.gz bcm5719-llvm-b01d87622b02cf0b9225984270e0f388b334ff35.zip |
[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
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp index 7b5eab42f87..566ef68c027 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp @@ -419,7 +419,7 @@ unsigned WebAssemblyFastISel::getRegForI1Value(const Value *V, bool &Not) { return getRegForValue(ICmp->getOperand(0)); } - if (BinaryOperator::isNot(V)) { + if (BinaryOperator::isNot(V) && V->getType()->isIntegerTy(32)) { Not = true; return getRegForValue(BinaryOperator::getNotArgument(V)); } |