aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/LoopAccessAnalysis.cpp
diff options
context:
space:
mode:
authorPhilip Reames <preames@rivosinc.com>2022-07-20 11:54:05 -0700
committerPhilip Reames <listmail@philipreames.com>2022-07-20 11:56:45 -0700
commitf494f89b2a88f9de48781f43e7be2386809c7db5 (patch)
tree62444185ec82dac6d86785433c50962206f6faf1 /llvm/lib/Analysis/LoopAccessAnalysis.cpp
parent065202f3ca9d32e32a1d9b2995e779ced64950b2 (diff)
downloadllvm-f494f89b2a88f9de48781f43e7be2386809c7db5.zip
llvm-f494f89b2a88f9de48781f43e7be2386809c7db5.tar.gz
llvm-f494f89b2a88f9de48781f43e7be2386809c7db5.tar.bz2
[LAA] Fix latent missing check bug when mixing scalable and non-scalabe strides
Noticed via inspection; to my knowledge, impossible to hit today. In theory, we could have a fixed stride check be analyzed, then a scalable one. With the old code, the scalable one would be silently dropped, and the runtime guard would go ahead with only the fixed one. This would be a miscompile.
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
-rw-r--r--llvm/lib/Analysis/LoopAccessAnalysis.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Analysis/LoopAccessAnalysis.cpp b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
index f7f0dc4..0bc2e76 100644
--- a/llvm/lib/Analysis/LoopAccessAnalysis.cpp
+++ b/llvm/lib/Analysis/LoopAccessAnalysis.cpp
@@ -293,8 +293,10 @@ void RuntimePointerChecking::tryToCreateDiffCheck(
DC.getInstructionsForAccess(Sink->PointerValue, Sink->IsWritePtr);
Type *SrcTy = getLoadStoreType(SrcInsts[0]);
Type *DstTy = getLoadStoreType(SinkInsts[0]);
- if (isa<ScalableVectorType>(SrcTy) || isa<ScalableVectorType>(DstTy))
+ if (isa<ScalableVectorType>(SrcTy) || isa<ScalableVectorType>(DstTy)) {
+ CanUseDiffCheck = false;
return;
+ }
unsigned AllocSize =
std::max(DL.getTypeAllocSize(SrcTy), DL.getTypeAllocSize(DstTy));
IntegerType *IntTy =