CIRCT
20.0.0git
|
#include "circt/Dialect/Arc/ArcInterfaces.h"
#include "circt/Dialect/Arc/ArcOps.h"
#include "circt/Dialect/Arc/ArcPasses.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "mlir/Dialect/SCF/IR/SCF.h"
#include "mlir/Pass/Pass.h"
#include "llvm/Support/Debug.h"
#include "circt/Dialect/Arc/ArcPasses.h.inc"
Go to the source code of this file.
Namespaces | |
circt | |
The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
circt::arc | |
Macros | |
#define | DEBUG_TYPE "arc-mux-to-control-flow" |
#define | GEN_PASS_DEF_MUXTOCONTROLFLOW |
Functions | |
static bool | isValidToProceedTraversal (Operation *mux, Operation *curr, Value useValue, SmallPtrSetImpl< Operation * > &visited) |
Check whether. More... | |
static void | computeFanIn (Operation *mux, Value useValue, SmallPtrSetImpl< Operation * > &visited) |
Compute the set of operations that would only be used in the branch represented by. More... | |
static void | cloneOpsIntoBranchesWhenUsedInBoth (mlir::scf::IfOp ifOp) |
Clone ops that are used in both branches of an if-statement but not outside of it. More... | |
static void | doConversion (Operation *op, BranchInfo info, const SmallPtrSetImpl< Operation * > &thenOps, const SmallPtrSetImpl< Operation * > &elseOps) |
Perform the actual conversion. More... | |
static uint32_t | getCostEstimate (const SmallPtrSetImpl< Operation * > &ops) |
Simple helper to invoke the runtime cost interface for every operation in a set and sum up the costs. More... | |
static BranchInfo | getConversionInfo (Operation *op) |
Convert concrete operations that should be converted to if-statements to a more abstract representation the rest of the pass works with. More... | |
static bool | isBeneficialToConvert (Operation *op, const SmallPtrSetImpl< Operation * > &thenOps, const SmallPtrSetImpl< Operation * > &elseOps) |
Use the cost measure of each branch to heuristically decide whether to actually perform the conversion. More... | |
#define DEBUG_TYPE "arc-mux-to-control-flow" |
Definition at line 24 of file MuxToControlFlow.cpp.
#define GEN_PASS_DEF_MUXTOCONTROLFLOW |
Definition at line 28 of file MuxToControlFlow.cpp.
|
static |
Clone ops that are used in both branches of an if-statement but not outside of it.
This is just here because of experimentation reasons. Doing this might allow for better instruction scheduling to slightly reduce ISA register pressure (however, it is currently too naive to only take the beneficial situations), but it will increase binary size which is especially bad when the hot part would otherwise fit in instruction cache (but doesn't really matter when it doesn't fit anyways as there is no temporal locality anyways).
Definition at line 141 of file MuxToControlFlow.cpp.
|
static |
Compute the set of operations that would only be used in the branch represented by.
useValue. |
Definition at line 105 of file MuxToControlFlow.cpp.
References isValidToProceedTraversal().
|
static |
Perform the actual conversion.
Create the if-statement, move the operations in its regions and delete the mux.
Definition at line 180 of file MuxToControlFlow.cpp.
|
static |
Convert concrete operations that should be converted to if-statements to a more abstract representation the rest of the pass works with.
This is the place where support for more operations can be added (nothing else has to be changed).
Definition at line 245 of file MuxToControlFlow.cpp.
|
static |
Simple helper to invoke the runtime cost interface for every operation in a set and sum up the costs.
Definition at line 220 of file MuxToControlFlow.cpp.
Referenced by isBeneficialToConvert().
|
static |
Use the cost measure of each branch to heuristically decide whether to actually perform the conversion.
TODO: improve and fine-tune this
Definition at line 257 of file MuxToControlFlow.cpp.
References getCostEstimate().
|
static |
Check whether.
curr | is valid to be moved into the if-branch, which is the stopping condition of the BFS traversal. |
Definition at line 79 of file MuxToControlFlow.cpp.
Referenced by computeFanIn().