Skip to content

Commit 21ca2ba

Browse files
committed
Responding to review comments
1 parent 72567c4 commit 21ca2ba

15 files changed

+119
-73
lines changed

llvm/include/llvm/Analysis/TargetTransformInfo.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ class TargetTransformInfo {
18211821

18221822
/// \return For an array of given Size, return alignment boundary to
18231823
/// pad to. Default is no padding.
1824-
unsigned getNumBytesToPad(unsigned Size) const;
1824+
unsigned getNumBytesToPadGlobalArray(unsigned Size, Type *ArrayType) const;
18251825

18261826
/// @}
18271827

@@ -2229,7 +2229,8 @@ class TargetTransformInfo::Concept {
22292229
getVPLegalizationStrategy(const VPIntrinsic &PI) const = 0;
22302230
virtual bool hasArmWideBranch(bool Thumb) const = 0;
22312231
virtual unsigned getMaxNumArgs() const = 0;
2232-
virtual unsigned getNumBytesToPad(unsigned Size) const = 0;
2232+
virtual unsigned getNumBytesToPadGlobalArray(unsigned Size,
2233+
Type *ArrayType) const = 0;
22332234
};
22342235

22352236
template <typename T>
@@ -3032,8 +3033,9 @@ class TargetTransformInfo::Model final : public TargetTransformInfo::Concept {
30323033
return Impl.getMaxNumArgs();
30333034
}
30343035

3035-
unsigned getNumBytesToPad(unsigned Size) const override {
3036-
return Impl.getNumBytesToPad(Size);
3036+
unsigned getNumBytesToPadGlobalArray(unsigned Size,
3037+
Type *ArrayType) const override {
3038+
return Impl.getNumBytesToPadGlobalArray(Size, ArrayType);
30373039
}
30383040
};
30393041

llvm/include/llvm/Analysis/TargetTransformInfoImpl.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,9 @@ class TargetTransformInfoImplBase {
10061006

10071007
unsigned getMaxNumArgs() const { return UINT_MAX; }
10081008

1009-
unsigned getNumBytesToPad(unsigned Size) const { return 0; }
1009+
unsigned getNumBytesToPadGlobalArray(unsigned Size, Type *ArrayType) const {
1010+
return 0;
1011+
}
10101012

10111013
protected:
10121014
// Obtain the minimum required size to hold the value (without the sign)

llvm/lib/Analysis/TargetTransformInfo.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,8 +1386,10 @@ bool TargetTransformInfo::useWidenGlobalStrings() const {
13861386
return TTIImpl->useWidenGlobalStrings();
13871387
}
13881388

1389-
unsigned TargetTransformInfo::getNumBytesToPad(unsigned Size) const {
1390-
return TTIImpl->getNumBytesToPad(Size);
1389+
unsigned
1390+
TargetTransformInfo::getNumBytesToPadGlobalArray(unsigned Size,
1391+
Type *ArrayType) const {
1392+
return TTIImpl->getNumBytesToPadGlobalArray(Size, ArrayType);
13911393
}
13921394

13931395
TargetTransformInfo::Concept::~Concept() = default;

llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2664,6 +2664,7 @@ bool ARMTTIImpl::hasArmWideBranch(bool Thumb) const {
26642664
}
26652665
}
26662666

2667+
<<<<<<< HEAD
26672668
/// Check if Ext1 and Ext2 are extends of the same type, doubling the bitwidth
26682669
/// of the vector elements.
26692670
static bool areExtractExts(Value *Ext1, Value *Ext2) {
@@ -2812,8 +2813,14 @@ bool ARMTTIImpl::isProfitableToSinkOperands(Instruction *I,
28122813

28132814
bool ARMTTIImpl::useWidenGlobalStrings() const { return UseWidenGlobalStrings; }
28142815

2815-
unsigned ARMTTIImpl::getNumBytesToPad(unsigned Size) const {
2816-
// We pad to 4 byte boundaries;
2816+
unsigned ARMTTIImpl::getNumBytesToPadGlobalArray(unsigned Size,
2817+
Type *ArrayType) const {
2818+
// Don't modify none integer array types
2819+
if (!ArrayType || !ArrayType->isArrayTy() ||
2820+
!ArrayType->getArrayElementType()->isIntegerTy())
2821+
return 0;
2822+
2823+
// We pad to 4 byte boundaries
28172824
if (Size % 4 == 0)
28182825
return 0;
28192826

llvm/lib/Target/ARM/ARMTargetTransformInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ class ARMTTIImpl : public BasicTTIImplBase<ARMTTIImpl> {
340340

341341
bool useWidenGlobalStrings() const;
342342

343-
unsigned getNumBytesToPad(unsigned Size) const;
343+
unsigned getNumBytesToPadGlobalArray(unsigned Size, Type *ArrayType) const;
344344

345345
/// @}
346346
};

llvm/lib/Transforms/IPO/GlobalOpt.cpp

Lines changed: 39 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ STATISTIC(NumInternalFunc, "Number of internal functions");
9292
STATISTIC(NumColdCC, "Number of functions marked coldcc");
9393
STATISTIC(NumIFuncsResolved, "Number of statically resolved IFuncs");
9494
STATISTIC(NumIFuncsDeleted, "Number of IFuncs removed");
95-
STATISTIC(NumGlobalStringsPadded,
96-
"Number of global strings padded to alignment boundary");
95+
STATISTIC(NumGlobalArraysPadded,
96+
"Number of global arrays padded to alignment boundary");
9797

9898
static cl::opt<bool>
9999
EnableColdCCStressTest("enable-coldcc-stress-test",
@@ -2031,16 +2031,10 @@ OptimizeFunctions(Module &M,
20312031
return Changed;
20322032
}
20332033

2034-
static bool IsCharArray(Type *T) {
2035-
const unsigned int CHAR_BIT_SIZE = 8;
2036-
return T && T->isArrayTy() && T->getArrayElementType()->isIntegerTy() &&
2037-
T->getArrayElementType()->getIntegerBitWidth() == CHAR_BIT_SIZE;
2038-
}
2039-
2040-
static bool tryWidenGlobalString(CallInst *CI, GlobalVariable *SourceVar,
2041-
unsigned NumBytesToPad,
2042-
unsigned NumBytesToCopy,
2043-
ConstantInt *BytesToCopyOp) {
2034+
static bool tryWidenGlobalArray(CallInst *CI, GlobalVariable *SourceVar,
2035+
unsigned NumBytesToPad, unsigned NumBytesToCopy,
2036+
ConstantInt *BytesToCopyOp,
2037+
ConstantDataArray *SourceDataArray) {
20442038
auto *F = CI->getCalledFunction();
20452039
auto *Alloca = dyn_cast<AllocaInst>(CI->getArgOperand(0));
20462040
auto *IsVolatile = dyn_cast<ConstantInt>(CI->getArgOperand(3));
@@ -2052,48 +2046,51 @@ static bool tryWidenGlobalString(CallInst *CI, GlobalVariable *SourceVar,
20522046
!SourceVar->hasLocalLinkage() || !SourceVar->hasGlobalUnnamedAddr())
20532047
return false;
20542048

2055-
if (!Alloca->isStaticAlloca() || !IsCharArray(Alloca->getAllocatedType()))
2056-
return false;
2057-
2058-
ConstantDataArray *SourceDataArray =
2059-
dyn_cast<ConstantDataArray>(SourceVar->getInitializer());
2060-
if (!SourceDataArray || !IsCharArray(SourceDataArray->getType()))
2049+
if (!Alloca->isStaticAlloca())
20612050
return false;
20622051

20632052
uint64_t DZSize = Alloca->getAllocatedType()->getArrayNumElements();
20642053
uint64_t SZSize = SourceDataArray->getType()->getNumElements();
2054+
unsigned ElementByteWidth = SourceDataArray->getElementByteSize();
2055+
// Calculate the number of elements to copy while avoiding floored
2056+
// division of integers returning wrong values i.e. copying one byte
2057+
// from an array of i16 would yield 0 elements to copy as supposed to 1.
2058+
unsigned NumElementsToCopy =
2059+
(NumBytesToCopy + ElementByteWidth - 1) / ElementByteWidth;
20652060

20662061
// For safety purposes lets add a constraint and only pad when
2067-
// num bytes to copy == destination array size == source string
2068-
// which is a constant
2069-
if (NumBytesToCopy != DZSize || DZSize != SZSize)
2062+
// NumElementsToCopy == destination array size ==
2063+
// source string which is a constant
2064+
if (NumElementsToCopy != DZSize || DZSize != SZSize)
20702065
return false;
20712066

20722067
unsigned int TotalBytes = NumBytesToCopy + NumBytesToPad;
2068+
NumElementsToCopy = (TotalBytes + ElementByteWidth - 1) / ElementByteWidth;
20732069

2074-
// Update destination char array to be word aligned (memcpy(X,...,...))
2070+
// Update destination array to be word aligned (memcpy(X,...,...))
20752071
IRBuilder<> BuildAlloca(Alloca);
20762072
AllocaInst *NewAlloca = BuildAlloca.CreateAlloca(ArrayType::get(
2077-
Alloca->getAllocatedType()->getArrayElementType(), TotalBytes));
2073+
Alloca->getAllocatedType()->getArrayElementType(), NumElementsToCopy));
20782074
NewAlloca->takeName(Alloca);
20792075
NewAlloca->setAlignment(Alloca->getAlign());
20802076
Alloca->replaceAllUsesWith(NewAlloca);
2077+
Alloca->eraseFromParent();
20812078

20822079
// Update source to be word aligned (memcpy(...,X,...))
2083-
// create replacement string with padded null bytes.
2080+
// create replacement with padded null bytes.
20842081
StringRef Data = SourceDataArray->getRawDataValues();
20852082
std::vector<uint8_t> StrData(Data.begin(), Data.end());
20862083
for (unsigned int p = 0; p < NumBytesToPad; p++)
20872084
StrData.push_back('\0');
20882085
auto Arr = ArrayRef(StrData.data(), TotalBytes);
20892086

2090-
// Create new padded version of global variable string.
2087+
// Create new padded version of global variable.
20912088
Constant *SourceReplace = ConstantDataArray::get(F->getContext(), Arr);
20922089
GlobalVariable *NewGV = new GlobalVariable(
20932090
*(F->getParent()), SourceReplace->getType(), true,
20942091
SourceVar->getLinkage(), SourceReplace, SourceReplace->getName());
20952092

2096-
// Copy any other attributes from original global variable string
2093+
// Copy any other attributes from original global variable
20972094
// e.g. unamed_addr
20982095
NewGV->copyAttributesFrom(SourceVar);
20992096
NewGV->takeName(SourceVar);
@@ -2103,11 +2100,11 @@ static bool tryWidenGlobalString(CallInst *CI, GlobalVariable *SourceVar,
21032100

21042101
// Update number of bytes to copy (memcpy(...,...,X))
21052102
CI->setArgOperand(2, ConstantInt::get(BytesToCopyOp->getType(), TotalBytes));
2106-
NumGlobalStringsPadded++;
2103+
NumGlobalArraysPadded++;
21072104
return true;
21082105
}
21092106

2110-
static bool tryWidenGlobalStringsUsedByMemcpy(
2107+
static bool tryWidenGlobalArraysUsedByMemcpy(
21112108
GlobalVariable *GV,
21122109
function_ref<TargetTransformInfo &(Function &)> GetTTI) {
21132110
for (auto *User : GV->users()) {
@@ -2124,12 +2121,21 @@ static bool tryWidenGlobalStringsUsedByMemcpy(
21242121
if (!BytesToCopyOp)
21252122
continue;
21262123

2124+
if (!GV->hasInitializer())
2125+
continue;
2126+
2127+
ConstantDataArray *SourceDataArray =
2128+
dyn_cast<ConstantDataArray>(GV->getInitializer());
2129+
if (!SourceDataArray)
2130+
continue;
2131+
21272132
unsigned NumBytesToCopy = BytesToCopyOp->getZExtValue();
2128-
unsigned NumBytesToPad = TTI.getNumBytesToPad(NumBytesToCopy);
2133+
unsigned NumBytesToPad = TTI.getNumBytesToPadGlobalArray(
2134+
NumBytesToCopy, SourceDataArray->getType());
21292135

21302136
if (NumBytesToPad)
2131-
return tryWidenGlobalString(CI, GV, NumBytesToPad, NumBytesToCopy,
2132-
BytesToCopyOp);
2137+
return tryWidenGlobalArray(CI, GV, NumBytesToPad, NumBytesToCopy,
2138+
BytesToCopyOp, SourceDataArray);
21332139
}
21342140
return false;
21352141
}
@@ -2163,9 +2169,9 @@ OptimizeGlobalVars(Module &M,
21632169
continue;
21642170
}
21652171

2166-
// For global variable strings called in a memcpy
2172+
// For global variable arrays called in a memcpy
21672173
// we try to pad to nearest valid alignment boundary
2168-
Changed |= tryWidenGlobalStringsUsedByMemcpy(&GV, GetTTI);
2174+
Changed |= tryWidenGlobalArraysUsedByMemcpy(&GV, GetTTI);
21692175

21702176
Changed |= processGlobal(GV, GetTTI, GetTLI, LookupDomTree);
21712177
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes=globalopt -S | FileCheck %s
3+
4+
@.i16 = private unnamed_addr constant [5 x i16] [i16 1, i16 2, i16 3, i16 4, i16 5] , align 1
5+
6+
define hidden void @memcpy_i16_array() local_unnamed_addr {
7+
; CHECK-LABEL: define hidden void @memcpy_i16_array() local_unnamed_addr {
8+
; CHECK-NEXT: [[ENTRY:.*:]]
9+
; CHECK-NEXT: [[SOMETHING1:%.*]] = alloca [6 x i16], align 1
10+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(10) [[SOMETHING1]], ptr noundef nonnull align 1 dereferenceable(10) @.i16, i32 12, i1 false)
11+
; CHECK-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING1]])
12+
; CHECK-NEXT: ret void
13+
;
14+
entry:
15+
%something = alloca [5 x i16], align 1
16+
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(10) %something, ptr noundef nonnull align 1 dereferenceable(10) @.i16, i32 10, i1 false)
17+
%call2 = call i32 @bar(ptr nonnull %something)
18+
ret void
19+
}
20+
21+
22+
declare i32 @bar(...) local_unnamed_addr
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2+
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes=globalopt -S | FileCheck %s
3+
4+
@.i8 = private unnamed_addr constant [3 x i8] [i8 1, i8 2, i8 3] , align 1
5+
6+
define hidden void @memcpy_multiple() local_unnamed_addr {
7+
; CHECK-LABEL: define hidden void @memcpy_multiple() local_unnamed_addr {
8+
; CHECK-NEXT: [[ENTRY:.*:]]
9+
; CHECK-NEXT: [[SOMETHING:%.*]] = alloca [4 x i8], align 1
10+
; CHECK-NEXT: [[SOMETHING1:%.*]] = alloca [4 x i8], align 1
11+
; CHECK-NEXT: [[SOMETHING2:%.*]] = alloca [4 x i8], align 1
12+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(3) @[[GLOB1:[0-9]+]], i32 4, i1 false)
13+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) [[SOMETHING1]], ptr noundef nonnull align 1 dereferenceable(3) @[[GLOB0:[0-9]+]], i32 4, i1 false)
14+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) [[SOMETHING2]], ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 4, i1 false)
15+
; CHECK-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING]])
16+
; CHECK-NEXT: [[CALL3:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING1]])
17+
; CHECK-NEXT: [[CALL4:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING2]])
18+
; CHECK-NEXT: ret void
19+
;
20+
entry:
21+
%something = alloca [3 x i8], align 1
22+
%something1 = alloca [3 x i8], align 1
23+
%something2 = alloca [3 x i8], align 1
24+
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) %something, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
25+
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) %something1, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
26+
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(3) %something2, ptr noundef nonnull align 1 dereferenceable(3) @.i8, i32 3, i1 false)
27+
%call2 = call i32 @bar(ptr nonnull %something)
28+
%call3 = call i32 @bar(ptr nonnull %something1)
29+
%call4 = call i32 @bar(ptr nonnull %something2)
30+
ret void
31+
}
32+
33+
declare i32 @bar(...) local_unnamed_addr
Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,17 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
22
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes=globalopt -S | FileCheck %s
3-
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes="default<O0>" -S | FileCheck %s --check-prefix=TURNED-OFF
43

