[LLVMdev] Register pressure mechanism in PRE or Smarter rematerialization/split/spiller/coalescing ?

Daniel Berlin dberlin at dberlin.org
Wed Jul 15 13:36:01 PDT 2015


On Wed, Jul 15, 2015 at 1:10 PM, Daniel Berlin <dberlin at dberlin.org> wrote:
> IMHO, This doesn't make a lot of sense to turn off this part on it's own.
> I would just use the enable-pre flag to turn off scalar PRE, as it
> will cause the same issue in other cases as well.
> Is there some reason you aren't just doing that?
> I suspect if this is a performance win, that would be as well.
>

Ugh, actually, it should be a win with the following change:


diff --git a/lib/Transforms/Scalar/GVN.cpp b/lib/Transforms/Scalar/GVN.cpp
index 2c47a8a..a3387e3 100644
--- a/lib/Transforms/Scalar/GVN.cpp
+++ b/lib/Transforms/Scalar/GVN.cpp
@@ -1767,7 +1767,7 @@ bool GVN::processNonLocalLoad(LoadInst *LI) {
   }

   // Step 4: Eliminate partial redundancy.
-  if (!EnablePRE || !EnableLoadPRE)
+  if (!EnableLoadPRE)
     return false;

   return PerformLoadPRE(LI, ValuesPerBlock, UnavailableBlocks);




This will disable Scalar PRE without disabling load PRE.


(note, again, however, that load PRE can create exactly the same GEP
situation you are referring to)



More information about the llvm-dev mailing list