aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorLuke Lau <luke@igalia.com>2025-03-20 17:38:56 +0900
committerGitHub <noreply@github.com>2025-03-20 16:38:56 +0800
commit01f04252b6711e281d9569172302ec20789e9bbe (patch)
tree1ffe4c554c121f3144109ae641d5519a78ffe205 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent0738f706151b41063d09b2dc349cabd471b2476e (diff)
downloadllvm-01f04252b6711e281d9569172302ec20789e9bbe.zip
llvm-01f04252b6711e281d9569172302ec20789e9bbe.tar.gz
llvm-01f04252b6711e281d9569172302ec20789e9bbe.tar.bz2
[LV] Get FMFs from VectorBuilder in createSimpleReduction. NFC (#132017)
The other createSimpleReduction takes the FMFs from the IRBuilder, so this aligns the VectorBuilder variant to do the same and reduce the possibility of there being a mismatch in flags.
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index 41f43a2..96d7b33 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1333,14 +1333,15 @@ Value *llvm::createSimpleReduction(IRBuilderBase &Builder, Value *Src,
}
Value *llvm::createSimpleReduction(VectorBuilder &VBuilder, Value *Src,
- RecurKind Kind, FastMathFlags FMFs) {
+ RecurKind Kind) {
assert(!RecurrenceDescriptor::isAnyOfRecurrenceKind(Kind) &&
!RecurrenceDescriptor::isFindLastIVRecurrenceKind(Kind) &&
"AnyOf or FindLastIV reductions are not supported.");
Intrinsic::ID Id = getReductionIntrinsicID(Kind);
auto *SrcTy = cast<VectorType>(Src->getType());
Type *SrcEltTy = SrcTy->getElementType();
- Value *Iden = getRecurrenceIdentity(Kind, SrcEltTy, FMFs);
+ Value *Iden =
+ getRecurrenceIdentity(Kind, SrcEltTy, VBuilder.getFastMathFlags());
Value *Ops[] = {Iden, Src};
return VBuilder.createSimpleReduction(Id, SrcTy, Ops);
}