But copy_propagation_transform_swizzle() only does something useful when a variable has components from different sources *and* those components aren't all constant. Unless I'm mistaken that is.
The (a) part of copy_propagation_transform_swizzle() also takes care of replacing with a constant when only the used components of the swizzle's load are constants.
That's exactly what I mean. For copy_propagation_transform_swizzle() to do something useful, a variable has to have some constant components and some non-constant components, *and* only the constant components are used. Why would that happen in a real program? Is your IR example actually realistic?