1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 11:33:24 +02:00
llvm-mirror/include/llvm/IR
Pete Cooper aca4c5cdc6 Change memcpy/memset/memmove to have dest and source alignments.
Note, this was reviewed (and more details are in) http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/312083.html

These intrinsics currently have an explicit alignment argument which is
required to be a constant integer.  It represents the alignment of the
source and dest, and so must be the minimum of those.

This change allows source and dest to each have their own alignments
by using the alignment attribute on their arguments.  The alignment
argument itself is removed.

There are a few places in the code for which the code needs to be
checked by an expert as to whether using only src/dest alignment is
safe.  For those places, they currently take the minimum of src/dest
alignments which matches the current behaviour.

For example, code which used to read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dest, i8* %src, i32 500, i32 8, i1 false)
will now read:
  call void @llvm.memcpy.p0i8.p0i8.i32(i8* align 8 %dest, i8* align 8 %src, i32 500, i1 false)

For out of tree owners, I was able to strip alignment from calls using sed by replacing:
  (call.*llvm\.memset.*)i32\ [0-9]*\,\ i1 false\)
with:
  $1i1 false)

and similarly for memmove and memcpy.

I then added back in alignment to test cases which needed it.

A similar commit will be made to clang which actually has many differences in alignment as now
IRBuilder can generate different source/dest alignments on calls.

In IRBuilder itself, a new argument was added.  Instead of calling:
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, /* isVolatile */ false)
you now call
  CreateMemCpy(Dst, Src, getInt64(Size), DstAlign, SrcAlign, /* isVolatile */ false)

There is a temporary class (IntegerAlignment) which takes the source alignment and rejects
implicit conversion from bool.  This is to prevent isVolatile here from passing its default
parameter to the source alignment.

Note, changes in future can now be made to codegen.  I didn't change anything here, but this
change should enable better memcpy code sequences.

Reviewed by Hal Finkel.

