[llvm] [DAG] shouldReduceLoadWidth - hasOneUse should check just the loaded value - not the chain (PR #128167)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 04:10:18 PST 2025


================
@@ -1817,7 +1817,7 @@ class TargetLoweringBase {
                                      EVT NewVT) const {
     // By default, assume that it is cheaper to extract a subvector from a wide
     // vector load rather than creating multiple narrow vector loads.
-    if (NewVT.isVector() && !Load->hasOneUse())
+    if (NewVT.isVector() && !Load->hasNUsesOfValue(1, 0))
----------------
arsenm wrote:

```suggestion
    if (NewVT.isVector() && !SDValue(Load, 0).hasOneUse())
```
?

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


More information about the llvm-commits mailing list