Skip to content

Commit

Permalink
should remove redundant function first, then clean callerMap
Browse files Browse the repository at this point in the history
Addresses #653.
  • Loading branch information
PeiMu committed May 22, 2023
1 parent 5693026 commit cf7e76b
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,10 @@ irPassLLVMIROptimizeByRange(State * N, bool enableOverload, bool enableBuiltinAs
* remove the functions that are optimized by passes.
* */
if (useOverLoad)
cleanFunctionMap(Mod, callerMap);
overloadFunc(Mod, callerMap);

if (useOverLoad)
overloadFunc(Mod, callerMap);
cleanFunctionMap(Mod, callerMap);

callerMap.clear();
funcBoundInfo.clear();
Expand Down Expand Up @@ -405,11 +405,10 @@ irPassLLVMIROptimizeByRange(State * N, bool enableOverload, bool enableBuiltinAs
/*
* remove the functions that are optimized by passes.
* */
if (useOverLoad)
cleanFunctionMap(Mod, callerMap);

if (useOverLoad)
overloadFunc(Mod, callerMap);
if (useOverLoad)
cleanFunctionMap(Mod, callerMap);

flexprint(N->Fe, N->Fm, N->Fpinfo, "infer bound\n");
callerMap.clear();
Expand Down Expand Up @@ -442,11 +441,10 @@ irPassLLVMIROptimizeByRange(State * N, bool enableOverload, bool enableBuiltinAs
/*
* remove the functions that are optimized by passes.
* */
if (useOverLoad)
cleanFunctionMap(Mod, callerMap);

if (useOverLoad)
overloadFunc(Mod, callerMap);
if (useOverLoad)
cleanFunctionMap(Mod, callerMap);

if (enableBuiltinAssume) {
for (auto & mi : *Mod)
Expand Down

0 comments on commit cf7e76b

Please sign in to comment.