[PATCH] D153942: [NFC]Fix possibly derefer nullptr in ComplexDeinterleavingPass.cpp

Igor Kirillov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 28 02:00:18 PDT 2023


igor.kirillov added inline comments.


================
Comment at: llvm/lib/CodeGen/ComplexDeinterleavingPass.cpp:1039
     FinalNode = identifyMultiplications(RealMuls, ImagMuls, FinalNode);
-    if (!FinalNode)
-      return nullptr;
----------------
If there are **Muls** and they are not processed, then there is no point to continue analysing Addends. Therefore it is better to have an early exit here.

Also **Collect** function, if it returns true, always would fill either **Addends** or **Muls**. That's why there is no way for the control flow to miss either FinalNode check in the original code. So, FinalNode can't be nullptr by that point


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D153942



More information about the llvm-commits mailing list