[PATCH] D144563: [SimplifyCFG] Improve the precision of `PtrValueMayBeModified`

DianQK via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 21:41:37 PST 2023


DianQK added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:7133-7135
+          if (!(GEP->isInBounds() &&
+                !NullPointerIsDefined(GEP->getFunction(),
+                                      GEP->getPointerAddressSpace()))) {
----------------
StephenFan wrote:
> This condition equivalent to 
> ```
>           if (!GEP->isInBounds() ||
>                 NullPointerIsDefined(GEP->getFunction(),
>                                       GEP->getPointerAddressSpace())) {
> ```
> which repeats the above if statement.
Thank you so much, you saved me.
I was getting wrapped up in this pile of if branches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D144563



More information about the llvm-commits mailing list