[PATCH] D73050: [Alignment][NFC] Use Align with CreateElementUnorderedAtomicMemMove
Guillaume Chatelet via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 21 05:18:37 PST 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG139771f8b02d: [Alignment][NFC] Use Align with CreateElementUnorderedAtomicMemMove (authored by gchatelet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D73050/new/
https://reviews.llvm.org/D73050
Files:
llvm/include/llvm/IR/IRBuilder.h
llvm/lib/IR/IRBuilder.cpp
Index: llvm/lib/IR/IRBuilder.cpp
===================================================================
--- llvm/lib/IR/IRBuilder.cpp
+++ llvm/lib/IR/IRBuilder.cpp
@@ -276,7 +276,7 @@
}
CallInst *IRBuilderBase::CreateElementUnorderedAtomicMemMove(
- Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, Value *Size,
+ Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size,
uint32_t ElementSize, MDNode *TBAATag, MDNode *TBAAStructTag,
MDNode *ScopeTag, MDNode *NoAliasTag) {
assert(DstAlign >= ElementSize &&
@@ -295,10 +295,8 @@
CallInst *CI = createCallHelper(TheFn, Ops, this);
// Set the alignment of the pointer args.
- CI->addParamAttr(
- 0, Attribute::getWithAlignment(CI->getContext(), Align(DstAlign)));
- CI->addParamAttr(
- 1, Attribute::getWithAlignment(CI->getContext(), Align(SrcAlign)));
+ CI->addParamAttr(0, Attribute::getWithAlignment(CI->getContext(), DstAlign));
+ CI->addParamAttr(1, Attribute::getWithAlignment(CI->getContext(), SrcAlign));
// Set the TBAA info if present.
if (TBAATag)
Index: llvm/include/llvm/IR/IRBuilder.h
===================================================================
--- llvm/include/llvm/IR/IRBuilder.h
+++ llvm/include/llvm/IR/IRBuilder.h
@@ -657,20 +657,40 @@
/// specified, it will be added to the instruction. Likewise with alias.scope
/// and noalias tags.
CallInst *CreateElementUnorderedAtomicMemMove(
- Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign,
- uint64_t Size, uint32_t ElementSize, MDNode *TBAATag = nullptr,
+ Value *Dst, Align DstAlign, Value *Src, Align SrcAlign, Value *Size,
+ uint32_t ElementSize, MDNode *TBAATag = nullptr,
MDNode *TBAAStructTag = nullptr, MDNode *ScopeTag = nullptr,
- MDNode *NoAliasTag = nullptr) {
+ MDNode *NoAliasTag = nullptr);
+
+ /// FIXME: Remove this function once transition to Align is over.
+ /// Use the version that takes Align instead of this one.
+ LLVM_ATTRIBUTE_DEPRECATED(CallInst *CreateElementUnorderedAtomicMemMove(
+ Value *Dst, unsigned DstAlign, Value *Src,
+ unsigned SrcAlign, uint64_t Size,
+ uint32_t ElementSize, MDNode *TBAATag = nullptr,
+ MDNode *TBAAStructTag = nullptr,
+ MDNode *ScopeTag = nullptr,
+ MDNode *NoAliasTag = nullptr),
+ "Use the version that takes Align instead") {
return CreateElementUnorderedAtomicMemMove(
- Dst, DstAlign, Src, SrcAlign, getInt64(Size), ElementSize, TBAATag,
- TBAAStructTag, ScopeTag, NoAliasTag);
+ Dst, Align(DstAlign), Src, Align(SrcAlign), getInt64(Size), ElementSize,
+ TBAATag, TBAAStructTag, ScopeTag, NoAliasTag);
}
- CallInst *CreateElementUnorderedAtomicMemMove(
- Value *Dst, unsigned DstAlign, Value *Src, unsigned SrcAlign, Value *Size,
- uint32_t ElementSize, MDNode *TBAATag = nullptr,
- MDNode *TBAAStructTag = nullptr, MDNode *ScopeTag = nullptr,
- MDNode *NoAliasTag = nullptr);
+ /// FIXME: Remove this function once transition to Align is over.
+ /// Use the version that takes Align instead of this one.
+ LLVM_ATTRIBUTE_DEPRECATED(CallInst *CreateElementUnorderedAtomicMemMove(
+ Value *Dst, unsigned DstAlign, Value *Src,
+ unsigned SrcAlign, Value *Size,
+ uint32_t ElementSize, MDNode *TBAATag = nullptr,
+ MDNode *TBAAStructTag = nullptr,
+ MDNode *ScopeTag = nullptr,
+ MDNode *NoAliasTag = nullptr),
+ "Use the version that takes Align instead") {
+ return CreateElementUnorderedAtomicMemMove(
+ Dst, Align(DstAlign), Src, Align(SrcAlign), Size, ElementSize, TBAATag,
+ TBAAStructTag, ScopeTag, NoAliasTag);
+ }
/// Create a vector fadd reduction intrinsic of the source vector.
/// The first parameter is a scalar accumulator value for ordered reductions.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73050.239289.patch
Type: text/x-patch
Size: 4200 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200121/f7e30980/attachment.bin>
More information about the llvm-commits
mailing list