[llvm] [AMDGPU] SelectionDAG divergence tracking should take into account Target divergency. (PR #144947)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 27 07:00:58 PDT 2025


================
@@ -13600,16 +13606,20 @@ void SelectionDAG::createOperands(SDNode *Node, ArrayRef<SDValue> Vals) {
     Ops[I].setInitial(Vals[I]);
     EVT VT = Ops[I].getValueType();
 
+    // Take care of the Node's operands iif target has divergence
     // Skip Chain. It does not carry divergence.
-    if (VT != MVT::Other &&
+    if (DivergentTarget && VT != MVT::Other &&
----------------
alex-t wrote:

The idea is to avoid `VT != MVT::Other &&
        (VT != MVT::Glue || gluePropagatesDivergence(Ops[I].getNode())) &&
        Ops[I].getNode()->isDivergent()` checks if the target has no divergence.
Does it make sense?

https://github.com/llvm/llvm-project/pull/144947


More information about the llvm-commits mailing list