[llvm] SelectionDAG: Don't pad the source of ADDRSPACECAST if it's legal. (PR #225390)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 07:28:01 PDT 2026


================
@@ -6333,12 +6333,13 @@ SDValue DAGTypeLegalizer::WidenVecRes_ADDRSPACECAST(SDNode *N) {
 
   // The source has the same number of elements as the result, so widen it to
   // match WidenVT. It only lives in the widened-vector map if it is itself
-  // widened; otherwise pad it up to the widened element count.
+  // widened; otherwise pad it up to the widened element count
+  // when it is illegal.
   SDValue InOp = N->getOperand(0);
   EVT InVT = InOp.getValueType();
   if (getTypeAction(InVT) == TargetLowering::TypeWidenVector) {
     InOp = GetWidenedVector(InOp);
-  } else {
+  } else if (getTypeAction(InVT) != TargetLowering::TypeLegal) {
----------------
sujianIBM wrote:

Hello, I fixed the above code and added test. Would you please take another look? Thanks!

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


More information about the llvm-commits mailing list