[llvm] [LLVM][SelectionDAG] Ensure Constant[FP]SDnode only store references to scalar Constant{Int,FP}. (PR #111005)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 10 09:16:46 PDT 2024


================
@@ -1678,6 +1678,7 @@ class ConstantSDNode : public SDNode {
       : SDNode(isTarget ? ISD::TargetConstant : ISD::Constant, 0, DebugLoc(),
                VTs),
         Value(val) {
+    assert(!isa<VectorType>(val->getType()) && "Unexpected vector type!");
----------------
paulwalker-arm wrote:

That's handled as part of `ConstantInt` construction and thus here we can safely assume `val` has a valid type for its class.

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


More information about the llvm-commits mailing list