Instcombine SDIV to ASRD when the third operand of SDIV is a power of 2
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
To match the equivalent functionality in D113281, can you also add support for signed divides by negative powers or two?
LGTM with a nit.
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp | ||
---|---|---|
1040 | I think this would be better called Divisor. |
Just a couple of things to consider before committing.
llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp | ||
---|---|---|
1034–1035 | FYI: If you use dyn_cast_or_null<ConstantInt>(SplatValue) you can remove this extra check. | |
1044 | You shouldn't need this as the exponent cannot be negative and the intrinsic it's passed to (aarch64_sve_asrd) does not support this operand being negative either. | |
1052 | As above. |
nit. I think the name 'instCombineSVESDiv' would be in keeping with the other functions in this file.