[llvm] [AMDGPU] Promote uniform ops to I32 in DAGISel (PR #106383)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 2 06:01:40 PDT 2024


================
@@ -15118,9 +15118,11 @@ SDValue DAGCombiner::visitTRUNCATE(SDNode *N) {
   }
 
   // trunc (select c, a, b) -> select c, (trunc a), (trunc b)
-  if (N0.getOpcode() == ISD::SELECT && N0.hasOneUse()) {
-    if ((!LegalOperations || TLI.isOperationLegal(ISD::SELECT, SrcVT)) &&
-        TLI.isTruncateFree(SrcVT, VT)) {
+  if (N0.getOpcode() == ISD::SELECT && N0.hasOneUse() &&
+      TLI.isTruncateFree(SrcVT, VT)) {
+    if (!LegalOperations ||
+        (TLI.isOperationLegal(ISD::SELECT, SrcVT) &&
+         TLI.isNarrowingProfitable(N0.getNode(), N0.getValueType(), VT))) {
----------------
jayfoad wrote:

```suggestion
         TLI.isNarrowingProfitable(N0.getNode(), SrcVT, VT))) {
```

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


More information about the llvm-commits mailing list