llvm / circt

Circuit IR Compilers and Tools
https://circt.org
Other
1.64k stars 286 forks source link

[LowerDPI] Defer deletion of call ops to prevent inavlid access. #7170

Closed fzi-hielscher closed 3 months ago

fzi-hielscher commented 3 months ago

The lower-dpi-error.mlir test added in #7139 crashes on my local macOS debug build. This appears to be caused by an invalid access in the lowering loop. The iterator stored in inputTypes references the operand range of the first call op. However, after calling lowerCall(firstDPICallop); this op has been deleted. Deferring op erasure until after the current batch of call operations has been checked and lowered has fixed the problem for me.

Close https://github.com/llvm/circt/issues/7169