@@ -1398,7 +1398,8 @@ static void speculateSelectInstLoads(SelectInst &SI) {
1398
1398
// / This will return the BasePtr if that is valid, or build a new GEP
1399
1399
// / instruction using the IRBuilder if GEP-ing is needed.
1400
1400
static Value *buildGEP (IRBuilderTy &IRB, Value *BasePtr,
1401
- SmallVectorImpl<Value *> &Indices, Twine NamePrefix) {
1401
+ SmallVectorImpl<Value *> &Indices,
1402
+ const Twine &NamePrefix) {
1402
1403
if (Indices.empty ())
1403
1404
return BasePtr;
1404
1405
@@ -1423,7 +1424,7 @@ static Value *buildGEP(IRBuilderTy &IRB, Value *BasePtr,
1423
1424
static Value *getNaturalGEPWithType (IRBuilderTy &IRB, const DataLayout &DL,
1424
1425
Value *BasePtr, Type *Ty, Type *TargetTy,
1425
1426
SmallVectorImpl<Value *> &Indices,
1426
- Twine NamePrefix) {
1427
+ const Twine & NamePrefix) {
1427
1428
if (Ty == TargetTy)
1428
1429
return buildGEP (IRB, BasePtr, Indices, NamePrefix);
1429
1430
@@ -1468,7 +1469,7 @@ static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL,
1468
1469
Value *Ptr, Type *Ty, APInt &Offset,
1469
1470
Type *TargetTy,
1470
1471
SmallVectorImpl<Value *> &Indices,
1471
- Twine NamePrefix) {
1472
+ const Twine & NamePrefix) {
1472
1473
if (Offset == 0 )
1473
1474
return getNaturalGEPWithType (IRB, DL, Ptr, Ty, TargetTy, Indices,
1474
1475
NamePrefix);
@@ -1543,7 +1544,7 @@ static Value *getNaturalGEPRecursively(IRBuilderTy &IRB, const DataLayout &DL,
1543
1544
static Value *getNaturalGEPWithOffset (IRBuilderTy &IRB, const DataLayout &DL,
1544
1545
Value *Ptr, APInt Offset, Type *TargetTy,
1545
1546
SmallVectorImpl<Value *> &Indices,
1546
- Twine NamePrefix) {
1547
+ const Twine & NamePrefix) {
1547
1548
PointerType *Ty = cast<PointerType>(Ptr->getType ());
1548
1549
1549
1550
// Don't consider any GEPs through an i8* as natural unless the TargetTy is
@@ -1584,7 +1585,8 @@ static Value *getNaturalGEPWithOffset(IRBuilderTy &IRB, const DataLayout &DL,
1584
1585
// / a single GEP as possible, thus making each GEP more independent of the
1585
1586
// / surrounding code.
1586
1587
static Value *getAdjustedPtr (IRBuilderTy &IRB, const DataLayout &DL, Value *Ptr,
1587
- APInt Offset, Type *PointerTy, Twine NamePrefix) {
1588
+ APInt Offset, Type *PointerTy,
1589
+ const Twine &NamePrefix) {
1588
1590
// Even though we don't look through PHI nodes, we could be called on an
1589
1591
// instruction in an unreachable block, which may be on a cycle.
1590
1592
SmallPtrSet<Value *, 4 > Visited;
0 commit comments