That para is equally contradictory and in the same way.
This still contradicts the fact that the external attributes can’t expect to add new semantics that the infrastructure should have to specially care about – which is also why I believe they were called discardable. I still don’t think you have a single valid reason here as to why external attributes should be dropped as opposed to being preserved.
@jpienaar But in a large number of cases where you are doing in-place mutation (please see upthread), you are already preserving such external attributes because, at all those places, the pass/utility/rewrite doesn’t care (and shouldn’t) about the presence of such external attributes. So dropping them would in fact be inconsistent with all of those and preserving would be consistent. The patch is doing the latter – that’s neither wrong but consistent with certain existing behavior and I agree inconsistent with others. In which direction would you make the argument on uniformity?
We are going in circles. To make things concrete, let me separate the “what” from the “why”. Does everyone agree that it’d be useful to have these two accessors auto-generated on an op:
void getExternalAttributes(SmallVectorImpl<Attribute> &attrs);
void getIntrinsicAttributes(SmallVectorImpl<Attribute> &attrs);
Both can be auto-generated on a derived op OpTy.