[RISCV] Create new build vector instead of relying on getNode constan… (#67944)
…t folding. We want to create a build_vector with narrower elements here. Normally getNode on the ISD::TRUNCATE will constant fold this to a new BUILD_VECTOR. If it doesn't constant fold, we end up with a cycle in the DAG because we truncate the node we are replacing. Constant folding can fail if one of the elements is an opaque constant. The failing case I saw involved an opaque constant created by a memset that was expanded. Not sure exactly what happened after that. This patch creates a new BUILD_VECTOR with the new type directly.
parent
c2fd3ebe
Please register or sign in to comment