summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Constants.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2011-02-06 21:44:57 +0000
committerChris Lattner <sabre@nondot.org>2011-02-06 21:44:57 +0000
commit35315d065b74537c1290767d0b8da9ca2036fdea (patch)
treee00a09050e0a4552c4a0ecb533c550fea4daa41a /llvm/lib/VMCore/Constants.cpp
parentb54605b8e22fa620bb843637cc15bc74aac9aed5 (diff)
downloadbcm5719-llvm-35315d065b74537c1290767d0b8da9ca2036fdea.tar.gz
bcm5719-llvm-35315d065b74537c1290767d0b8da9ca2036fdea.zip
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 llvm-svn: 124992
Diffstat (limited to 'llvm/lib/VMCore/Constants.cpp')
-rw-r--r--llvm/lib/VMCore/Constants.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index 62117b22e6c..d2359e5bcda 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud