[PATCH] Experiment with keeping GEPs near calls
Quentin Colombet
qcolombet at apple.com
Fri Mar 13 10:14:56 PDT 2015
Hi Daniel,
LGTM with minor nitpicks.
Thanks,
-Quentin
================
Comment at: lib/CodeGen/MachineLICM.cpp:797
@@ +796,3 @@
+ // We need to ensure that we can safely move this instruction into the loop.
+ // As such, it must have side-effects, e.g. such as a call has.
+ if (IsLoopInvariantInst(*I))
----------------
-> it must *not* have...
================
Comment at: lib/CodeGen/MachineLICM.cpp:798
@@ +797,3 @@
+ // As such, it must have side-effects, e.g. such as a call has.
+ if (IsLoopInvariantInst(*I))
+ Candidates.push_back(I);
----------------
The test for HasLoopPHIUse is not strictly necessary, but it acts as an optimization for the next check I believe.
Indeed, if the candidate is used within a phi for the loop, it won’t be sunken.
http://reviews.llvm.org/D7259
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the llvm-commits
mailing list