From 35bda8914c0d1c02a6f90f42e7810c83150737e1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 6 Feb 2011 21:44:57 +0000 Subject: enhance vmcore to know that udiv's can be exact, and add a trivial instcombine xform to exercise this. Nothing forms exact udivs yet though. This is progress on PR8862 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/Constants.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/VMCore/Constants.cpp') diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp index 62117b22e6..d2359e5bcd 100644 --- a/lib/VMCore/Constants.cpp +++ b/lib/VMCore/Constants.cpp @@ -683,7 +683,12 @@ Constant* ConstantExpr::getNUWMul(Constant* C1, Constant* C2) { Constant* ConstantExpr::getExactSDiv(Constant* C1, Constant* C2) { return getTy(C1->getType(), Instruction::SDiv, C1, C2, - SDivOperator::IsExact); + PossiblyExactOperator::IsExact); +} + +Constant* ConstantExpr::getExactUDiv(Constant* C1, Constant* C2) { + return getTy(C1->getType(), Instruction::UDiv, C1, C2, + PossiblyExactOperator::IsExact); } // Utility function for determining if a ConstantExpr is a CastOp or not. This -- cgit v1.2.3-70-g09d2