54
; CHECK: [12 x i8]
6-
; TURNED-OFF-NOT: [12 x i8]
75
@.str = private unnamed_addr constant [10 x i8] c"123456789\00", align 1
86

97
define hidden void @foo() local_unnamed_addr {
108
; CHECK-LABEL: define hidden void @foo() local_unnamed_addr {
119
; CHECK-NEXT: [[ENTRY:.*:]]
1210
; CHECK-NEXT: [[SOMETHING:%.*]] = alloca [12 x i8], align 1
13-
; CHECK-NEXT: [[TMP0:%.*]] = alloca [10 x i8], align 1
1411
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(10) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(10) @.str, i32 12, i1 false)
1512
; CHECK-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING]])
1613
; CHECK-NEXT: ret void
1714
;
18-
; TURNED-OFF-LABEL: define hidden void @foo() local_unnamed_addr {
19-
; TURNED-OFF-NEXT: [[ENTRY:.*:]]
20-
; TURNED-OFF-NEXT: [[SOMETHING:%.*]] = alloca [10 x i8], align 1
21-
; TURNED-OFF-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(10) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(10) @.str, i32 10, i1 false)
22-
; TURNED-OFF-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING]])
23-
; TURNED-OFF-NEXT: ret void
24-
;
2515
entry:
2616
%something = alloca [10 x i8], align 1
2717
call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(10) %something, ptr noundef nonnull align 1 dereferenceable(10) @.str, i32 10, i1 false)
@@ -30,4 +20,3 @@ entry:
3020
}
3121

