From 8b1fa076397555968ffa7dcda5ef91715cec5c8e Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Sat, 25 May 2019 14:11:55 +0000 Subject: [CVP] Remove unnecessary checks for empty GNWR; NFC The guaranteed no-wrap region is never empty, it always contains at least zero, so these optimizations don't ever apply. To make this more obviously true, replace the conversative return in makeGNWR with an assertion. llvm-svn: 361698 --- llvm/lib/IR/ConstantRange.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'llvm/lib/IR/ConstantRange.cpp') diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp index 549886271ff..0d44c3815b3 100644 --- a/llvm/lib/IR/ConstantRange.cpp +++ b/llvm/lib/IR/ConstantRange.cpp @@ -238,8 +238,7 @@ ConstantRange::makeGuaranteedNoWrapRegion(Instruction::BinaryOps BinOp, switch (BinOp) { default: - // Conservative answer: empty set - return getEmpty(BitWidth); + llvm_unreachable("Unsupported binary op"); case Instruction::Add: { if (Unsigned) -- cgit v1.2.3