@@ -854,29 +854,15 @@ class ConversionPatternRewriter final : public PatternRewriter {
854
854
Region *region, const TypeConverter &converter,
855
855
TypeConverter::SignatureConversion *entryConversion = nullptr );
856
856
857
- // / Replace all the uses of `from` with `to`. The type of `from` and `to` is
858
- // / allowed to differ. The conversion driver will try to reconcile all type
859
- // / mismatches that still exist at the end of the conversion with
860
- // / materializations. This function supports both 1:1 and 1:N replacements.
857
+ // / Replace all the uses of the block argument `from` with `to`. This
858
+ // / function supports both 1:1 and 1:N replacements.
861
859
// /
862
- // / Note: If `allowPatternRollback` is set to "true", this function behaves
863
- // / slightly different:
864
- // /
865
- // / 1. All current and future uses of `from` are replaced. The same value must
866
- // / not be replaced multiple times. That's an API violation.
867
- // / 2. Uses are not replaced immediately but in a delayed fashion. Patterns
868
- // / may still see the original uses when inspecting IR.
869
- // / 3. Uses within the same block that appear before the defining operation
870
- // / of the replacement value are not replaced. This allows users to
871
- // / perform certain replaceAllUsesExcept-style replacements, even though
872
- // / such API is not directly supported.
873
- // /
874
- // / Note: In an attempt to align the ConversionPatternRewriter and
875
- // / RewriterBase APIs, (3) may be removed in the future.
876
- void replaceAllUsesWith (Value from, ValueRange to);
877
- void replaceAllUsesWith (Value from, Value to) override {
878
- replaceAllUsesWith (from, ValueRange{to});
879
- }
860
+ // / Note: If `allowPatternRollback` is set to "true", this function replaces
861
+ // / all current and future uses of the block argument. This same block
862
+ // / block argument must not be replaced multiple times. Uses are not replaced
863
+ // / immediately but in a delayed fashion. Patterns may still see the original
864
+ // / uses when inspecting IR.
865
+ void replaceUsesOfBlockArgument (BlockArgument from, ValueRange to);
880
866
881
867
// / Return the converted value of 'key' with a type defined by the type
882
868
// / converter of the currently executing pattern. Return nullptr in the case
0 commit comments