Skip to content

Commit 5c12991

Browse files
author
git apple-llvm automerger
committed
Merge commit '83fbe56f28d8' from llvm.org/main into next
2 parents 8d32322 + 83fbe56 commit 5c12991

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

llvm/lib/Target/AArch64/AArch64LoopIdiomTransform.cpp

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -586,15 +586,13 @@ Value *AArch64LoopIdiomTransform::expandFindMismatch(
586586
Type *SVELoadType = ScalableVectorType::get(Builder.getInt8Ty(), 16);
587587
Value *Passthru = ConstantInt::getNullValue(SVELoadType);
588588

589-
Value *SVELhsGep = Builder.CreateGEP(LoadType, PtrA, SVEIndexPhi);
590-
if (GEPA->isInBounds())
591-
cast<GetElementPtrInst>(SVELhsGep)->setIsInBounds(true);
589+
Value *SVELhsGep =
590+
Builder.CreateGEP(LoadType, PtrA, SVEIndexPhi, "", GEPA->isInBounds());
592591
Value *SVELhsLoad = Builder.CreateMaskedLoad(SVELoadType, SVELhsGep, Align(1),
593592
LoopPred, Passthru);
594593

595-
Value *SVERhsGep = Builder.CreateGEP(LoadType, PtrB, SVEIndexPhi);
596-
if (GEPB->isInBounds())
597-
cast<GetElementPtrInst>(SVERhsGep)->setIsInBounds(true);
594+
Value *SVERhsGep =
595+
Builder.CreateGEP(LoadType, PtrB, SVEIndexPhi, "", GEPB->isInBounds());
598596
Value *SVERhsLoad = Builder.CreateMaskedLoad(SVELoadType, SVERhsGep, Align(1),
599597
LoopPred, Passthru);
600598

@@ -670,14 +668,12 @@ Value *AArch64LoopIdiomTransform::expandFindMismatch(
670668
// Load bytes from each array and compare them.
671669
Value *GepOffset = Builder.CreateZExt(IndexPhi, I64Type);
672670

673-
Value *LhsGep = Builder.CreateGEP(LoadType, PtrA, GepOffset);
674-
if (GEPA->isInBounds())
675-
cast<GetElementPtrInst>(LhsGep)->setIsInBounds(true);
671+
Value *LhsGep =
672+
Builder.CreateGEP(LoadType, PtrA, GepOffset, "", GEPA->isInBounds());
676673
Value *LhsLoad = Builder.CreateLoad(LoadType, LhsGep);
677674

678-
Value *RhsGep = Builder.CreateGEP(LoadType, PtrB, GepOffset);
679-
if (GEPB->isInBounds())
680-
cast<GetElementPtrInst>(RhsGep)->setIsInBounds(true);
675+
Value *RhsGep =
676+
Builder.CreateGEP(LoadType, PtrB, GepOffset, "", GEPB->isInBounds());
681677
Value *RhsLoad = Builder.CreateLoad(LoadType, RhsGep);
682678

683679
Value *MatchCmp = Builder.CreateICmpEQ(LhsLoad, RhsLoad);

0 commit comments

Comments
 (0)