llvm-project/llvm/lib
Craig Topper 8983db15a3 [RISCV] Optimize (brcond (seteq (and X, 1 << C), 0))
If C > 10, this will require a constant to be materialized for the
And. To avoid this, we can shift X left by XLen-1-C bits to put the
tested bit in the MSB, then we can do a signed compare with 0 to
determine if the MSB is 0 or 1. Thanks to @reames for the suggestion.

I've implemented this inside of translateSetCCForBranch which is
called when setcc+brcond or setcc+select is converted to br_cc or
select_cc during lowering. It doesn't make sense to do this for
general setcc since we lack a sgez instruction.

I've tested bit 10, 11, 31, 32, 63 and a couple bits betwen 11 and 31
and between 32 and 63 for both i32 and i64 where applicable. Select
has some deficiencies where we receive (and (srl X, C), 1) instead.
This doesn't happen for br_cc due to the call to rebuildSetCC in the
generic DAGCombiner for brcond. I'll explore improving select in a
future patch.

Reviewed By: reames

Differential Revision: https://reviews.llvm.org/D130203
2022-07-20 18:40:49 -07:00
..
Analysis [ThinLTO] Support aliased GlobalIFunc 2022-07-20 15:30:38 -07:00
AsmParser Remove 'no_sanitize_memtag'. Add 'sanitize_memtag'. 2022-07-13 08:54:41 -07:00
BinaryFormat [AMDGPU] Add the uses_dynamic_stack field to the kernel descriptor and the kernel metadata map 2022-07-18 10:07:13 +05:30
Bitcode [ThinLTO] Support aliased GlobalIFunc 2022-07-20 15:30:38 -07:00
Bitstream
CodeGen [DAG] getNode - don't bother creating ADDO(X,0) or SUBO(X,0) nodes. 2022-07-20 12:04:33 +01:00
DWARFLinker [Reland][Debuginfo][llvm-dwarfutil] llvm-dwarfutil dsymutil-like tool for ELF. 2022-07-19 15:11:36 +03:00
DWP [llvm-dwp] Add SHF_COMPRESSED support and remove .zdebug support 2022-07-14 16:19:32 -07:00
DebugInfo Remove unused forward declarations (NFC) 2022-07-17 15:37:48 -07:00
Debuginfod [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
Demangle [MicrosoftDemangle] Set error to true when returning nullptr. 2022-06-08 17:18:09 -07:00
ExecutionEngine [ORC] Add a new MemoryMapper-based JITLinkMemoryManager implementation. 2022-07-20 17:52:37 -07:00
Extensions
FileCheck [FileCheck] Catch missspelled directives. 2022-05-26 11:37:19 +01:00
Frontend [OpenMP][IRBuilder] Add support for taskgroup 2022-07-19 10:49:34 +05:30
FuzzMutate Reland "[FuzzMutate] Split out FuzzerCLI library that doesn't depend on IR." 2022-05-07 13:49:54 +02:00
Fuzzer
IR [MemProf] Basic metadata support and verification 2022-07-20 15:30:55 -07:00
IRReader
InterfaceStub [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
LTO [LTO][ELF] Add selective --save-temps= option 2022-07-06 10:06:18 -07:00
LineEditor [llvm][lldb] use FindLibEdit.cmake everywhere 2022-05-12 15:59:41 -07:00
Linker [IR] Allow absence for Min module flags and make AArch64 BTI/PAC-RET flags backward compatible 2022-07-18 09:35:12 -07:00
MC [XCOFF] write the aux header when the visibility is specified in XCOFF32. 2022-07-20 07:09:34 -04:00
MCA [MCA] Allow mca::Instruction-s to be recycled and reused 2022-06-24 15:39:51 -07:00
ObjCopy [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
Object [AIX] support read global symbol of big archive 2022-07-18 10:43:30 -04:00
ObjectYAML [llvm] Use value instead of getValue (NFC) 2022-07-13 23:11:56 -07:00
Option
Passes [NewPM] Print function/SCC size with -debug-pass-manager 2022-07-19 09:00:37 -07:00
ProfileData [PGO] Report number of counts being dropped when a hash-mismatch happens 2022-07-15 14:53:59 -07:00
Remarks Don't use Optional::hasValue (NFC) 2022-06-20 20:05:16 -07:00
Support Use llvm::is_contained (NFC) 2022-07-20 09:09:19 -07:00
TableGen [TableGen] Add a location for a class definition that was forward-declared 2022-07-20 15:56:17 +02:00
Target [RISCV] Optimize (brcond (seteq (and X, 1 << C), 0)) 2022-07-20 18:40:49 -07:00
Testing [llvm] Use value_or instead of getValueOr (NFC) 2022-06-18 23:07:11 -07:00
TextAPI
ToolDrivers [llvm-lib] Ignore /NODEFAULTLIB flag 2022-07-05 10:27:50 -07:00
Transforms [Attributor] Deal with complex PHI nodes better during AAPointerInfo 2022-07-20 17:34:50 -05:00
WindowsDriver [llvm] Don't use Optional::hasValue (NFC) 2022-06-25 21:42:52 -07:00
WindowsManifest [llvm] Fix typo for libxml2 detection 2022-05-17 08:45:31 +00:00
XRay
CMakeLists.txt