diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2016-07-20 16:30:55 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2016-07-20 16:30:55 +0000 |
| commit | be53c65fab8b240a8bbc804dec012ab0cf1422f4 (patch) | |
| tree | 68ad4abd5a596f65884fd8315c3858eee36cb57d | |
| parent | 018259cd9bdb0b2ccfe2fda1b4a465a57a5b4f26 (diff) | |
| download | bcm5719-llvm-be53c65fab8b240a8bbc804dec012ab0cf1422f4.tar.gz bcm5719-llvm-be53c65fab8b240a8bbc804dec012ab0cf1422f4.zip | |
fix documentation comments; NFC
llvm-svn: 276135
| -rw-r--r-- | llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h | 22 | ||||
| -rw-r--r-- | llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp | 32 |
2 files changed, 11 insertions, 43 deletions
diff --git a/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h b/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h index 73c15e42c35..ed58765ca3f 100644 --- a/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h +++ b/llvm/include/llvm/Transforms/Utils/CmpInstAnalysis.h @@ -21,13 +21,13 @@ namespace llvm { class ICmpInst; class Value; - /// getICmpCode - Encode a icmp predicate into a three bit mask. These bits - /// are carefully arranged to allow folding of expressions such as: + /// Encode a icmp predicate into a three bit mask. These bits are carefully + /// arranged to allow folding of expressions such as: /// /// (A < B) | (A > B) --> (A != B) /// /// Note that this is only valid if the first and second predicates have the - /// same sign. Is illegal to do: (A u< B) | (A s> B) + /// same sign. It is illegal to do: (A u< B) | (A s> B) /// /// Three bits are used to represent the condition, as follows: /// 0 A > B @@ -46,18 +46,18 @@ namespace llvm { /// unsigned getICmpCode(const ICmpInst *ICI, bool InvertPred = false); - /// getICmpValue - This is the complement of getICmpCode, which turns an - /// opcode and two operands into either a constant true or false, or the - /// predicate for a new ICmp instruction. The sign is passed in to determine - /// which kind of predicate to use in the new icmp instruction. + /// This is the complement of getICmpCode, which turns an opcode and two + /// operands into either a constant true or false, or the predicate for a new + /// ICmp instruction. The sign is passed in to determine which kind of + /// predicate to use in the new icmp instruction. /// Non-NULL return value will be a true or false constant. - /// NULL return means a new ICmp is needed. The predicate for which is - /// output in NewICmpPred. + /// NULL return means a new ICmp is needed. The predicate for which is output + /// in NewICmpPred. Value *getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, CmpInst::Predicate &NewICmpPred); - /// PredicatesFoldable - Return true if both predicates match sign or if at - /// least one of them is an equality comparison (which is signless). + /// Return true if both predicates match sign or if at least one of them is an + /// equality comparison (which is signless). bool PredicatesFoldable(CmpInst::Predicate p1, CmpInst::Predicate p2); } // end namespace llvm diff --git a/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp b/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp index 3b15a0a3e60..0b13005ca07 100644 --- a/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp +++ b/llvm/lib/Transforms/Utils/CmpInstAnalysis.cpp @@ -18,29 +18,6 @@ using namespace llvm; -/// getICmpCode - Encode a icmp predicate into a three bit mask. These bits -/// are carefully arranged to allow folding of expressions such as: -/// -/// (A < B) | (A > B) --> (A != B) -/// -/// Note that this is only valid if the first and second predicates have the -/// same sign. Is illegal to do: (A u< B) | (A s> B) -/// -/// Three bits are used to represent the condition, as follows: -/// 0 A > B -/// 1 A == B -/// 2 A < B -/// -/// <=> Value Definition -/// 000 0 Always false -/// 001 1 A > B -/// 010 2 A == B -/// 011 3 A >= B -/// 100 4 A < B -/// 101 5 A != B -/// 110 6 A <= B -/// 111 7 Always true -/// unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) { ICmpInst::Predicate Pred = InvertPred ? ICI->getInversePredicate() : ICI->getPredicate(); @@ -62,13 +39,6 @@ unsigned llvm::getICmpCode(const ICmpInst *ICI, bool InvertPred) { } } -/// getICmpValue - This is the complement of getICmpCode, which turns an -/// opcode and two operands into either a constant true or false, or the -/// predicate for a new ICmp instruction. The sign is passed in to determine -/// which kind of predicate to use in the new icmp instruction. -/// Non-NULL return value will be a true or false constant. -/// NULL return means a new ICmp is needed. The predicate for which is -/// output in NewICmpPred. Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, CmpInst::Predicate &NewICmpPred) { switch (Code) { @@ -87,8 +57,6 @@ Value *llvm::getICmpValue(bool Sign, unsigned Code, Value *LHS, Value *RHS, return nullptr; } -/// PredicatesFoldable - Return true if both predicates match sign or if at -/// least one of them is an equality comparison (which is signless). bool llvm::PredicatesFoldable(ICmpInst::Predicate p1, ICmpInst::Predicate p2) { return (CmpInst::isSigned(p1) == CmpInst::isSigned(p2)) || (CmpInst::isSigned(p1) && ICmpInst::isEquality(p2)) || |

