mirror of
https://github.com/zama-ai/concrete.git
synced 2026-02-08 19:44:57 -05:00
fix(compiler): Copy attributes when reinstantiating scf.for ops
The switch to reinstantiating conversion patterns for the conversion
from FHE to TFHE in commit 73fd6c5fe7
caused all attributes of `scf.for` operations to be dropped during the
conversion. This included the custom attribute `parallel`, which is
exploited further down the compilation pipeline to generate parallel
code. As a result, the performance of end-to-end benchmarks dropped
significantly.
This patch copies all attributes of `scf.for` operations upon
reinstantiation, which solves the performance regression.
This commit is contained in:
committed by
Quentin Bourgerie
parent
3ab10c8d3f
commit
fc02bb5cd8
@@ -20,6 +20,8 @@ TypeConvertingReinstantiationPattern<scf::ForOp, false>::matchAndRewrite(
|
||||
adaptor.getStep(), adaptor.getInitArgs(),
|
||||
[&](OpBuilder &builder, Location loc, Value iv, ValueRange args) {});
|
||||
|
||||
newForOp->setAttrs(adaptor.getAttributes());
|
||||
|
||||
// Move operations from old for op to new one
|
||||
auto &newOperations = newForOp.getBody()->getOperations();
|
||||
mlir::Block *oldBody = oldOp.getBody();
|
||||
|
||||
Reference in New Issue
Block a user