Optimize DPI import argument passing (#7704)
Pass inputs to DPI import wrappers by reference (unless fits in a register). This eliminates a lot of temporary constructors/destructors.
This commit is contained in:
parent
7664bbb3ef
commit
0026a73ca0
|
|
@ -1405,6 +1405,13 @@ class TaskVisitor final : public VNVisitor {
|
|||
unlinkAndClone(nodep, portp, false);
|
||||
portp->funcLocal(true);
|
||||
cfuncp->addArgsp(portp);
|
||||
// Pass inputs to DPI import wrappers by reference, unless fits in register
|
||||
if (cfuncp->dpiImportWrapper() && portp->isReadOnly()) {
|
||||
AstNodeDType* const dtypep = portp->dtypep()->skipRefp();
|
||||
if (dtypep->isCompound() || dtypep->isWide()) {
|
||||
portp->direction(VDirection::CONSTREF);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// "Normal" variable, mark inside function
|
||||
portp->funcLocal(true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue