[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
Loading
Please sign in to comment