@@ -88,7 +88,7 @@ getOrCreateFuncAnalysisState(OneShotAnalysisState &state) {
88
88
89
89
// / Return the unique ReturnOp that terminates `funcOp`.
90
90
// / Return nullptr if there is no such unique ReturnOp.
91
- static Operation* getAssumedUniqueReturnOp (FunctionOpInterface funcOp) {
91
+ static Operation * getAssumedUniqueReturnOp (FunctionOpInterface funcOp) {
92
92
Operation *returnOp = nullptr ;
93
93
for (Block &b : funcOp.getFunctionBody ()) {
94
94
auto candidateOp = b.getTerminator ();
@@ -127,7 +127,8 @@ static void annotateEquivalentReturnBbArg(OpOperand &returnVal,
127
127
// / Store function BlockArguments that are equivalent to/aliasing a returned
128
128
// / value in FuncAnalysisState.
129
129
static LogicalResult
130
- aliasingFuncOpBBArgsAnalysis (FunctionOpInterface funcOp, OneShotAnalysisState &state,
130
+ aliasingFuncOpBBArgsAnalysis (FunctionOpInterface funcOp,
131
+ OneShotAnalysisState &state,
131
132
FuncAnalysisState &funcState) {
132
133
if (funcOp.getFunctionBody ().empty ()) {
133
134
// No function body available. Conservatively assume that every tensor
@@ -168,8 +169,8 @@ aliasingFuncOpBBArgsAnalysis(FunctionOpInterface funcOp, OneShotAnalysisState &s
168
169
return success ();
169
170
}
170
171
171
- static void annotateFuncArgAccess (FunctionOpInterface funcOp, int64_t idx, bool isRead,
172
- bool isWritten) {
172
+ static void annotateFuncArgAccess (FunctionOpInterface funcOp, int64_t idx,
173
+ bool isRead, bool isWritten) {
173
174
OpBuilder b (funcOp.getContext ());
174
175
Attribute accessType;
175
176
if (isRead && isWritten) {
@@ -189,10 +190,10 @@ static void annotateFuncArgAccess(FunctionOpInterface funcOp, int64_t idx, bool
189
190
// / function with unknown ops, we conservatively assume that such ops bufferize
190
191
// / to a read + write.
191
192
static LogicalResult
192
- funcOpBbArgReadWriteAnalysis (FunctionOpInterface funcOp, OneShotAnalysisState &state,
193
+ funcOpBbArgReadWriteAnalysis (FunctionOpInterface funcOp,
194
+ OneShotAnalysisState &state,
193
195
FuncAnalysisState &funcState) {
194
- for (int64_t idx = 0 , e = funcOp.getNumArguments (); idx < e;
195
- ++idx) {
196
+ for (int64_t idx = 0 , e = funcOp.getNumArguments (); idx < e; ++idx) {
196
197
// Skip non-tensor arguments.
197
198
if (!isa<TensorType>(funcOp.getArgumentTypes ()[idx]))
198
199
continue ;
@@ -277,10 +278,8 @@ static void equivalenceAnalysis(FunctionOpInterface funcOp,
277
278
278
279
// / Return "true" if the given function signature has tensor semantics.
279
280
static bool hasTensorSignature (FunctionOpInterface funcOp) {
280
- return llvm::any_of (funcOp.getArgumentTypes (),
281
- llvm::IsaPred<TensorType>) ||
282
- llvm::any_of (funcOp.getResultTypes (),
283
- llvm::IsaPred<TensorType>);
281
+ return llvm::any_of (funcOp.getArgumentTypes (), llvm::IsaPred<TensorType>) ||
282
+ llvm::any_of (funcOp.getResultTypes (), llvm::IsaPred<TensorType>);
284
283
}
285
284
286
285
// / Store all functions of the `moduleOp` in `orderedFuncOps`, sorted by
@@ -310,7 +309,8 @@ getFuncOpsOrderedByCalls(ModuleOp moduleOp,
310
309
numberCallOpsContainedInFuncOp[funcOp] = 0 ;
311
310
return funcOp.walk ([&](CallOpInterface callOp) -> WalkResult {
312
311
FunctionOpInterface calledFunction = getCalledFunction (callOp);
313
- assert (calledFunction && " could not retrieved called FunctionOpInterface" );
312
+ assert (calledFunction &&
313
+ " could not retrieved called FunctionOpInterface" );
314
314
// If the called function does not have any tensors in its signature, then
315
315
// it is not necessary to bufferize the callee before the caller.
316
316
if (!hasTensorSignature (calledFunction))
@@ -364,8 +364,8 @@ static void foldMemRefCasts(FunctionOpInterface funcOp) {
364
364
}
365
365
}
366
366
367
- auto newFuncType = FunctionType::get (
368
- funcOp. getContext (), funcOp.getArgumentTypes (), resultTypes);
367
+ auto newFuncType = FunctionType::get (funcOp. getContext (),
368
+ funcOp.getArgumentTypes (), resultTypes);
369
369
funcOp.setType (newFuncType);
370
370
}
371
371
0 commit comments