3222
declare i32 @bar(...) local_unnamed_addr
33-
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-2.ll

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
2-
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes="default<O2>,globalopt" -S | FileCheck %s
2+
; RUN: opt < %s -mtriple=arm-arm-none-eabi -passes=globalopt -S | FileCheck %s
33

44
; CHECK: [64 x i8]
55
@.str = private unnamed_addr constant [62 x i8] c"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\00", align 1
@@ -8,7 +8,7 @@ define hidden void @foo() local_unnamed_addr {
88
; CHECK-LABEL: define hidden void @foo() local_unnamed_addr {
99
; CHECK-NEXT: [[ENTRY:.*:]]
1010
; CHECK-NEXT: [[SOMETHING:%.*]] = alloca [64 x i8], align 1
11-
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(64) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(64) @.str, i32 64, i1 false)
11+
; CHECK-NEXT: call void @llvm.memcpy.p0.p0.i32(ptr noundef nonnull align 1 dereferenceable(62) [[SOMETHING]], ptr noundef nonnull align 1 dereferenceable(62) @.str, i32 64, i1 false)
1212
; CHECK-NEXT: [[CALL2:%.*]] = call i32 @bar(ptr nonnull [[SOMETHING]])
1313
; CHECK-NEXT: ret void
1414
;
@@ -20,4 +20,3 @@ entry:
2020
}
2121

