[PATCH] D44160: [GVN] Detect fully redundant loads when we have more than one available value

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 22 06:25:02 PDT 2018


john.brawn added inline comments.


================
Comment at: lib/Transforms/Scalar/GVN.cpp:786
       continue;
 
     SSAUpdate.AddAvailableValue(BB, AV.MaterializeAdjustedValue(LI, gvn));
----------------
reames wrote:
> Maybe I'm missing something, but couldn't we get the same effect you're looking for by adding the check for LI as our AV into this loop?  This would have the effect of telling the SSAUpdator about only one def in your example which should avoid the need for any phi creation.
> 
> Then there's no concern about change in O() since this loop is already O(ValuesPerBloc).  
> 
> To be clear, I don't really care about the side effect of "fixing" AA, but reducing redundant IR always seems like a win since it's likely to let the rest of the GVN run be more effective.  
I hadn't realised that SSAUpdater would work if you did that, but from some testing it looks like that does work. I'll update this patch to do that. It doesn't solve the problem entirely in more complicated cases though, which will need better alias analysis (which I'll continue working on).


Repository:
  rL LLVM

https://reviews.llvm.org/D44160





More information about the llvm-commits mailing list