llvm-project/llvm/lib
Craig Topper 6f7de819b9 [RISCV] Use MULHU for more division by constant cases.
D113805 improved handling of i32 divu/remu on RV64. The basic idea
from that can be extended to (mul (and X, C2), C1) where C2 is any
mask constant.

We can replace the and with an SLLI by shifting by the number of
leading zeros in C2 if we also shift C1 left by XLen - lzcnt(C1)
bits. This will give the full product XLen additional trailing zeros,
putting the result in the output of MULHU. If we can't use ANDI,
ZEXT.H, or ZEXT.W, this will avoid materializing C2 in a register.

The downside is it make take 1 additional instruction to create C1.
But since that's not on the critical path, it can hopefully be
interleaved with other operations.

The previous tablegen pattern is replaced by custom isel code.

Reviewed By: asb

Differential Revision: https://reviews.llvm.org/D115310
2021-12-09 09:10:14 -08:00
..
Analysis [NFC] Replace some deprecated getAlignment() calls with getAlign() 2021-12-09 08:43:19 -08:00
AsmParser [IR] Split vscale_range interface 2021-12-07 10:38:26 +00:00
BinaryFormat [llvm][clang][NFC] updates inline licence info 2021-08-11 02:48:53 +00:00
Bitcode [llvm] Use range-based for loops (NFC) 2021-12-05 08:33:02 -08:00
Bitstream
CodeGen [NFC] Replace some deprecated getAlignment() calls with getAlign() 2021-12-09 08:43:19 -08:00
DWARFLinker [llvm] Use range-based for loops (NFC) 2021-12-07 09:17:03 -08:00
DWP
DebugInfo [llvm] Use range-based for loops (NFC) 2021-12-08 20:35:39 -08:00
Debuginfod [Support] [Debuginfod] Use libcurl imported library. 2021-12-09 01:35:01 +00:00
Demangle [Demangle] Add support for D function-local parent symbols 2021-12-07 01:46:13 +00:00
ExecutionEngine [llvm] Add null-termination capability to SmallVectorMemoryBuffer 2021-12-09 11:32:13 +01:00
Extensions
FileCheck [llvm] Use StringRef::contains (NFC) 2021-10-23 08:45:27 -07:00
Frontend [MLIR][OpenMP] Added omp.atomic.update 2021-12-09 15:21:24 +05:30
FuzzMutate
Fuzzer
IR [NFC] Replace some deprecated getAlignment() calls with getAlign() 2021-12-09 08:43:19 -08:00
IRReader
InterfaceStub [LLVM][NFC]Inclusive language: remove occurances of sanity check/test from llvm 2021-11-24 17:29:55 -05:00
LTO [llvm] Add null-termination capability to SmallVectorMemoryBuffer 2021-12-09 11:32:13 +01:00
LineEditor
Linker [NFC] Replace some deprecated getAlignment() calls with getAlign() 2021-12-09 08:43:19 -08:00
MC [macho] add support for emitting macho files with two build version load commands 2021-12-07 18:17:47 -08:00
MCA [LLVM][NFC]Inclusive language: remove occurances of sanity check/test from llvm 2021-11-24 17:29:55 -05:00
Object [llvm] Add null-termination capability to SmallVectorMemoryBuffer 2021-12-09 11:32:13 +01:00
ObjectYAML [llvm-readobj] Add support for machine-independent NetBSD ELF core notes. 2021-12-02 12:10:17 +01:00
Option [llvm] Use range-based for loops (NFC) 2021-12-02 09:27:47 -08:00
Passes [NewPM] Port FlattenCFGPass to NPM 2021-12-09 07:55:02 +00:00
ProfileData [memprof] Align each rawprofile section to 8b. 2021-11-30 20:12:43 -08:00
Remarks
Support Support: Avoid using SmallVector::set_size() in zlib 2021-12-08 16:22:37 -08:00
TableGen [llvm] Use range-based for loops (NFC) 2021-11-28 18:14:49 -08:00
Target [RISCV] Use MULHU for more division by constant cases. 2021-12-09 09:10:14 -08:00
Testing
TextAPI [llvm] Use drop_begin (NFC) 2021-09-16 08:46:26 -07:00
ToolDrivers [Type] Avoid APFloat.h include (NFC) 2021-10-09 11:29:26 +02:00
Transforms [NFC] Replace some deprecated getAlignment() calls with getAlign() 2021-12-09 08:43:19 -08:00
WindowsManifest Make WindowsManifestMerger::merge() take a MemoryBufferRef 2021-08-24 16:39:20 -04:00
XRay Support: Use Expected<T>::moveInto() in a few places 2021-10-22 12:40:10 -07:00
CMakeLists.txt [llvm] [Debuginfo] Debuginfod client library. 2021-12-06 21:52:38 +00:00