Skip to content

Commit 4fa3cfe

Browse files
committed
[ValueTracking][NFC]: Use injected condition to compute known FPClass
1 parent 382ad6f commit 4fa3cfe

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

llvm/include/llvm/Analysis/SimplifyQuery.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ struct InstrInfoQuery {
6262
struct CondContext {
6363
Value *Cond;
6464
bool Invert = false;
65+
// Condition is true if CxtI is in the true successor of Cond.
66+
bool CondIsTrue = false;
6567
SmallPtrSet<Value *, 4> AffectedValues;
6668

6769
CondContext(Value *Cond) : Cond(Cond) {}

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5014,6 +5014,10 @@ static KnownFPClass computeKnownFPClassFromContext(const Value *V,
50145014
const SimplifyQuery &Q) {
50155015
KnownFPClass KnownFromContext;
50165016

5017+
if (Q.CC && Q.CC->AffectedValues.contains(V))
5018+
computeKnownFPClassFromCond(V, Q.CC->Cond, 0, Q.CC->CondIsTrue, Q.CxtI,
5019+
KnownFromContext);
5020+
50175021
if (!Q.CxtI)
50185022
return KnownFromContext;
50195023

0 commit comments

Comments
 (0)