|
CIRCT 24.0.0git
|
#include "ProjectionUtils.h"#include "circt/Dialect/Comb/CombOps.h"#include "circt/Dialect/HW/HWTypes.h"#include "circt/Dialect/LLHD/LLHDOps.h"#include "circt/Dialect/LLHD/LLHDPasses.h"#include "circt/Support/UnusedOpPruner.h"#include "mlir/Analysis/Liveness.h"#include "mlir/Dialect/Arith/IR/Arith.h"#include "mlir/Dialect/ControlFlow/IR/ControlFlowOps.h"#include "mlir/IR/Dominance.h"#include "llvm/ADT/ArrayRef.h"#include "llvm/Support/Debug.h"#include "llvm/Support/GenericIteratedDominanceFrontier.h"#include "circt/Dialect/LLHD/LLHDPasses.h.inc"
Go to the source code of this file.
Classes | |
| struct | llvm::DenseMapInfo< DriveCondition > |
Namespaces | |
| namespace | circt |
| The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
| namespace | circt::llhd |
Macros | |
| #define | DEBUG_TYPE "llhd-mem2reg" |
| #define | GEN_PASS_DEF_MEM2REGPASS |
Typedefs | |
| using | DefSlot = PointerIntPair<Value, 1> |
| The slot a reaching definition specifies a value for, alongside a bit indicating whether the definition is from a delayed drive or a blocking drive. | |
| using | ProjectionStack = SmallVector<Projection> |
| A stack of projection operations. | |
Functions | |
| static bool | isBlockingDrive (const Operation *op) |
| Check whether an operation is an llhd.assign. | |
| static bool | isDeltaDrive (const Operation *op) |
| Check whether an operation is a llhd.drv with a delta delay. | |
| static DefSlot | blockingSlot (Value slot) |
| static DefSlot | delayedSlot (Value slot) |
| static Value | getSlot (DefSlot slot) |
| static bool | isDelayed (DefSlot slot) |
| static Type | getStoredType (DefSlot slot) |
| static Location | getLoc (DefSlot slot) |
| static std::optional< unsigned > | getPromotableSlotBitWidth (Type type) |
| static bool | isPromotableSlotType (Type type) |
| static Value | createZeroValue (OpBuilder &builder, Location loc, Type type) |
| static ProjectionStack | getProjections (Value fromSignal, Value toSlot) |
| Collect the llhd.sig.
| |
| static Value | unpackProjections (OpBuilder &builder, Value value, ProjectionStack &projections) |
| Resolve a stack of projections by taking a value and descending into its subelements until the final value targeted by the projection stack remains, which is then returned. | |
| static Value | packProjections (OpBuilder &builder, Value value, const ProjectionStack &projections) |
| Undo a stack of projections by taking the value of the projected field and injecting it into the surrounding aggregate value that the projection targets. | |
| #define DEBUG_TYPE "llhd-mem2reg" |
Definition at line 23 of file Mem2Reg.cpp.
| #define GEN_PASS_DEF_MEM2REGPASS |
Definition at line 27 of file Mem2Reg.cpp.
| using DefSlot = PointerIntPair<Value, 1> |
The slot a reaching definition specifies a value for, alongside a bit indicating whether the definition is from a delayed drive or a blocking drive.
Definition at line 185 of file Mem2Reg.cpp.
| using ProjectionStack = SmallVector<Projection> |
A stack of projection operations.
Definition at line 605 of file Mem2Reg.cpp.
|
static |
Definition at line 186 of file Mem2Reg.cpp.
|
static |
Definition at line 212 of file Mem2Reg.cpp.
References assert(), hw.BitcastOp::create(), hw.ConstantOp::create(), and getPromotableSlotBitWidth().
|
static |
Definition at line 187 of file Mem2Reg.cpp.
|
static |
Definition at line 193 of file Mem2Reg.cpp.
Referenced by emitFile(), lowerObjectInClass(), omEvaluatorValueGetLoc(), circt::om::evaluator::AttributeValue::setAttr(), updateInstanceInClass(), and verifyUniqueNamesInRegion().
|
static |
Collect the llhd.sig.
* projection ops between fromSignal and toSlot. The fromSignal value must be derived from toSlot through only llhd.sig.* operations. The result is a stack; the op producing fromSignal appears first in the vector, while the final op projecting into toSlot appears last in the vector.
Definition at line 612 of file Mem2Reg.cpp.
|
static |
Definition at line 195 of file Mem2Reg.cpp.
References circt::hw::getBitWidth().
Referenced by createZeroValue(), and isPromotableSlotType().
|
static |
Definition at line 188 of file Mem2Reg.cpp.
|
static |
Definition at line 190 of file Mem2Reg.cpp.
References getStoredType().
Referenced by getStoredType().
|
static |
Check whether an operation is an llhd.assign.
This corresponds to a blocking assignment in Verilog.
Definition at line 43 of file Mem2Reg.cpp.
|
static |
Definition at line 189 of file Mem2Reg.cpp.
|
static |
Check whether an operation is a llhd.drv with a delta delay.
This corresponds to a non-blocking assignment in Verilog.
Definition at line 47 of file Mem2Reg.cpp.
|
static |
Definition at line 207 of file Mem2Reg.cpp.
References getPromotableSlotBitWidth().
|
static |
Undo a stack of projections by taking the value of the projected field and injecting it into the surrounding aggregate value that the projection targets.
This requires the into fields to be set to the concrete value of the intermediate projections.
Example:
Definition at line 668 of file Mem2Reg.cpp.
References circt::comb::createDynamicInject().
|
static |
Resolve a stack of projections by taking a value and descending into its subelements until the final value targeted by the projection stack remains, which is then returned.
Also updates the into fields of the projections in the stack to represent the concrete value of intermediate projections. This allows a later packProjections to reconstruct the root value with the field targeted by the projection updated to a different value.
Definition at line 628 of file Mem2Reg.cpp.
References circt::comb::createDynamicExtract().