[llvm] [VPlan] Add scalar inferencing support for Not and Or insns (PR #89160)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 18 06:05:27 PDT 2024


================
@@ -44,8 +45,9 @@ Type *VPTypeAnalysis::inferScalarTypeForRecipe(const VPInstruction *R) {
     CachedTypes[OtherV] = ResTy;
     return ResTy;
   }
+  case VPInstruction::Not:
----------------
fhahn wrote:

`Not` should only be used to negate booleans (or vectors of bools); Would probably be better to return `IntegerType::get(Ctx, 1);` like for `FCmp/ICmp` and assert that the inferred type of the operand is also `i1`.

(The reason why `PtrAdd` doesn't return `PointerType::get()` but infers the type of the pointer arg is due to address spaces)

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


More information about the llvm-commits mailing list