Unverified Commit 8f4ffbba authored by Craig Topper's avatar Craig Topper Committed by GitHub
Browse files

[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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment