diff options
author | Yingwei Zheng <dtcxzyw2333@gmail.com> | 2024-05-22 20:20:33 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-22 20:20:33 +0800 |
commit | cf128305bdada3ffb34054813a855d80b3948025 (patch) | |
tree | 046fd6508fe5ddfe36918dddc1869acebe1ad742 /llvm/lib/CodeGen/MachineScheduler.cpp | |
parent | ba0e871db81d8527382a051a0abf1ce2a171d8bf (diff) | |
download | llvm-cf128305bdada3ffb34054813a855d80b3948025.zip llvm-cf128305bdada3ffb34054813a855d80b3948025.tar.gz llvm-cf128305bdada3ffb34054813a855d80b3948025.tar.bz2 |
[SDAG] Don't treat ISD::SHL as a uniform binary operator in `ShrinkDemandedOp` (#92753)
In `TargetLowering::ShrinkDemandedOp`, types of lhs and rhs may differ
before legalization.
In the original case, `VT` is `i64` and `SmallVT` is `i32`, but the type
of rhs is `i8`. Then invalid truncate nodes will be created.
See the description of ISD::SHL for further information:
> After legalization, the type of the shift amount is known to be
TLI.getShiftAmountTy(). Before legalization, the shift amount can be any
type, but care must be taken to ensure it is large enough.
https://github.com/llvm/llvm-project/blob/605ae4e93be8976095c7eedf5c08bfdb9ff71257/llvm/include/llvm/CodeGen/ISDOpcodes.h#L691-L712
This patch stops handling ISD::SHL in `TargetLowering::ShrinkDemandedOp`
and duplicates the logic in `TargetLowering::SimplifyDemandedBits`.
Additionally, it adds some additional checks like
`isNarrowingProfitable` and `isTypeDesirableForOp` to improve the
codegen on AArch64.
Fixes https://github.com/llvm/llvm-project/issues/92720.
Diffstat (limited to 'llvm/lib/CodeGen/MachineScheduler.cpp')
0 files changed, 0 insertions, 0 deletions