[PATCH] D100470: [LICM][NFC] Fix typo

Marcythm via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 14 17:05:08 PDT 2021


Marcythm added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:561
 
-      // If the instruction is dead, we would try to sink it because it isn't
+      // If the instruction is dead, we wouldn't try to sink it because it isn't
       // used in the loop, instead, just delete it.
----------------
nikic wrote:
> Marcythm wrote:
> > I'm not sure if this is right, but I think it should be closer to what the author wants to express.
> I don't think the new wording is right: What this is saying is that without this check, the instruction would be sunk, which is legal but pointless. Instead it is completely removed here.
Oh sorry, I read it again and think you are right. Since I’m not a native English speaker, I have some misunderstandings about the comments. Sorry again.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:1352
               if (auto *LI = dyn_cast<LoadInst>(MD->getMemoryInst())) {
-                (void)LI; // Silence warning.
                 assert(!LI->isUnordered() && "Expected unordered load");
----------------
asbirlea wrote:
> Why is this removed?
I think that the variable `LI` is used in the following assertion so there won't be an unused-variable warning.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D100470/new/

https://reviews.llvm.org/D100470



More information about the llvm-commits mailing list