In general, no.
These attributes are called discardable for a reason: passes are free to discard them at any time. If you control the pass pipeline, you can ensure that the passes you run preserve the attributes that you want.
Arbitrary attribute propagation is a known and very hard problem. There have been several attempts at tackling it, but no satisfiable solution. The version you have sounds very simple. The general case is not: what happens when an op with an attribute is replaced by several ops? some of which don’t allow for the attribute? the op is erased or “fused” with other ops? the pass is written in a way that makes op-to-op mapping impractical or impossible?