diff options
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp index 527908d..3856700 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp @@ -443,13 +443,11 @@ unsigned WebAssemblyFastISel::zeroExtendToI32(unsigned Reg, const Value *V, switch (From) { case MVT::i1: - // If the value is naturally an i1, we don't need to mask it. - // TODO: Recursively examine selects, phis, and, or, xor, constants. - if (From == MVT::i1 && V != nullptr) { - if (isa<CmpInst>(V) || - (isa<Argument>(V) && cast<Argument>(V)->hasZExtAttr())) - return copyValue(Reg); - } + // If the value is naturally an i1, we don't need to mask it. We only know + // if a value is naturally an i1 if it is definitely lowered by FastISel, + // not a DAG ISel fallback. + if (V != nullptr && isa<Argument>(V) && cast<Argument>(V)->hasZExtAttr()) + return copyValue(Reg); break; case MVT::i8: case MVT::i16: |