2222
declare i32 @bar(...) local_unnamed_addr
23-
declare void @llvm.memcpy.p0.p0.i32(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i32, i1 immarg) #0

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-lengths-dont-match.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,3 @@ entry:
2424
}
2525

2626
declare i32 @bar(...) local_unnamed_addr #2
27-
declare void @llvm.lifetime.start(i64, ptr nocapture) #1
28-
declare void @llvm.lifetime.end(i64, ptr nocapture) #1
29-
declare void @llvm.memcpy.p0i8.p0i8.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-more-than-64-bytes.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,3 @@ entry:
2626
}
2727

2828
declare i32 @bar(...) local_unnamed_addr #2
29-
declare void @llvm.lifetime.start(i64, ptr nocapture) #1
30-
declare void @llvm.lifetime.end(i64, ptr nocapture) #1
31-
declare void @llvm.memcpy.p0i8.p0i8.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-ptrtoint.ll

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ define hidden i32 @f() {
99
; CHECK-LABEL: define hidden i32 @f() local_unnamed_addr {
1010
; CHECK-NEXT: [[ENTRY:.*:]]
1111
; CHECK-NEXT: [[STRING1:%.*]] = alloca [48 x i8], align 1
12-
; CHECK-NEXT: [[TMP0:%.*]] = alloca [45 x i8], align 1
1312
; CHECK-NEXT: [[POS:%.*]] = alloca i32, align 4
1413
; CHECK-NEXT: [[TOKEN:%.*]] = alloca ptr, align 4
1514
; CHECK-NEXT: call void @llvm.lifetime.start.p0(i64 45, ptr [[STRING1]])
@@ -54,6 +53,3 @@ entry:
5453
}
5554

5655
declare ptr @strchr(ptr, i32)
57-
declare void @llvm.lifetime.start.p0i8(i64, ptr nocapture)
58-
declare void @llvm.lifetime.end.p0i8(i64, ptr nocapture)
59-
declare void @llvm.memcpy.p0i8.p0i8.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1)

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-struct-test.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ entry:
3030
}
3131

3232
declare i32 @puts(ptr nocapture readonly) #2
33-
declare void @llvm.lifetime.start(i64, ptr nocapture) #1
34-
declare void @llvm.lifetime.end(i64, ptr nocapture) #1
35-
declare void @llvm.memcpy.p0i8.p0i8.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1
3633

3734
!1 = !{!2, !3, i64 0}
3835
!2 = !{!"P", !3, i64 0, !4, i64 4}

llvm/test/Transforms/GlobalOpt/ARM/arm-widen-strings-volatile.ll

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,3 @@ entry:
2727
}
2828

2929
declare i32 @bar(...) local_unnamed_addr #2
30-
declare void @llvm.lifetime.start(i64, ptr nocapture) #1
31-
declare void @llvm.lifetime.end(i64, ptr nocapture) #1
32-
declare void @llvm.memcpy.p0i8.p0i8.i32(ptr nocapture writeonly, ptr nocapture readonly, i32, i1) #1

0 commit comments

Comments
 (0)