llvm-6502/include/llvm/IR
Elena Demikhovsky 8be39c81b0 Masked Gather and Scatter Intrinsics.
Gather and Scatter are new introduced intrinsics, comming after recently implemented masked load and store.
This is the first patch for Gather and Scatter intrinsics. It includes only the syntax, parsing and verification.

Gather and Scatter intrinsics allow to perform multiple memory accesses (read/write) in one vector instruction.
The intrinsics are not target specific and will have the following syntax:
Gather:
declare <16 x i32> @llvm.masked.gather.v16i32(<16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1> <mask>, <16 x i32> <passthru>)
declare <8 x float> @llvm.masked.gather.v8f32(<8 x float*><vector of ptrs>, i32 <alignment>, <8 x i1> <mask>, <8 x float><passthru>)

Scatter:
declare void @llvm.masked.scatter.v8i32(<8 x i32><vector value to be stored> , <8 x i32*><vector of ptrs> , i32 <alignment>, <8 x i1> <mask>)
declare void @llvm.masked.scatter.v16i32(<16 x i32> <vector value to be stored> , <16 x i32*> <vector of ptrs>, i32 <alignment>, <16 x i1><mask> )

Vector of ptrs - a set of source/destination addresses, to load/store the value. 
Mask - switches on/off vector lanes to prevent memory access for switched-off lanes
vector of ptrs, value and mask should have the same vector width.

These are code examples where gather / scatter should be used and will allow function vectorization
;void foo1(int * restrict A, int * restrict B, int * restrict C) {
; for (int i=0; i<SIZE; i++) {
; A[i] = B[C[i]];
; }
;}

;void foo3(int * restrict A, int * restrict B) {
; for (int i=0; i<SIZE; i++) {
; A[B[i]] = i+5;
; }
;}

Tests will come in the following patches, with CodeGen and Vectorizer.

