Skip to content

Commit 6211d3c

Browse files
committed
Add vOrigins propagation to Dup functions found by static analysis
Static analysis found 6 Gia_Man_t* Dup functions reachable from the abc9 pipeline that create new GIAs without propagating vOrigins: - Gia_ManDupFromBarBufs (giaScript.c) - used by &synch2 with boxes - Gia_ManDupToBarBufs (giaScript.c) - used by &synch2 with boxes - Gia_ManDupUnshuffleInputs (giaTim.c) - timing CI reordering - Gia_ManDupMoveLast (giaTim.c) - timing CI manipulation - Gia_ManDupHashMapping (giaIf.c) - &if hash mapping mode - Gia_ManDupUnhashMapping (giaIf.c) - &if unhash mapping mode All use the Value field for old->new object mapping, so the standard Gia_ManOriginsDup call propagates origins correctly. Co-developed-by: Claude Code v2.1.58 (claude-opus-4-6)
1 parent 8ccd01a commit 6211d3c

3 files changed

Lines changed: 6 additions & 0 deletions

File tree

src/aig/gia/giaIf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,7 @@ Gia_Man_t * Gia_ManDupHashMapping( Gia_Man_t * p )
33003300
Vec_IntPush( vMapping, Abc_Lit2Var(pObj->Value) );
33013301
}
33023302
pNew->vMapping = vMapping;
3303+
Gia_ManOriginsDup( pNew, p );
33033304
return pNew;
33043305
}
33053306

@@ -3379,6 +3380,7 @@ Gia_Man_t * Gia_ManDupUnhashMapping( Gia_Man_t * p )
33793380
}
33803381
Vec_IntFree( vMap );
33813382
pNew->vMapping = vMapping;
3383+
Gia_ManOriginsDup( pNew, p );
33823384
return pNew;
33833385
}
33843386

src/aig/gia/giaScript.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ Gia_Man_t * Gia_ManDupFromBarBufs( Gia_Man_t * p )
315315
Gia_ManForEachCo( p, pObj, i )
316316
Gia_ManAppendCo( pNew, Gia_ObjFanin0Copy(pObj) );
317317
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
318+
Gia_ManOriginsDup( pNew, p );
318319
return pNew;
319320
}
320321
Gia_Man_t * Gia_ManDupToBarBufs( Gia_Man_t * p, int nBarBufs )
@@ -357,6 +358,7 @@ Gia_Man_t * Gia_ManDupToBarBufs( Gia_Man_t * p, int nBarBufs )
357358
assert( Gia_ManBufNum(pNew) == nBarBufs );
358359
assert( Gia_ManCiNum(pNew) == nPiReal );
359360
assert( Gia_ManCoNum(pNew) == nPoReal );
361+
Gia_ManOriginsDup( pNew, p );
360362
return pNew;
361363
}
362364

src/aig/gia/giaTim.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ Gia_Man_t * Gia_ManDupUnshuffleInputs( Gia_Man_t * p )
241241
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
242242
pNew->nConstrs = p->nConstrs;
243243
assert( Gia_ManIsNormalized(pNew) );
244+
Gia_ManOriginsDup( pNew, p );
244245
Gia_ManDupRemapEquiv( pNew, p );
245246
return pNew;
246247
}
@@ -779,6 +780,7 @@ Gia_Man_t * Gia_ManDupMoveLast( Gia_Man_t * p, int iInsert, int nItems )
779780
else assert( 0 );
780781
}
781782
Gia_ManSetRegNum( pNew, Gia_ManRegNum(p) );
783+
Gia_ManOriginsDup( pNew, p );
782784
return pNew;
783785
}
784786

0 commit comments

Comments
 (0)