[PATCH] D133332: [MemorySSA] Simplify if condition

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 5 18:53:44 PDT 2022


StephenFan created this revision.
StephenFan added reviewers: nikic, asbirlea, fhahn.
Herald added a subscriber: george.burgess.iv.
Herald added a project: All.
StephenFan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D133332

Files:
  llvm/include/llvm/Analysis/MemorySSA.h


Index: llvm/include/llvm/Analysis/MemorySSA.h
===================================================================
--- llvm/include/llvm/Analysis/MemorySSA.h
+++ llvm/include/llvm/Analysis/MemorySSA.h
@@ -1252,8 +1252,7 @@
       // to unknown guarantees that any memory accesses that access locations
       // after the pointer are considered as clobbers, which is important to
       // catch loop carried dependences.
-      if (Location.Ptr &&
-          !IsGuaranteedLoopInvariant(const_cast<Value *>(Location.Ptr)))
+      if (!IsGuaranteedLoopInvariant(const_cast<Value *>(Location.Ptr)))
         CurrentPair.second =
             Location.getWithNewSize(LocationSize::beforeOrAfterPointer());
       PHITransAddr Translator(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D133332.458075.patch
Type: text/x-patch
Size: 734 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220906/7793662f/attachment.bin>


More information about the llvm-commits mailing list