[llvm] [DAG] Add a one-use check to concat -> scalar_to_vector fold. (PR #79510)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 26 00:32:24 PST 2024


================
@@ -23842,7 +23842,7 @@ SDValue DAGCombiner::visitCONCAT_VECTORS(SDNode *N) {
     }
 
     // concat_vectors(scalar, undef) -> scalar_to_vector(scalar)
-    if (!Scalar.getValueType().isVector()) {
+    if (!Scalar.getValueType().isVector() && In.hasOneUse()) {
----------------
arsenm wrote:

Scalar.hasOneUse? Also all of these combines seem to be checking one use, should the conditions be merged?

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


More information about the llvm-commits mailing list