[llvm] 5afef79 - [NFC, StackSafety] Remove duplicate code
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Tue May 26 18:09:58 PDT 2020
Author: Vitaly Buka
Date: 2020-05-26T18:09:43-07:00
New Revision: 5afef79ff465e1711a9412f6814d66ff80f50dcf
URL: https://github.com/llvm/llvm-project/commit/5afef79ff465e1711a9412f6814d66ff80f50dcf
DIFF: https://github.com/llvm/llvm-project/commit/5afef79ff465e1711a9412f6814d66ff80f50dcf.diff
LOG: [NFC, StackSafety] Remove duplicate code
Added:
Modified:
llvm/lib/Analysis/StackSafetyAnalysis.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Analysis/StackSafetyAnalysis.cpp b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
index 4985647c29d4..223f99804bda 100644
--- a/llvm/lib/Analysis/StackSafetyAnalysis.cpp
+++ b/llvm/lib/Analysis/StackSafetyAnalysis.cpp
@@ -242,14 +242,7 @@ StackSafetyLocalAnalysis::getAccessRange(Value *Addr, Value *Base,
if (SizeRange.isEmptySet())
return ConstantRange::getEmpty(PointerSize);
- if (!SE.isSCEVable(Addr->getType()))
- return UnknownRange;
-
- AllocaOffsetRewriter Rewriter(SE, Base);
- const SCEV *Expr = Rewriter.visit(SE.getSCEV(Addr));
-
- ConstantRange AccessStartRange =
- SE.getUnsignedRange(Expr).zextOrTrunc(PointerSize);
+ ConstantRange AccessStartRange = offsetFrom(Addr, Base);
ConstantRange AccessRange = AccessStartRange.add(SizeRange);
assert(!AccessRange.isEmptySet());
return AccessRange;
More information about the llvm-commits
mailing list