[PATCH] D150266: [AMDGPU] Improve PHI-breaking heuristics in CGP

Juan Manuel Martinez CaamaƱo via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 07:01:19 PDT 2023


jmmartinez added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp:1472-1473
+
+  // This function may recurse, so to guard against infinite looping, this PHI
+  // is conservatively considered unbreakable until we reach a conclusion.
+  bool &Result = BreakPhiNodesCache[&I];
----------------
Have you considered using an enum with three states (`enum CanBreakPHI { OnHold, CanBreak, Unbreakable }`) instead of a boolean? In that case, we would be able to break phi-nodes that currently we can't.

I have no idea if that would be interesting though.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150266



More information about the llvm-commits mailing list