|
| 1 | +diff --git a/lib/SPIRV/OCLToSPIRV.cpp b/lib/SPIRV/OCLToSPIRV.cpp |
| 2 | +index 05a60ec4..2866141c 100644 |
| 3 | +--- a/lib/SPIRV/OCLToSPIRV.cpp |
| 4 | ++++ b/lib/SPIRV/OCLToSPIRV.cpp |
| 5 | +@@ -152,8 +152,8 @@ getAtomicPointerMemorySemanticsMemoryMask(const Value *Ptr, |
| 6 | + |
| 7 | + static size_t getOCLCpp11AtomicMaxNumOps(StringRef Name) { |
| 8 | + return StringSwitch<size_t>(Name) |
| 9 | +- .Cases({"load", "flag_test_and_set", "flag_clear"}, 3) |
| 10 | +- .Cases({"store", "exchange"}, 4) |
| 11 | ++ .Cases("load", "flag_test_and_set", "flag_clear", 3) |
| 12 | ++ .Cases("store", "exchange", 4) |
| 13 | + .StartsWith("compare_exchange", 6) |
| 14 | + .StartsWith("fetch", 4) |
| 15 | + .Default(0); |
| 16 | +diff --git a/lib/SPIRV/SPIRVUtil.cpp b/lib/SPIRV/SPIRVUtil.cpp |
| 17 | +index b747e423..14fc6d05 100644 |
| 18 | +--- a/lib/SPIRV/SPIRVUtil.cpp |
| 19 | ++++ b/lib/SPIRV/SPIRVUtil.cpp |
| 20 | +@@ -620,11 +620,11 @@ static std::string demangleBuiltinOpenCLTypeName(StringRef MangledStructName) { |
| 21 | + /// floating point type. |
| 22 | + static Type *parsePrimitiveType(LLVMContext &Ctx, StringRef Name) { |
| 23 | + return StringSwitch<Type *>(Name) |
| 24 | +- .Cases({"char", "signed char", "unsigned char"}, Type::getInt8Ty(Ctx)) |
| 25 | +- .Cases({"short", "unsigned short"}, Type::getInt16Ty(Ctx)) |
| 26 | +- .Cases({"int", "unsigned int"}, Type::getInt32Ty(Ctx)) |
| 27 | +- .Cases({"long", "unsigned long"}, Type::getInt64Ty(Ctx)) |
| 28 | +- .Cases({"long long", "unsigned long long"}, Type::getInt64Ty(Ctx)) |
| 29 | ++ .Cases("char", "signed char", "unsigned char", Type::getInt8Ty(Ctx)) |
| 30 | ++ .Cases("short", "unsigned short", Type::getInt16Ty(Ctx)) |
| 31 | ++ .Cases("int", "unsigned int", Type::getInt32Ty(Ctx)) |
| 32 | ++ .Cases("long", "unsigned long", Type::getInt64Ty(Ctx)) |
| 33 | ++ .Cases("long long", "unsigned long long", Type::getInt64Ty(Ctx)) |
| 34 | + .Case("half", Type::getHalfTy(Ctx)) |
| 35 | + .Case("float", Type::getFloatTy(Ctx)) |
| 36 | + .Case("double", Type::getDoubleTy(Ctx)) |
| 37 | +diff --git a/lib/SPIRV/SPIRVWriter.cpp b/lib/SPIRV/SPIRVWriter.cpp |
| 38 | +index b017e663..3fd8f21b 100644 |
| 39 | +--- a/lib/SPIRV/SPIRVWriter.cpp |
| 40 | ++++ b/lib/SPIRV/SPIRVWriter.cpp |
| 41 | +@@ -5397,16 +5397,16 @@ LLVMToSPIRVBase::getFPBuiltinType(IntrinsicInst *II, StringRef &OpName) { |
| 42 | + OpName = Name.split('.').first; |
| 43 | + FPBuiltinType Type = |
| 44 | + StringSwitch<FPBuiltinType>(OpName) |
| 45 | +- .Cases({"fadd", "fsub", "fmul", "fdiv", "frem"}, |
| 46 | ++ .Cases("fadd", "fsub", "fmul", "fdiv", "frem", |
| 47 | + FPBuiltinType::REGULAR_MATH) |
| 48 | +- .Cases({"sin", "cos", "tan"}, FPBuiltinType::EXT_1OPS) |
| 49 | +- .Cases({"sinh", "cosh", "tanh"}, FPBuiltinType::EXT_1OPS) |
| 50 | +- .Cases({"asin", "acos", "atan"}, FPBuiltinType::EXT_1OPS) |
| 51 | +- .Cases({"asinh", "acosh", "atanh"}, FPBuiltinType::EXT_1OPS) |
| 52 | +- .Cases({"exp", "exp2", "exp10", "expm1"}, FPBuiltinType::EXT_1OPS) |
| 53 | +- .Cases({"log", "log2", "log10", "log1p"}, FPBuiltinType::EXT_1OPS) |
| 54 | +- .Cases({"sqrt", "rsqrt", "erf", "erfc"}, FPBuiltinType::EXT_1OPS) |
| 55 | +- .Cases({"atan2", "pow", "hypot", "ldexp"}, FPBuiltinType::EXT_2OPS) |
| 56 | ++ .Cases("sin", "cos", "tan", FPBuiltinType::EXT_1OPS) |
| 57 | ++ .Cases("sinh", "cosh", "tanh", FPBuiltinType::EXT_1OPS) |
| 58 | ++ .Cases("asin", "acos", "atan", FPBuiltinType::EXT_1OPS) |
| 59 | ++ .Cases("asinh", "acosh", "atanh", FPBuiltinType::EXT_1OPS) |
| 60 | ++ .Cases("exp", "exp2", "exp10", "expm1", FPBuiltinType::EXT_1OPS) |
| 61 | ++ .Cases("log", "log2", "log10", "log1p", FPBuiltinType::EXT_1OPS) |
| 62 | ++ .Cases("sqrt", "rsqrt", "erf", "erfc", FPBuiltinType::EXT_1OPS) |
| 63 | ++ .Cases("atan2", "pow", "hypot", "ldexp", FPBuiltinType::EXT_2OPS) |
| 64 | + .Case("sincos", FPBuiltinType::EXT_3OPS) |
| 65 | + .Default(FPBuiltinType::UNKNOWN); |
| 66 | + return Type; |
0 commit comments