http://reviews.llvm.org/D7433



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228521 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-08 08:27:19 +00:00
..
Argument.h Provide convenient access to the zext/sext attributes of function arguments. NFC. 2014-08-05 05:43:41 +00:00
AssemblyAnnotationWriter.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Attributes.h Revert accidentally committed r217107 2014-09-03 23:38:05 +00:00
AutoUpgrade.h
BasicBlock.h Add a pass for inserting safepoints into (nearly) arbitrary IR 2015-02-04 00:37:33 +00:00
CallingConv.h X86: Implement the vectorcall calling convention 2014-10-28 01:29:26 +00:00
CallSite.h
CFG.h Add range adapters predecessors() and successors() for BBs 2015-02-04 19:14:57 +00:00
CMakeLists.txt
Comdat.h
Constant.h InstCombine: sub nsw %x, C -> add nsw %x, -C if C isn't INT_MIN 2014-08-22 16:41:23 +00:00
ConstantFolder.h
ConstantRange.h fix typos; remove names from comments; NFC 2015-01-09 17:11:51 +00:00
Constants.h Rename END_WITH_NULL to LLVM_END_WITH_NULL and move to Compiler.h 2014-11-04 01:12:21 +00:00
DataLayout.h Add a FIXME about preferred alignment to DataLayout. 2015-01-26 19:19:04 +00:00
DebugInfo.h IR: Split out DebugInfoMetadata.h, NFC 2015-02-02 18:53:21 +00:00
DebugInfoMetadata.h IR: Split out getOperandAs(), NFC 2015-02-05 01:07:47 +00:00
DebugLoc.h [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
DerivedTypes.h Add params() to FunctionType. NFC. 2014-11-21 19:03:35 +00:00
DiagnosticInfo.h Use the DiagnosticHandler to print diagnostics when reading bitcode. 2015-01-10 00:07:30 +00:00
DiagnosticPrinter.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
DIBuilder.h IR: Remove MDNodeFwdDecl 2015-01-19 20:36:39 +00:00
Dominators.h [PM] Port domtree to the new pass manager (at last). 2015-01-14 10:19:28 +00:00
Function.h Revert GCStrategy ownership changes 2015-01-26 18:26:35 +00:00
GetElementPtrTypeIterator.h
GlobalAlias.h
GlobalObject.h Fix broken C++ mode comment 2014-11-05 01:36:22 +00:00
GlobalValue.h [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
GlobalVariable.h
GVMaterializer.h Ask the module for its the identified types. 2014-12-03 07:18:23 +00:00
InlineAsm.h Reapply r215966, r215965, r215964, r215963, r215960, r215959, r215958, and r215957 2014-08-19 16:39:58 +00:00
InstIterator.h Introduce print-memderefs to test isDereferenceablePointer 2015-02-06 01:46:42 +00:00
InstrTypes.h Revert r220349 to re-instate r220277 with a fix for PR21330 -- quite 2014-11-25 08:20:27 +00:00
Instruction.def
Instruction.h Move DebugLocs around instead of copying. 2015-02-07 12:28:15 +00:00
Instructions.h [cleanup] Re-sort all the #include lines in LLVM using 2015-01-14 11:23:27 +00:00
InstVisitor.h
IntrinsicInst.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Intrinsics.h Masked Gather and Scatter Intrinsics. 2015-02-08 08:27:19 +00:00
Intrinsics.td Masked Gather and Scatter Intrinsics. 2015-02-08 08:27:19 +00:00
IntrinsicsAArch64.td
IntrinsicsARM.td ARM: add @llvm.arm.space intrinsic for testing ConstantIslands. 2014-11-13 17:58:48 +00:00
IntrinsicsBPF.td BPF backend 2015-01-24 17:51:26 +00:00
IntrinsicsHexagon.td [Hexagon] Converting XTYPE/SHIFT intrinsics. Cleaning out old intrinsic patterns and updating tests. 2015-02-03 20:40:52 +00:00
IntrinsicsMips.td
IntrinsicsNVVM.td [NVPTX] Make the alignment an explicit argument to ldu/ldg 2014-08-29 15:30:20 +00:00
IntrinsicsPowerPC.td [PowerPC] Add VSX builtins for vec_div 2014-11-14 12:10:40 +00:00
IntrinsicsR600.td R600/SI: Add class intrinsic 2015-01-06 23:00:37 +00:00
IntrinsicsX86.td [X86] Use i8 immediate for comparison type on AVX512 packed integer instructions. This matches floating point equivalents. Includes autoupgrade support to convert old code. 2015-01-25 23:26:02 +00:00
IntrinsicsXCore.td
IRBuilder.h Move DebugLocs around instead of copying. 2015-02-07 12:28:15 +00:00
IRPrintingPasses.h [PM] Switch the new pass manager to use a reference-based API for IR 2015-01-05 02:47:05 +00:00
LegacyPassManager.h Document that PassManager::add() may delete the pass right away. 2014-12-12 01:27:01 +00:00
LegacyPassManagers.h [LPM] A targeted but somewhat horrible fix to the legacy pass manager's 2015-01-28 09:47:21 +00:00
LegacyPassNameParser.h Refactoring cl::parser construction and initialization. 2015-01-22 21:01:12 +00:00
LLVMContext.h Introduce enum values for previously defined metadata types. (NFC) 2014-10-21 00:13:20 +00:00
Mangler.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
MDBuilder.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Metadata.def Fix some file headers, NFC 2015-02-02 18:20:15 +00:00
Metadata.h IR: Split out DebugInfoMetadata.h, NFC 2015-02-02 18:53:21 +00:00
MetadataTracking.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Module.h [llvm link] Destroy ConstantArrays in LLVMContext if they are not used. 2015-01-20 19:24:59 +00:00
NoFolder.h
OperandTraits.h
Operator.h Teach isDereferenceablePointer() to look through bitcast constant expressions. 2015-02-05 09:15:37 +00:00
PassManager.h [PM] Teach the module-to-function adaptor to not run function passes 2015-02-01 10:47:25 +00:00
PassManagerInternal.h [PM] Remove the 'AnalysisManagerT' type parameter from numerous layers 2015-01-13 11:31:43 +00:00
PatternMatch.h InstSimplify: Optimize away pointless comparisons 2014-12-20 03:04:38 +00:00
PredIteratorCache.h Canonicalize header guards into a common format. 2014-08-13 16:26:38 +00:00
Statepoint.h [GC] CodeGenPrep transform: simplify offsetable relocate 2015-01-14 23:27:07 +00:00
SymbolTableListTraits.h
TrackingMDRef.h Add a C++ marker to this header file. 2014-12-22 19:07:45 +00:00
Type.h Add and use Type::subtypes. NFC. 2014-11-24 20:44:36 +00:00
TypeBuilder.h
TypeFinder.h IR: Split Metadata from Value 2014-12-09 18:38:53 +00:00
Use.h
UseListOrder.h verify-uselistorder: Force -preserve-bc-use-list-order 2014-08-19 21:08:27 +00:00
User.h IR: Move NumOperands from User to Value, NFC 2014-10-15 20:39:05 +00:00
Value.h Value: Remove superfluous typedefs and deprecated method. NFC. 2015-02-06 14:44:02 +00:00
ValueHandle.h Fix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone keys generation. 2015-01-09 23:17:25 +00:00
ValueMap.h Fix UBSan error reports in ValueMapCallbackVH and AssertingVH<T> empty/tombstone keys generation. 2015-01-09 23:17:25 +00:00
ValueSymbolTable.h
Verifier.h [PM] Switch the new pass manager to use a reference-based API for IR 2015-01-05 02:47:05 +00:00