aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2021-02-01 14:21:24 -0500
committerSanjay Patel <spatel@rotateright.com>2021-02-01 16:21:36 -0500
commitbbed5f2f8a04ae3a49f5e8f900c117f405101424 (patch)
tree16d8ccc16ce40d188222f5698bc1d7dce62af750 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent68f66f37d7d74be7beba56506c4397dadc8538dd (diff)
downloadllvm-bbed5f2f8a04ae3a49f5e8f900c117f405101424.zip
llvm-bbed5f2f8a04ae3a49f5e8f900c117f405101424.tar.gz
llvm-bbed5f2f8a04ae3a49f5e8f900c117f405101424.tar.bz2
[LoopVectorize] improve IR fast-math-flags propagation in reductions
This is another step (see D95452) towards correcting fast-math-flags bugs in vector reductions. There are multiple bugs visible in the test diffs, and this is still not working as it should. We still use function attributes (rather than FMF) to drive part of the logic, but we are not checking for the correct FP function attributes. Note that FMF may not be propagated optimally on selects (example in https://llvm.org/PR35607 ). That's why I'm proposing to union the FMF of a fcmp+select pair and avoid regressions on existing vectorizer tests. Differential Revision: https://reviews.llvm.org/D95690
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp6
1 files changed, 0 insertions, 6 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 5c66cb0..07dc3ac 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -944,12 +944,6 @@ Value *llvm::createMinMaxOp(IRBuilderBase &Builder, RecurKind RK, Value *Left,
break;
}
- // We only match FP sequences that are 'fast', so we can unconditionally
- // set it on any generated instructions.
- IRBuilderBase::FastMathFlagGuard FMFG(Builder);
- FastMathFlags FMF;
- FMF.setFast();
- Builder.setFastMathFlags(FMF);
Value *Cmp = Builder.CreateCmp(Pred, Left, Right, "rdx.minmax.cmp");
Value *Select = Builder.CreateSelect(Cmp, Left, Right, "rdx.minmax.select");
return Select;