diff options
author | Nikita Popov <npopov@redhat.com> | 2023-02-27 15:23:01 +0100 |
---|---|---|
committer | Nikita Popov <npopov@redhat.com> | 2023-03-01 15:33:45 +0100 |
commit | ddccc5ba4479a36dd4821f0948e118438fbf2e56 (patch) | |
tree | 13b5db75775d330cef63febfdcba09bcf246a0b4 /llvm/lib/CodeGen/TargetLoweringBase.cpp | |
parent | 9d0703a6461b4e84113951ea444da7099fe4b646 (diff) | |
download | llvm-ddccc5ba4479a36dd4821f0948e118438fbf2e56.zip llvm-ddccc5ba4479a36dd4821f0948e118438fbf2e56.tar.gz llvm-ddccc5ba4479a36dd4821f0948e118438fbf2e56.tar.bz2 |
[CodeGen] Always expand division larger than i128
Default MaxDivRemBitWidthSupported to 128, so that divisions larger
than 128 bits are always expanded, without requiring additional
configuration from the target.
Note that this may still emit calls to __udivti3 on 32-bit targets,
which likely don't have an implementation of that builtin. However,
I believe this is sufficient to fix
https://github.com/llvm/llvm-project/issues/60531, because Zig must
already be defining those builtins.
Differential Revision: https://reviews.llvm.org/D144871
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringBase.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringBase.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringBase.cpp b/llvm/lib/CodeGen/TargetLoweringBase.cpp index 1ff8840..ac27168 100644 --- a/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -724,7 +724,9 @@ TargetLoweringBase::TargetLoweringBase(const TargetMachine &tm) : TM(tm) { // with the Target-specific changes necessary. MaxAtomicSizeInBitsSupported = 1024; - MaxDivRemBitWidthSupported = llvm::IntegerType::MAX_INT_BITS; + // Assume that even with libcalls, no target supports wider than 128 bit + // division. + MaxDivRemBitWidthSupported = 128; MaxLargeFPConvertBitWidthSupported = llvm::IntegerType::MAX_INT_BITS; |