[all-commits] [llvm/llvm-project] 53c81a: [RISCV][SDAG] Fix constant narrowing when narrowin...

Yingwei Zheng via All-commits all-commits at lists.llvm.org
Fri Oct 13 15:38:30 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 53c81a8c165dc3d71eea10ae63daf20e31fc8afa
      https://github.com/llvm/llvm-project/commit/53c81a8c165dc3d71eea10ae63daf20e31fc8afa
  Author: Yingwei Zheng <dtcxzyw2333 at gmail.com>
  Date:   2023-10-14 (Sat, 14 Oct 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    A llvm/test/CodeGen/RISCV/pr68855.ll

  Log Message:
  -----------
  [RISCV][SDAG] Fix constant narrowing when narrowing loads (#69015)

When narrowing logic ops(OR/XOR) with constant rhs, `DAGCombiner` will fixup the constant rhs node.
It is incorrect when lhs is also a constant. For example, we will incorrectly replace `xor OpaqueConstant:i64<8191>, Constant:i64<-1>` with `xor (and OpaqueConstant:i64<8191>, Constant:i64<65535>), Constant:i64<-1>`.

Fixes #68855.




More information about the All-commits mailing list