aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/StringRef.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2023-05-12 09:06:07 -0700
committerCraig Topper <craig.topper@sifive.com>2023-05-12 09:06:17 -0700
commita983ef2c1743d8c8240b83ab307d7adcbaa73693 (patch)
tree166e64141c69f2d706f12208f9e24a15bee63807 /llvm/lib/Support/StringRef.cpp
parent2da29955fbc9753e7f0d565d64cc859492ab6afb (diff)
downloadllvm-a983ef2c1743d8c8240b83ab307d7adcbaa73693.zip
llvm-a983ef2c1743d8c8240b83ab307d7adcbaa73693.tar.gz
llvm-a983ef2c1743d8c8240b83ab307d7adcbaa73693.tar.bz2
[DAGCombiner][AArch64][VE] Teach BuildUDIV/SDIV to use 2x mul when mulh/mul_lohi are not available.
Correct the legality of i32 mul_lohi on AArch64. Previously, AArch64 incorrectly reported i32 mul_lohi as Legal. This allowed BuildUDIV/SDIV to use them. A later DAGCombiner would replace them with MULHS/MULHU because only the high half was used. This conversion does not check the legality of MULHS/MULHU under the assumption that LegalizeDAG can turn it back into MUL_LOHI later. After they are converted to MULHS/MULHU, DAGCombine ran and saw that these operations aren't supported but an i64 MUL is. So they get converted to that plus a shift. Without this, LegalizeDAG would convert back MUL_LOHI and isel would fail to find a pattern. This patch teaches BuildUDIV/SDIV to create the wide mul and shift so that we can report the correct operation legality on AArch64. It also enables div by constant folding for more cases on VE. I don't know if VE wants this div by constant optimization or not. If they don't want it, they can use the isIntDivCheap hook to disable it. Reviewed By: RKSimon Differential Revision: https://reviews.llvm.org/D150333
Diffstat (limited to 'llvm/lib/Support/StringRef.cpp')
0 files changed, 0 insertions, 0 deletions