[llvm] [Clang][HLSL] prevent phi codgen of isTokenLike types (PR #162363)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 7 19:49:48 PDT 2025


farzonl wrote:

> The change looks good to me and it successfully compiles the reduced shader I sent you over Teams. However, the original DML shaders are still having the same issue - hitting the same assertion. So this PR does not completely fix the issue.
> 
> I will send you some more shaders to test and debug.

I have a fix, but I'm still trying to work out a minified reproductions. llvm-reduce is getting stuck in an infinite loop.
```diff
diff --git a/llvm/lib/Transforms/Scalar/GVN.cpp b/llvm/lib/Transforms/Scalar/GVN.cpp
index 0fa99eb375a4..995fd1458598 100644
--- a/llvm/lib/Transforms/Scalar/GVN.cpp
+++ b/llvm/lib/Transforms/Scalar/GVN.cpp
@@ -2003,6 +2006,9 @@ bool GVNPass::processNonLocalLoad(LoadInst *Load) {
       Load->getParent()->getParent()->hasFnAttribute(
           Attribute::SanitizeHWAddress))
     return false;
+  
+  if (Load->getType()->isTokenLikeTy())
+    return false;
 
   // Step 1: Find the non-local dependencies of the load.
   LoadDepVect Deps;
```

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


More information about the llvm-commits mailing list