Skip to content

Commit a61ac0f

Browse files
author
Artem Gindinson
authored
[SYCL][NFC] Use the non-deprecated setAlignment() in LowerWGScope (intel#1420)
The commit switches to using the `MaybeAlign` overload directly, which addresses: ``` */llvm/llvm/lib/SYCLLowerIR/LowerWGScope.cpp: In function 'llvm::Value* spirv::genPseudoLocalID(llvm::Instruction&, const llvm::Triple&)': */llvm/llvm/lib/SYCLLowerIR/LowerWGScope.cpp:929:28: warning: 'void llvm::GlobalObject::setAlignment(unsigned int)' is deprecated [-Wdeprecated-declarations] G->setAlignment(Align); ^ In file included from */llvm/llvm/include/llvm/Support/ErrorHandling.h:17:0, from */llvm/llvm/include/llvm/ADT/Hashing.h:48, from */llvm/llvm/include/llvm/ADT/ArrayRef.h:12, from */llvm/llvm/include/llvm/ADT/DenseMapInfo.h:16, from */llvm/llvm/include/llvm/ADT/DenseMap.h:16, from */llvm/llvm/include/llvm/ADT/DenseSet.h:16, from */llvm/llvm/include/llvm/IR/Function.h:20, from */llvm/llvm/include/llvm/SYCLLowerIR/LowerWGScope.h:15, from */llvm/llvm/lib/SYCLLowerIR/LowerWGScope.cpp:76: */llvm/llvm/include/llvm/IR/GlobalObject.h:86:34: note: declared here LLVM_ATTRIBUTE_DEPRECATED(void setAlignment(unsigned Align), ``` Signed-off-by: Artem Gindinson <[email protected]>
1 parent 16baf5a commit a61ac0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/SYCLLowerIR/LowerWGScope.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ Value *spirv::genPseudoLocalID(Instruction &Before, const Triple &TT) {
926926
asUInt(spirv::AddrSpace::Global) // AddressSpace
927927
);
928928
unsigned Align = M.getDataLayout().getPreferredAlignment(G);
929-
G->setAlignment(Align);
929+
G->setAlignment(MaybeAlign(Align));
930930
}
931931
Value *Res = new LoadInst(G, "", &Before);
932932
return Res;

0 commit comments

Comments
 (0)