[llvm] 0b34acd - [NFC] Fix 'Load' name masking.

Daniil Fukalov via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 2 01:10:18 PDT 2021


Author: Daniil Fukalov
Date: 2021-06-02T11:09:53+03:00
New Revision: 0b34acdab718f5302232452fb0c9ca98180794c3

URL: https://github.com/llvm/llvm-project/commit/0b34acdab718f5302232452fb0c9ca98180794c3
DIFF: https://github.com/llvm/llvm-project/commit/0b34acdab718f5302232452fb0c9ca98180794c3.diff

LOG: [NFC] Fix 'Load' name masking.

Reviewed By: mkazantsev

Differential Revision: https://reviews.llvm.org/D103456

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/GVN.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index b4714d9cf11e9..224853083c067 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -894,17 +894,17 @@ Value *AvailableValue::MaterializeAdjustedValue(LoadInst *Load,
                         << "\n\n\n");
     }
   } else if (isCoercedLoadValue()) {
-    LoadInst *Load = getCoercedLoadValue();
-    if (Load->getType() == LoadTy && Offset == 0) {
-      Res = Load;
+    LoadInst *CoercedLoad = getCoercedLoadValue();
+    if (CoercedLoad->getType() == LoadTy && Offset == 0) {
+      Res = CoercedLoad;
     } else {
-      Res = getLoadValueForLoad(Load, Offset, LoadTy, InsertPt, DL);
+      Res = getLoadValueForLoad(CoercedLoad, Offset, LoadTy, InsertPt, DL);
       // We would like to use gvn.markInstructionForDeletion here, but we can't
       // because the load is already memoized into the leader map table that GVN
       // tracks.  It is potentially possible to remove the load from the table,
       // but then there all of the operations based on it would need to be
       // rehashed.  Just leave the dead load around.
-      gvn.getMemDep().removeInstruction(Load);
+      gvn.getMemDep().removeInstruction(CoercedLoad);
       LLVM_DEBUG(dbgs() << "GVN COERCED NONLOCAL LOAD:\nOffset: " << Offset
                         << "  " << *getCoercedLoadValue() << '\n'
                         << *Res << '\n'


        


More information about the llvm-commits mailing list