[SCCP] Fix conversion of range to constant for vectors (PR63380)
authorNikita Popov <npopov@redhat.com>
Mon, 19 Jun 2023 10:27:46 +0000 (12:27 +0200)
committerNikita Popov <npopov@redhat.com>
Mon, 19 Jun 2023 10:29:44 +0000 (12:29 +0200)
commit664b7a4cd51d9273888e79688f64cc8bbcbdbe25
tree56fc551115d6b1319e5f7691ac6d673e9e38d21a
parent6947db2778e0f4799f5311bc80fe7963aa8409c6
[SCCP] Fix conversion of range to constant for vectors (PR63380)

The ConstantRange specifies the range of the scalar elements in the
vector. When converting into a Constant, we need to create a vector
splat with the correct type. For that purpose, pass in the expected
type for the constant.

Fixes https://github.com/llvm/llvm-project/issues/63380.
llvm/include/llvm/Transforms/Utils/SCCPSolver.h
llvm/lib/Transforms/Utils/SCCPSolver.cpp
llvm/test/Transforms/SCCP/intrinsics.ll