Skip to content

Commit e44d3b3

Browse files
authored
ValueTracking: Merge fcmpImpliesClass and fcmpToClassTest (#66522)
Rushing this one out before vacation starts. Refactoring on top of #66505
1 parent f826f55 commit e44d3b3

File tree

3 files changed

+151
-123
lines changed

3 files changed

+151
-123
lines changed

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,10 @@ std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
214214
const APFloat *ConstRHS,
215215
bool LookThroughSrc = true);
216216

217-
/// Compute the possible floating-point classes that \p LHS could be based on an
218-
/// fcmp returning true. Returns { TestedValue, ClassesIfTrue, ClassesIfFalse }
217+
/// Compute the possible floating-point classes that \p LHS could be based on
218+
/// fcmp \Pred \p LHS, \p RHS.
219+
///
220+
/// \returns { TestedValue, ClassesIfTrue, ClassesIfFalse }
219221
///
220222
/// If the compare returns an exact class test, ClassesIfTrue == ~ClassesIfFalse
221223
///
@@ -230,10 +232,13 @@ std::pair<Value *, FPClassTest> fcmpToClassTest(CmpInst::Predicate Pred,
230232
///
231233
std::tuple<Value *, FPClassTest, FPClassTest>
232234
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
233-
const APFloat *ConstRHS, bool LookThroughSrc = true);
235+
Value *RHS, bool LookThroughSrc = true);
234236
std::tuple<Value *, FPClassTest, FPClassTest>
235237
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
236-
Value *RHS, bool LookThroughSrc = true);
238+
FPClassTest RHS, bool LookThroughSrc = true);
239+
std::tuple<Value *, FPClassTest, FPClassTest>
240+
fcmpImpliesClass(CmpInst::Predicate Pred, const Function &F, Value *LHS,
241+
const APFloat &RHS, bool LookThroughSrc = true);
237242

238243
struct KnownFPClass {
239244
/// Floating-point classes the value could be one of.

0 commit comments

Comments
 (0)