llvm-svn: 253511
2015-11-18 22:17:24 +00:00
..
Argument.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
AssemblyAnnotationWriter.h Prune trailing whitespaces. 2015-09-22 11:19:03 +00:00
Attributes.h Revert r252990. 2015-11-13 01:44:32 +00:00
Attributes.td Revert r252990. 2015-11-13 01:44:32 +00:00
AutoUpgrade.h
BasicBlock.h ADT: Avoid relying on UB in ilist_node::getNextNode() 2015-11-11 02:26:42 +00:00
CallingConv.h [IR] Limit bits used for CallingConv::ID, update tests 2015-10-27 21:17:06 +00:00
CallSite.h [OperandBundles] Identify operand bundles with both their names and IDs 2015-11-10 20:13:15 +00:00
CFG.h Move BB succ_iterator to be inside TerminatorInst. NFC. 2015-08-05 17:43:01 +00:00
CMakeLists.txt Move the enum attributes defined in Attributes.h to a table-gen file. 2015-11-11 20:35:42 +00:00
Comdat.h AsmWriter: Print the argument names in declarations while debugging 2015-09-27 22:38:50 +00:00
Constant.h Drop prelink support. 2015-11-17 00:51:23 +00:00
ConstantFolder.h
ConstantRange.h [IR] Add a makeNoWrapRegion method to ConstantRange 2015-10-22 03:12:57 +00:00
Constants.h [IR] Add support for empty tokens 2015-11-11 21:57:16 +00:00
DataLayout.h Revert "Add const to a bunch of Type* in DataLayout. NFC." 2015-07-27 17:15:28 +00:00
DebugInfo.h DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
DebugInfoFlags.def Debug Info: Add basic support for external types references. 2015-07-15 17:01:41 +00:00
DebugInfoMetadata.h DI: Reverse direction of subprogram -> function edge. 2015-11-05 22:03:56 +00:00
DebugLoc.h
DerivedTypes.h Prune trailing whitespaces. 2015-09-22 11:19:03 +00:00
DiagnosticInfo.h StringRef-ify DiagnosticInfoSampleProfile::Filename 2015-11-02 20:01:13 +00:00
DiagnosticPrinter.h Fix -Wextra-semi warnings. 2015-07-22 20:46:11 +00:00
DIBuilder.h [DIBuilder] Make createReferenceType take size and align 2015-11-16 07:57:32 +00:00
Dominators.h [docs] Update DominatorTree docs to clarify expectations around unreachable blocks 2015-09-23 18:39:37 +00:00
Function.h Add a new attribute: norecurse 2015-11-06 10:32:53 +00:00
FunctionInfo.h Restore "Support for ThinLTO function importing and symbol linking." 2015-11-03 00:14:15 +00:00
GetElementPtrTypeIterator.h Roll forward r243250 2015-07-26 19:10:03 +00:00
GlobalAlias.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
GlobalObject.h [opaque pointer types] Add an explicit value type to GlobalObject 2015-09-14 21:47:27 +00:00
GlobalValue.h [opaque pointer types] Add an explicit value type to GlobalObject 2015-09-14 21:47:27 +00:00
GlobalVariable.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
GVMaterializer.h
InlineAsm.h Prune trailing whitespaces. 2015-09-22 11:19:03 +00:00
InstIterator.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
InstrTypes.h [OperandBundles] Address review on r253446; NFC 2015-11-18 19:44:59 +00:00
Instruction.def Reformat blank lines. 2015-09-22 11:14:39 +00:00
Instruction.h ADT: Avoid relying on UB in ilist_node::getNextNode() 2015-11-11 02:26:42 +00:00
Instructions.h Change memcpy/memset/memmove to have dest and source alignments. 2015-11-18 22:17:24 +00:00
InstVisitor.h [WinEH] Add cleanupendpad instruction 2015-09-03 09:09:43 +00:00
IntrinsicInst.h Change memcpy/memset/memmove to have dest and source alignments. 2015-11-18 22:17:24 +00:00
Intrinsics.h [TableGen] Allow TokenTy in intrinsic signatures 2015-09-02 13:36:25 +00:00
Intrinsics.td Change memcpy/memset/memmove to have dest and source alignments. 2015-11-18 22:17:24 +00:00
IntrinsicsAArch64.td Implement __builtin_thread_pointer 2015-07-28 13:03:31 +00:00
IntrinsicsAMDGPU.td AMDGPU: Add MEM_RAT STORE_TYPED. 2015-10-01 17:51:34 +00:00
IntrinsicsARM.td [ARM][NEON] Use address space in vld([1234]|[234]lane) and vst([1234]|[234]lane) instructions 2015-09-30 10:56:37 +00:00
IntrinsicsBPF.td
IntrinsicsHexagon.td
IntrinsicsMips.td
IntrinsicsNVVM.td
IntrinsicsPowerPC.td Addition of interfaces the BE to conform to Table A-2 of ELF V2 ABI V1.1 2015-09-29 17:41:53 +00:00
IntrinsicsSystemZ.td
IntrinsicsWebAssembly.td [WebAssembly] Change int_wasm_memory_size from IntrNoMem to IntrReadMem. 2015-11-14 23:02:31 +00:00
IntrinsicsX86.td [X86][AVX512CD] add mask broadcast intrinsics 2015-11-18 09:42:45 +00:00
IntrinsicsXCore.td
IRBuilder.h Change memcpy/memset/memmove to have dest and source alignments. 2015-11-18 22:17:24 +00:00
IRPrintingPasses.h IR: Extract a function 'printLLVMNameWithoutPrefix' from 'PrintLLVMName'. NFC. 2015-07-21 16:50:35 +00:00
LegacyPassManager.h
LegacyPassManagers.h Reformat blank lines. 2015-09-22 11:14:39 +00:00
LegacyPassNameParser.h
LLVMContext.h Introduce deoptimization operand bundles 2015-11-11 21:38:02 +00:00
Mangler.h Remove unused arguments and move ManglerPrefixTy to the implementation. 2015-06-23 14:11:09 +00:00
MDBuilder.h add unpredictable metadata type for control flow 2015-09-02 19:06:43 +00:00
Metadata.def DI: Disallow uniquable DICompileUnits 2015-08-03 17:26:41 +00:00
Metadata.h Preserve load alignment and dereferenceable metadata during some transformations 2015-11-02 17:53:51 +00:00
MetadataTracking.h
Module.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
ModuleSlotTracker.h IR: Expose the method 'getLocalSlot' in the module slot tracker. 2015-07-27 22:31:04 +00:00
NoFolder.h
OperandTraits.h
Operator.h Add support for fast-math flags to the FCmp instruction. 2015-07-10 12:52:00 +00:00
PassManager.h PM: Print the IR unit's name in debug output. NFC 2015-10-30 22:58:15 +00:00
PassManagerInternal.h
PatternMatch.h Revert "[PatternMatch] Switch to use ValueTracking::matchSelectPattern" 2015-11-04 08:36:53 +00:00
PredIteratorCache.h
Statepoint.h [RS4GC] Refactoring to make a later change easier, NFCI 2015-10-08 23:18:38 +00:00
SymbolTableListTraits.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
TrackingMDRef.h
Type.h AsmWriter: Print the argument names in declarations while debugging 2015-09-27 22:38:50 +00:00
TypeBuilder.h
TypeFinder.h Reformat comment lines. 2015-09-22 11:14:12 +00:00
Use.h
UseListOrder.h Fix Clang-tidy modernize-use-nullptr warnings in examples and include directories; other minor cleanups. 2015-09-29 18:02:48 +00:00
User.h Support, IR: silence -Wunused-parameter 2015-10-23 05:26:03 +00:00
Value.def [IR] Add support for empty tokens 2015-11-11 21:57:16 +00:00
Value.h AsmWriter: Print the argument names in declarations while debugging 2015-09-27 22:38:50 +00:00
ValueHandle.h Update/correct comment. 2015-08-03 22:33:50 +00:00
ValueMap.h -Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11 2015-08-03 22:30:24 +00:00
ValueSymbolTable.h IR: Create SymbolTableList wrapper around iplist, NFC 2015-10-07 20:05:10 +00:00
Verifier.h