diff options
Diffstat (limited to 'lib/Target/WebAssembly/WebAssemblyFastISel.cpp')
-rw-r--r-- | lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/lib/Target/WebAssembly/WebAssemblyFastISel.cpp index bc7020fded8c..53698ff09b10 100644 --- a/lib/Target/WebAssembly/WebAssemblyFastISel.cpp +++ b/lib/Target/WebAssembly/WebAssemblyFastISel.cpp @@ -116,6 +116,8 @@ private: case MVT::f32: case MVT::f64: return VT; + case MVT::f16: + return MVT::f32; case MVT::v16i8: case MVT::v8i16: case MVT::v4i32: @@ -594,12 +596,12 @@ bool WebAssemblyFastISel::fastLowerArguments() { unsigned i = 0; for (auto const &Arg : F->args()) { - const AttributeSet &Attrs = F->getAttributes(); - if (Attrs.hasAttribute(i+1, Attribute::ByVal) || - Attrs.hasAttribute(i+1, Attribute::SwiftSelf) || - Attrs.hasAttribute(i+1, Attribute::SwiftError) || - Attrs.hasAttribute(i+1, Attribute::InAlloca) || - Attrs.hasAttribute(i+1, Attribute::Nest)) + const AttributeList &Attrs = F->getAttributes(); + if (Attrs.hasParamAttribute(i, Attribute::ByVal) || + Attrs.hasParamAttribute(i, Attribute::SwiftSelf) || + Attrs.hasParamAttribute(i, Attribute::SwiftError) || + Attrs.hasParamAttribute(i, Attribute::InAlloca) || + Attrs.hasParamAttribute(i, Attribute::Nest)) return false; Type *ArgTy = Arg.getType(); @@ -744,19 +746,19 @@ bool WebAssemblyFastISel::selectCall(const Instruction *I) { if (ArgTy == MVT::INVALID_SIMPLE_VALUE_TYPE) return false; - const AttributeSet &Attrs = Call->getAttributes(); - if (Attrs.hasAttribute(i+1, Attribute::ByVal) || - Attrs.hasAttribute(i+1, Attribute::SwiftSelf) || - Attrs.hasAttribute(i+1, Attribute::SwiftError) || - Attrs.hasAttribute(i+1, Attribute::InAlloca) || - Attrs.hasAttribute(i+1, Attribute::Nest)) + const AttributeList &Attrs = Call->getAttributes(); + if (Attrs.hasParamAttribute(i, Attribute::ByVal) || + Attrs.hasParamAttribute(i, Attribute::SwiftSelf) || + Attrs.hasParamAttribute(i, Attribute::SwiftError) || + Attrs.hasParamAttribute(i, Attribute::InAlloca) || + Attrs.hasParamAttribute(i, Attribute::Nest)) return false; unsigned Reg; - if (Attrs.hasAttribute(i+1, Attribute::SExt)) + if (Attrs.hasParamAttribute(i, Attribute::SExt)) Reg = getRegForSignedValue(V); - else if (Attrs.hasAttribute(i+1, Attribute::ZExt)) + else if (Attrs.hasParamAttribute(i, Attribute::ZExt)) Reg = getRegForUnsignedValue(V); else Reg = getRegForValue(V); |