[PATCH] D157707: [AMDGPU] Remove assert in canBreakPHINode

Pierre van Houtryve via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 11 05:29:30 PDT 2023


Pierre-vh created this revision.
Pierre-vh added reviewers: AMDGPU, arsenm.
Herald added subscribers: foad, kerbowa, hiraditya, tpr, dstuttard, yaxunl, jvesely, kzhuravl.
Herald added a project: All.
Pierre-vh requested review of this revision.
Herald added subscribers: llvm-commits, wdng.
Herald added a project: LLVM.

I thought this assert couldn't trip but I failed to
account for cases where some instruction gets
deleted and two PHIs suddenly become related.
It seems like its something that can happen
as this assert has been causing build failures in
some projects.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157707

Files:
  llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp


Index: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
===================================================================
--- llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
+++ llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
@@ -1809,14 +1809,6 @@
   SmallPtrSet<const PHINode *, 8> WorkList;
   collectPHINodes(I, WorkList);
 
-#ifndef NDEBUG
-  // Check that none of the PHI nodes in the worklist are in the map. If some of
-  // them are, it means we're not good enough at collecting related PHIs.
-  for (const PHINode *WLP : WorkList) {
-    assert(BreakPhiNodesCache.count(WLP) == 0);
-  }
-#endif
-
   // To consider a PHI profitable to break, we need to see some interesting
   // incoming values. At least 2/3rd (rounded up) of all PHIs in the worklist
   // must have one to consider all PHIs breakable.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157707.549350.patch
Type: text/x-patch
Size: 816 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230811/5829e018/attachment.bin>


More information about the llvm-commits mailing list