[all-commits] [llvm/llvm-project] 8f4ffb: [RISCV] Create new build vector instead of relying...

Craig Topper via All-commits all-commits at lists.llvm.org
Mon Oct 2 09:13:48 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8f4ffbbaf7ba6bde6f3f2731669b28b1c9a46505
      https://github.com/llvm/llvm-project/commit/8f4ffbbaf7ba6bde6f3f2731669b28b1c9a46505
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2023-10-02 (Mon, 02 Oct 2023)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp

  Log Message:
  -----------
  [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.




More information about the All-commits mailing list