[all-commits] [llvm/llvm-project] b774f1: [DAG] Calculate the number of sign bits for consta...

David Green via All-commits all-commits at lists.llvm.org
Sun May 7 14:31:24 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b774f14841a295187c9f77545b70b60b6f1b3351
      https://github.com/llvm/llvm-project/commit/b774f14841a295187c9f77545b70b60b6f1b3351
  Author: David Green <david.green at arm.com>
  Date:   2023-05-07 (Sun, 07 May 2023)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/test/CodeGen/AArch64/dag-combine-setcc.ll

  Log Message:
  -----------
  [DAG] Calculate the number of sign bits for constant BUILD_VECTOR directly.

For constant BUILD_VECTORs the operands need to be legal types. This can mean
that when the number of sign bits is calculated it may look that the entire
constant and inefficiently produce less sign bits than it could. For example i8
vectors could use i32 elements, for which 0x000000ff would be incorrectly
limited to 1 sign bit as the original value has 24 sign bits. This makes it
look at the constant directly, truncated to the correct type for the element so
that it can correctly return 8.

Differential Revision: https://reviews.llvm.org/D149956




More information about the All-commits mailing list