From 332c10056227d5da5557f50e8c64dc8814ca56f0 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Tue, 28 May 2019 18:08:31 +0000 Subject: [ValueTracking][ConstantRange] Distinguish low/high always overflow In order to fold an always overflowing signed saturating add/sub, we need to know in which direction the always overflow occurs. This patch splits up AlwaysOverflows into AlwaysOverflowsLow and AlwaysOverflowsHigh to pass through this information (but it is not used yet). Differential Revision: https://reviews.llvm.org/D62463 llvm-svn: 361858 --- llvm/lib/Analysis/ValueTracking.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Analysis/ValueTracking.cpp') diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index d46ddc428b2..640063700e8 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -3992,8 +3992,10 @@ static OverflowResult mapOverflowResult(ConstantRange::OverflowResult OR) { switch (OR) { case ConstantRange::OverflowResult::MayOverflow: return OverflowResult::MayOverflow; - case ConstantRange::OverflowResult::AlwaysOverflows: - return OverflowResult::AlwaysOverflows; + case ConstantRange::OverflowResult::AlwaysOverflowsLow: + return OverflowResult::AlwaysOverflowsLow; + case ConstantRange::OverflowResult::AlwaysOverflowsHigh: + return OverflowResult::AlwaysOverflowsHigh; case ConstantRange::OverflowResult::NeverOverflows: return OverflowResult::NeverOverflows; } -- cgit v1.2.3