aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorMarek Olsak <marek.olsak@amd.com>2018-01-31 20:17:52 +0000
committerMarek Olsak <marek.olsak@amd.com>2018-01-31 20:17:52 +0000
commit8e7d149a31ee0a301e404f596fa2a36a59bd10bf (patch)
tree019b338c9ae6977e6774fbbd3c0787eaa143f6bc /llvm/lib/Transforms
parent862987abe75d7735a88be3c19f6681a90e2c8e5b (diff)
downloadllvm-8e7d149a31ee0a301e404f596fa2a36a59bd10bf.zip
llvm-8e7d149a31ee0a301e404f596fa2a36a59bd10bf.tar.gz
llvm-8e7d149a31ee0a301e404f596fa2a36a59bd10bf.tar.bz2
[SeparateConstOffsetFromGEP] Preserve metadata when splitting GEPs
Summary: !amdgpu.uniform needs to be preserved for AMDGPU, otherwise bad things happen. Reviewers: arsenm, nhaehnle, jingyue, broune, majnemer, bjarke.roune, dblaikie Subscribers: wdng, tpr, llvm-commits Differential Revision: https://reviews.llvm.org/D42744 llvm-svn: 323907
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
index 8fa9ffb..4a96e0d 100644
--- a/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
+++ b/llvm/lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp
@@ -1071,6 +1071,7 @@ bool SeparateConstOffsetFromGEP::splitGEP(GetElementPtrInst *GEP) {
NewGEP = GetElementPtrInst::Create(GEP->getResultElementType(), NewGEP,
ConstantInt::get(IntPtrTy, Index, true),
GEP->getName(), GEP);
+ NewGEP->copyMetadata(*GEP);
// Inherit the inbounds attribute of the original GEP.
cast<GetElementPtrInst>(NewGEP)->setIsInBounds(GEPWasInBounds);
} else {
@@ -1095,6 +1096,7 @@ bool SeparateConstOffsetFromGEP::splitGEP(GetElementPtrInst *GEP) {
Type::getInt8Ty(GEP->getContext()), NewGEP,
ConstantInt::get(IntPtrTy, AccumulativeByteOffset, true), "uglygep",
GEP);
+ NewGEP->copyMetadata(*GEP);
// Inherit the inbounds attribute of the original GEP.
cast<GetElementPtrInst>(NewGEP)->setIsInBounds(GEPWasInBounds);
if (GEP->getType() != I8PtrTy)