[PATCH] D87691: [EarlyCSE] Small refactoring changes, NFC

Krzysztof Parzyszek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 08:03:15 PDT 2020


kparzysz marked 2 inline comments as done.
kparzysz added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/EarlyCSE.cpp:1294
       LoadValue InVal = AvailableLoads.lookup(MemInst.getPointerOperand());
       if (InVal.DefInst &&
+          InVal.DefInst == getMatchingValue(InVal, MemInst, CurrentGeneration,
----------------
efriedma wrote:
> Unnecessary `InVal.DefInst &&`?
The lookup can return an "empty" `LoadValue`, one that has `DefInst` set to `nullptr`.  In that case, `getMatchingValue` will also return `nullptr`, so we need this check.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87691



More information about the llvm-commits mailing list