aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/CodeGen.cpp
diff options
context:
space:
mode:
authorMatthias Gehre <matthias.gehre@xilinx.com>2022-05-25 12:19:28 +0100
committerMatthias Gehre <matthias.gehre@xilinx.com>2022-08-26 11:55:15 +0100
commit3e39b271016837425038e55e57c39e5e9b289975 (patch)
tree563ef8f9c60d80ba2e186b8fce4d046f9c17f81c /llvm/lib/CodeGen/CodeGen.cpp
parentbb26ebb4d18c1877cc6fd17aa803609abeb95096 (diff)
downloadllvm-3e39b271016837425038e55e57c39e5e9b289975.zip
llvm-3e39b271016837425038e55e57c39e5e9b289975.tar.gz
llvm-3e39b271016837425038e55e57c39e5e9b289975.tar.bz2
[llvm/CodeGen] Add ExpandLargeDivRem pass
Adds a pass ExpandLargeDivRem to expand div/rem instructions with more than 128 bits into a loop computing that value. As discussed on https://reviews.llvm.org/D120327, this approach has the advantage that it is independent of the runtime library. This also helps the clang driver, which otherwise would need to understand enough about the runtime library to know whether to allow _BitInts with more than 128 bits. Targets are still free to disable this pass and instead provide a faster implementation in a runtime library. Fixes https://github.com/llvm/llvm-project/issues/44994 Differential Revision: https://reviews.llvm.org/D126644
Diffstat (limited to 'llvm/lib/CodeGen/CodeGen.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGen.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGen.cpp b/llvm/lib/CodeGen/CodeGen.cpp
index 5050395..219032e 100644
--- a/llvm/lib/CodeGen/CodeGen.cpp
+++ b/llvm/lib/CodeGen/CodeGen.cpp
@@ -36,6 +36,7 @@ void llvm::initializeCodeGen(PassRegistry &Registry) {
initializeEarlyIfPredicatorPass(Registry);
initializeEarlyMachineLICMPass(Registry);
initializeEarlyTailDuplicatePass(Registry);
+ initializeExpandLargeDivRemLegacyPassPass(Registry);
initializeExpandMemCmpPassPass(Registry);
initializeExpandPostRAPass(Registry);
initializeFEntryInserterPass(Registry);