-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[VPlan] Use correct non-FMF constructor in VPInstructionWithType createNaryOp #137632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[VPlan] Use correct non-FMF constructor in VPInstructionWithType createNaryOp #137632
Conversation
…teNaryOp Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
@llvm/pr-subscribers-llvm-transforms Author: Luke Lau (lukel97) ChangesCurrently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by #129508 Full diff: https://github.com/llvm/llvm-project/pull/137632.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index f639f0adb9c43..981ff7fc2364d 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -177,8 +177,11 @@ class VPBuilder {
Type *ResultTy,
std::optional<FastMathFlags> FMFs = {},
DebugLoc DL = {}, const Twine &Name = "") {
- return tryInsertInstruction(new VPInstructionWithType(
- Opcode, Operands, ResultTy, FMFs.value_or(FastMathFlags()), DL, Name));
+ if (FMFs)
+ return tryInsertInstruction(new VPInstructionWithType(
+ Opcode, Operands, ResultTy, *FMFs, DL, Name));
+ return tryInsertInstruction(
+ new VPInstructionWithType(Opcode, Operands, ResultTy, DL, Name));
}
VPInstruction *createOverflowingOp(unsigned Opcode,
|
@llvm/pr-subscribers-vectorizers Author: Luke Lau (lukel97) ChangesCurrently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by #129508 Full diff: https://github.com/llvm/llvm-project/pull/137632.diff 1 Files Affected:
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
index f639f0adb9c43..981ff7fc2364d 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
+++ b/llvm/lib/Transforms/Vectorize/LoopVectorizationPlanner.h
@@ -177,8 +177,11 @@ class VPBuilder {
Type *ResultTy,
std::optional<FastMathFlags> FMFs = {},
DebugLoc DL = {}, const Twine &Name = "") {
- return tryInsertInstruction(new VPInstructionWithType(
- Opcode, Operands, ResultTy, FMFs.value_or(FastMathFlags()), DL, Name));
+ if (FMFs)
+ return tryInsertInstruction(new VPInstructionWithType(
+ Opcode, Operands, ResultTy, *FMFs, DL, Name));
+ return tryInsertInstruction(
+ new VPInstructionWithType(Opcode, Operands, ResultTy, DL, Name));
}
VPInstruction *createOverflowingOp(unsigned Opcode,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/11/builds/14044 Here is the relevant piece of the build log for the reference
|
…teNaryOp (llvm#137632) Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
…teNaryOp (llvm#137632) Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
…teNaryOp (llvm#137632) Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
…teNaryOp (llvm#137632) Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
…teNaryOp (llvm#137632) Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts `assert(isFPMathOp() && "this op can't take fast-math flags");`. This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads. This is needed by llvm#129508
Currently if we try to create a VPInstructionWithType without a FMF via VPBuilder::createNaryOp we will use the constructor that asserts
assert(isFPMathOp() && "this op can't take fast-math flags");
.This fixes it by checking if FMFs have a value, similar to the other createNaryOp overloads.
This is needed by #129508