[llvm] [ConstraintElim] Simplify `MinMaxIntrinsic` (PR #75306)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 22:04:27 PST 2024
================
@@ -1392,6 +1396,31 @@ static bool checkAndReplaceCondition(
return false;
}
+static bool checkAndReplaceMinMax(MinMaxIntrinsic *MinMax, ConstraintInfo &Info,
+ unsigned NumIn, unsigned NumOut,
+ Instruction *ContextInst, DominatorTree &DT,
+ SmallVectorImpl<Instruction *> &ToRemove) {
+ auto ReplaceMinMaxWithOperand = [&](MinMaxIntrinsic *MinMax, bool UseLHS) {
+ // TODO: generate reproducer for min/max.
+ MinMax->replaceAllUsesWith(MinMax->getOperand(UseLHS ? 0 : 1));
+ if (MinMax->use_empty())
----------------
dtcxzyw wrote:
Done.
https://github.com/llvm/llvm-project/pull/75306
More information about the llvm-commits
mailing list