llvm-project/llvm/lib
Alex Richardson 11448eeb72 [NFC] Use SelectionDAG::getMemBasePlusOffset() instead of getNode(ISD::ADD)
Summary:
To find potential opportunities to use getMemBasePlusOffset() I looked at
all ISD::ADD uses found with the regex getNode\(ISD::ADD,.+,.+Ptr
in lib/CodeGen/SelectionDAG. If this patch is accepted I will convert
the files in the individual backends too.

The motivation for this change is our out-of-tree CHERI backend
(https://github.com/CTSRD-CHERI/llvm-project). We use a separate register
type to store pointers (128-bit capabilities, which are effectively
unforgeable and monotonic fat pointers). These capabilities permit a
reduced set of operations and therefore use a separate ValueType (iFATPTR).
to represent pointers implemented as capabilities.
Therefore, we need to avoid using ISD::ADD for our patterns that operate
on pointers and need to use a function that chooses ISD::ADD or a new
ISD::PTRADD opcode depending on the value type.

We originally added a new DAG.getPointerAdd() function, but after this
patch series we can modify the implementation of getMemBasePlusOffset()
instead. Avoiding direct uses of ISD::ADD for pointer types will
significantly reduce the amount of assertion/instruction selection
failures for us in future upstream merges.

Reviewers: spatel

Reviewed By: spatel

Subscribers: merge_guards_bot, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71207
2019-12-13 21:40:03 +00:00
..
Analysis Revert "[VectorUtils] Introduce the Vector Function Database (VFDatabase)." 2019-12-13 19:42:04 +00:00
AsmParser [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
BinaryFormat [AIX] Emit TOC entries for ASM printing 2019-11-27 17:20:55 -05:00
Bitcode [LTO] Support for embedding bitcode section during LTO 2019-12-12 12:34:19 -08:00
Bitstream [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CodeGen [NFC] Use SelectionDAG::getMemBasePlusOffset() instead of getNode(ISD::ADD) 2019-12-13 21:40:03 +00:00
DebugInfo [llvm-dwarfdump] Add blank line after printing line table 2019-12-12 14:06:10 +00:00
Demangle Revert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)" 2019-12-04 11:10:07 -08:00
ExecutionEngine [ORC] Remove the automagic Main JITDylib fram ExecutionSession. 2019-12-05 01:36:49 -08:00
Frontend [OpenMP] Introduce the OpenMP-IR-Builder 2019-12-11 14:38:49 -06:00
FuzzMutate [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Fuzzer
IR Reland [DataLayout] Fix occurrences that size and range of pointers are assumed to be the same. 2019-12-13 14:30:21 +00:00
IRReader [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
LTO Revert an accidental commit af5ca40b47 2019-12-13 15:17:40 +09:00
LineEditor [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Linker [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
MC [WebAssembly] Add new `export_name` clang attribute for controlling wasm export names 2019-12-11 11:54:57 -08:00
MCA [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Object [WebAssembly] Add new `export_name` clang attribute for controlling wasm export names 2019-12-11 11:54:57 -08:00
ObjectYAML [yaml2obj] - Add a way to override sh_flags section field. 2019-12-13 11:54:37 +03:00
Option [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Passes [Matrix] Add first set of matrix intrinsics and initial lowering pass. 2019-12-12 15:42:18 +00:00
ProfileData Revert "[Coverage] Revise format to reduce binary size" 2019-12-04 10:35:14 -08:00
Remarks [Remarks] Allow empty temporary remark files 2019-11-22 15:58:12 -08:00
Support [Support] Try to fix bot failure after 8ddcd1dc26 2019-12-12 12:20:11 +00:00
TableGen [TableGen] Add bang-operators !getop and !setop. 2019-12-11 12:05:22 +00:00
Target [RISCV] Move DebugLoc Copy into CompressInstEmitter 2019-12-13 20:01:04 +00:00
Testing [Testing] Move clangd::Annotations to llvm testing support 2019-04-25 10:08:31 +00:00
TextAPI [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
ToolDrivers [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Transforms Revert "[VectorUtils] Introduce the Vector Function Database (VFDatabase)." 2019-12-13 19:42:04 +00:00
WindowsManifest Revert "Temporarily revert "build: avoid hardcoding the libxml2 library name"" 2019-12-03 09:27:14 -08:00
XRay [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CMakeLists.txt [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00
LLVMBuild.txt [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h 2019-12-10 00:10:09 -06:00