diff options
author | David Sherwood <57997763+david-arm@users.noreply.github.com> | 2023-11-02 10:02:50 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-02 10:02:50 +0000 |
commit | 07f0e75b5382a70d41adc43b8c08b82389e1e695 (patch) | |
tree | e77ee0a67c40cc5e656297c9811aad810566e8d4 /llvm/lib/Transforms/Utils/LoopUtils.cpp | |
parent | 41cf94e6b8b43f6dec089ab1df03130926d51997 (diff) | |
download | llvm-07f0e75b5382a70d41adc43b8c08b82389e1e695.zip llvm-07f0e75b5382a70d41adc43b8c08b82389e1e695.tar.gz llvm-07f0e75b5382a70d41adc43b8c08b82389e1e695.tar.bz2 |
[LoopVectorize] Fix bug with code to hoist runtime checks (#70937)
There was a silly mistake in the expandBounds function that was using
the wrong type when calling expandCodeFor and always assuming the stride
is 64 bits. I've added the following test to defend this fix:
Transforms/LoopVectorize/ARM/mve-hoist-runtime-checks.ll
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index 21affe7..d14fd09 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -1690,7 +1690,7 @@ static PointerBounds expandBounds(const RuntimeCheckingPtrGroup *CG, End = Builder.CreateFreeze(End, End->getName() + ".fr"); } Value *StrideVal = - Stride ? Exp.expandCodeFor(Stride, Type::getInt64Ty(Ctx), Loc) : nullptr; + Stride ? Exp.expandCodeFor(Stride, Stride->getType(), Loc) : nullptr; LLVM_DEBUG(dbgs() << "Start: " << *Low << " End: " << *High << "\n"); return {Start, End, StrideVal}; } |