diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-12-04 22:55:57 -0500 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2022-12-12 22:57:44 -0500 |
commit | 28e3220a5cb4194399c25a17281cc18f19b3fd3c (patch) | |
tree | 37f710ef9c0bbb3ac68e6e4e9767af40e180d525 /llvm/lib | |
parent | 2ab44989762aa0fa84ff01eea7d3159100f52157 (diff) | |
download | llvm-28e3220a5cb4194399c25a17281cc18f19b3fd3c.zip llvm-28e3220a5cb4194399c25a17281cc18f19b3fd3c.tar.gz llvm-28e3220a5cb4194399c25a17281cc18f19b3fd3c.tar.bz2 |
ValueTracking: Teach canCreateUndefOrPoison about FP ops
Probably could replace the switch by marking the intrinsic definitions
with NoUndef<RetIndex>.
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index a514bde..584e645 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -5208,6 +5208,42 @@ static bool canCreateUndefOrPoison(const Operator *Op, bool PoisonOnly, case Intrinsic::uadd_with_overflow: case Intrinsic::usub_with_overflow: case Intrinsic::umul_with_overflow: + case Intrinsic::fma: + case Intrinsic::fmuladd: + case Intrinsic::sqrt: + case Intrinsic::powi: + case Intrinsic::sin: + case Intrinsic::cos: + case Intrinsic::pow: + case Intrinsic::log: + case Intrinsic::log10: + case Intrinsic::log2: + case Intrinsic::exp: + case Intrinsic::exp2: + case Intrinsic::fabs: + case Intrinsic::copysign: + case Intrinsic::floor: + case Intrinsic::ceil: + case Intrinsic::trunc: + case Intrinsic::rint: + case Intrinsic::nearbyint: + case Intrinsic::round: + case Intrinsic::roundeven: + case Intrinsic::fptrunc_round: + case Intrinsic::canonicalize: + case Intrinsic::arithmetic_fence: + case Intrinsic::minnum: + case Intrinsic::maxnum: + case Intrinsic::minimum: + case Intrinsic::maximum: + case Intrinsic::is_fpclass: + return false; + case Intrinsic::lround: + case Intrinsic::llround: + case Intrinsic::lrint: + case Intrinsic::llrint: + // If the value doesn't fit an unspecified value is returned (but this + // is not poison). return false; } } @@ -5246,6 +5282,11 @@ static bool canCreateUndefOrPoison(const Operator *Op, bool PoisonOnly, case Instruction::Freeze: case Instruction::ICmp: case Instruction::FCmp: + case Instruction::FAdd: + case Instruction::FSub: + case Instruction::FMul: + case Instruction::FDiv: + case Instruction::FRem: return false; case Instruction::GetElementPtr: // inbounds is handled above |