[llvm] [VPlan] Always set flags for overflowing ops etc via VPIRFlags. (PR #179138)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 2 04:30:12 PST 2026


================
@@ -2052,6 +2056,52 @@ VPIRFlags::FastMathFlagsTy::FastMathFlagsTy(const FastMathFlags &FMF) {
   ApproxFunc = FMF.approxFunc();
 }
 
+VPIRFlags VPIRFlags::getDefaultFlags(unsigned Opcode) {
+  switch (Opcode) {
+  case Instruction::Add:
+  case Instruction::Sub:
+  case Instruction::Mul:
+  case Instruction::Shl:
+  case VPInstruction::CanonicalIVIncrementForPart:
+    return WrapFlagsTy(false, false);
+  case Instruction::Trunc:
+    return TruncFlagsTy(false, false);
+  case Instruction::Or:
+    return DisjointFlagsTy(false);
+  case Instruction::AShr:
+  case Instruction::LShr:
+  case Instruction::UDiv:
+  case Instruction::SDiv: {
+    VPIRFlags F;
+    F.OpType = OperationType::PossiblyExactOp;
----------------
fhahn wrote:

There was a missing constructor, added thanks

https://github.com/llvm/llvm-project/pull/179138


More information about the llvm-commits mailing list