If this extload is directly stored, and that store's input value was
loaded before still, try to avoid the roundtrip through memory and
extload directly from the original memory location.
This can't be caught by the other store-to-load forwarding DAGCombines,
because the extload's memory type might not be legal.
Instead, try to match this:
v4i32 load %ptr2, zext from v4i8 store i32 %value, %ptr2 %value = load i32 %ptr1
to turn the extload into:
v4i32 load %ptr1, zext from v4i8
Avoids a regression in an X86 testcase with D6533.
IIRC, we tend to write the chain of computation in the opposite order:
load
store
extload
Please make sure you use the same convention here and I did not remember correctly, then ignore this :).