[PATCH] D44160: [GVN] Don't use the eliminated load as an available value in phi construction

John Brawn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 6 04:54:55 PDT 2018


john.brawn added inline comments.


================
Comment at: lib/Transforms/Scalar/GVN.cpp:769
 
+    // If the value is the load that we will be eliminating, and the block it's
+    // available in is the block that the load is in, then don't add it as
----------------
reames wrote:
> Don't you need to add the original LI to the SSA updater at least once?  Starting at the original block?
There's no inherent need to do that, I'm pretty sure. Adding LI to the SSA updater really means adding the value that LI will be replaced with, which is exactly what the SSA updater is itself deciding. So adding LI as available value in the block it's in is like saying "the value in this block is the value that's going to be in this block", and the SSA updater already knows that.


Repository:
  rL LLVM

https://reviews.llvm.org/D44160





More information about the llvm-commits mailing list