[Arch64][SelectionDAG] Add target-specific implementation of srem
authorchenglin.bi <chenglin.bi@cixcomputing.com>
Sat, 16 Apr 2022 04:29:11 +0000 (12:29 +0800)
committerchenglin.bi <chenglin.bi@cixcomputing.com>
Sat, 16 Apr 2022 04:29:11 +0000 (12:29 +0800)
commit9d9eddd3dde46751a5c415b7e5e475b4feb76600
tree601774cd2cd9d2d0aae0b21b39b4dc3812855cf8
parent3ff17b053ee58fff7ce9bebfd1801caa8d6def8d
[Arch64][SelectionDAG] Add target-specific implementation of srem

X%C to the equivalent of X-X/C*C is not always fastest path if there is no SDIV pair exist. So check target have faster for srem only first. Add AArch64 faster path for SREM only pow2 case.

Fix https://github.com/llvm/llvm-project/issues/54649

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D122968
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/lib/Target/AArch64/AArch64ISelLowering.h
llvm/test/CodeGen/AArch64/srem-pow2.ll
llvm/test/CodeGen/AArch64/srem-seteq.ll
llvm/test/CodeGen/AArch64/srem-vector-lkk.ll