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.
Paths
| Differential D80053
[GlobalISel] Don't combine instructions which are fed by memory instructions. ClosedPublic Authored by paquette on May 15 2020, 5:44 PM.
Details Summary 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
Event Timeline
This revision is now accepted and ready to land.May 26 2020, 5:16 PM Closed by commit rGc593bf534222: [GlobalISel] Don't combine instructions which are fed by memory instructions. (authored by paquette). · Explain WhyMay 27 2020, 1:04 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 266641 llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/test/CodeGen/AArch64/GlobalISel/prelegalizercombiner-not-really-equiv-insts.mir
|
Could also consider if the load is invariant