From 252030e86b4cd252eadf702356ff3a7951247276 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 3 Sep 2002 20:09:49 +0000 Subject: [PATCH] Implement setcc for booleans. Fixes bug: test/Regression/Transforms/ConstProp/2002-09-03-SetCC-Bools.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3576 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantFold.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 5115ede9a1f..185468e8786 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -254,6 +254,10 @@ struct EmptyRules : public TemplateRules { // struct BoolRules : public TemplateRules { + static ConstantBool *LessThan(const ConstantBool *V1, const ConstantBool *V2){ + return ConstantBool::get(V1->getValue() < V2->getValue()); + } + static Constant *And(const ConstantBool *V1, const ConstantBool *V2) { return ConstantBool::get(V1->getValue() & V2->getValue()); }