mirror of
https://github.com/intel/llvm.git
synced 2026-01-22 15:41:35 +08:00
[VPlan] Use correct non-FMF constructor in VPInstructionWithType createNaryOp (#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 #129508
This commit is contained in:
@@ -177,8 +177,11 @@ public:
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user