[RISCV] Improve type promotion for i32 clmulr/clmulh on RV64.
authorCraig Topper <craig.topper@sifive.com>
Tue, 18 Jul 2023 17:39:25 +0000 (10:39 -0700)
committerCraig Topper <craig.topper@sifive.com>
Tue, 18 Jul 2023 17:39:25 +0000 (10:39 -0700)
commitea3683e98f107622ce54fa3d4c1457f4d597f808
tree7dd56caaedeb82fc3b364455526709610ec3a436
parentd7eb9240c0dd4f67f12116e8af4918261e0391b1
[RISCV] Improve type promotion for i32 clmulr/clmulh on RV64.

Instead of zero extending the inputs by masking. We can shift them
left instead. This is cheaper when we don't zext.w instruction.

This does make the case where the inputs are already zero extended
or freely zero extendable worse though.

Reviewed By: wangpc

Differential Revision: https://reviews.llvm.org/D155530
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/rv64zbc-intrinsic.ll
llvm/test/CodeGen/RISCV/rv64zbc-zbkc-intrinsic.ll