If we have a memory instruction (e.g. a load), we shouldn't combine it away in some trivial combine.
It's possible that, say, a call lives between the instructions. This could modify the value loaded, making the load instructions not safe to fold.
Differential D80053
[GlobalISel] Don't combine instructions which are fed by memory instructions. paquette on May 15 2020, 5:44 PM. Authored by
Details If we have a memory instruction (e.g. a load), we shouldn't combine it away in some trivial combine. It's possible that, say, a call lives between the instructions. This could modify the value loaded, making the load instructions not safe to fold.
Diff Detail |
Could also consider if the load is invariant