@@ -51,7 +51,8 @@ struct ConvertNativeFuncPattern final : public OpConversionPattern<Op> {
5151 return failure ();
5252
5353 arith::FastMathFlags fastFlags = op.getFastmath ();
54- if (!(static_cast <uint32_t >(fastFlags) & static_cast <uint32_t >(arith::FastMathFlags::afn)))
54+ if (!(static_cast <uint32_t >(fastFlags) &
55+ static_cast <uint32_t >(arith::FastMathFlags::afn)))
5556 return rewriter.notifyMatchFailure (op, " not a fastmath `afn` operation" );
5657
5758 SmallVector<Type, 1 > operandTypes;
@@ -60,13 +61,15 @@ struct ConvertNativeFuncPattern final : public OpConversionPattern<Op> {
6061 // supported vector sizes: Distributing unsupported vector sizes to SPIRV
6162 // supported vector sizes are done in other blocking optimization passes.
6263 if (!isSPIRVCompatibleFloatOrVec (operand.getType ()))
63- return rewriter.notifyMatchFailure (op, " no equivalent native operation for operand type" );
64+ return rewriter.notifyMatchFailure (
65+ op, " no equivalent native operation for operand type" );
6466 operandTypes.push_back (operand.getType ());
6567 }
6668
6769 auto moduleOp = op->template getParentWithTrait <OpTrait::SymbolTable>();
68- auto funcOpRes =
69- LLVM::lookupOrCreateFn (rewriter, moduleOp, getMangledNativeFuncName (operandTypes), operandTypes, op.getType ());
70+ auto funcOpRes = LLVM::lookupOrCreateFn (
71+ rewriter, moduleOp, getMangledNativeFuncName (operandTypes),
72+ operandTypes, op.getType ());
7073 assert (!failed (funcOpRes));
7174 LLVM::LLVMFuncOp funcOp = funcOpRes.value ();
7275
@@ -99,8 +102,8 @@ struct ConvertNativeFuncPattern final : public OpConversionPattern<Op> {
99102 return false ;
100103 }
101104
102-
103- inline std::string getMangledNativeFuncName (const ArrayRef<Type> operandTypes) const {
105+ inline std::string
106+ getMangledNativeFuncName (const ArrayRef<Type> operandTypes) const {
104107 std::string mangledFuncName =
105108 " _Z" + std::to_string (nativeFunc.size ()) + nativeFunc.str ();
106109
@@ -170,6 +173,7 @@ void ConvertMathToXeVMPass::runOnOperation() {
170173 ConversionTarget target (getContext ());
171174 target.addLegalDialect <BuiltinDialect, func::FuncDialect,
172175 vector::VectorDialect, LLVM::LLVMDialect>();
173- if (failed (applyPartialConversion (getOperation (), target, std::move (patterns))))
176+ if (failed (
177+ applyPartialConversion (getOperation (), target, std::move (patterns))))
174178 signalPassFailure ();
175179}
0 commit comments