You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #6793, we faced an issue where newly added asserts in DialectConversion were triggered by uses of rewriter.replaceAllUsesWith. This is because RewriterBase::replaceAllUsesWith is not currently supported by DialectConversion.
To work around this for now, we updated the passes to do this RAUW directly, until ConversionPatternRewriter properly supports replaceAllUsesWith. Since DialectConversion already doesn't intercept or do any bookkeeping for RewriterBase::replaceAllUsesWith, this is no less safe than the previous usage of RewriterBase::replaceAllUsesWith.
If possible, we should find a way to use the supported APIs of ConversionPatternRewriter, like replaceOp. I tried making the trivial change, but found that it violated other assumptions of the passes in question, and led to undefined behavior within the DialectConversion framework.
If these uses can only be implemented with replaceAllUsesWith, we should update these to use ConversionPatternRewriter::replaceAllUsesWith once that is available.
In #6793, we faced an issue where newly added asserts in DialectConversion were triggered by uses of rewriter.replaceAllUsesWith. This is because RewriterBase::replaceAllUsesWith is not currently supported by DialectConversion.
To work around this for now, we updated the passes to do this RAUW directly, until ConversionPatternRewriter properly supports replaceAllUsesWith. Since DialectConversion already doesn't intercept or do any bookkeeping for RewriterBase::replaceAllUsesWith, this is no less safe than the previous usage of RewriterBase::replaceAllUsesWith.
If possible, we should find a way to use the supported APIs of ConversionPatternRewriter, like replaceOp. I tried making the trivial change, but found that it violated other assumptions of the passes in question, and led to undefined behavior within the DialectConversion framework.
If these uses can only be implemented with replaceAllUsesWith, we should update these to use ConversionPatternRewriter::replaceAllUsesWith once that is available.
For more background, see the Discord discussion around https://discord.com/channels/636084430946959380/642426447167881246/1215098183739252806.
FYI @mortbopet @teqdruid
The text was updated successfully, but these errors were encountered: