[llvm] [LV] Support binary and unary operations with EVL-vectorization (PR #93854)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Sun Jul 14 12:42:26 PDT 2024
================
@@ -1375,6 +1382,45 @@ class VPWidenRecipe : public VPRecipeWithIRFlags {
#endif
};
+class VPWidenEVLRecipe : public VPWidenRecipe {
+ using VPRecipeWithIRFlags::transferFlags;
+
+public:
+ template <typename IterT>
+ VPWidenEVLRecipe(Instruction &I, iterator_range<IterT> Operands, VPValue &EVL)
+ : VPWidenRecipe(VPDef::VPWidenEVLSC, I, Operands) {
+ addOperand(&EVL);
+ }
+ VPWidenEVLRecipe(VPWidenRecipe *W, VPValue &EVL)
+ : VPWidenEVLRecipe(*W->getUnderlyingInstr(), W->operands(), EVL) {
+ this->transferFlags(*W);
+ }
+
+ ~VPWidenEVLRecipe() override = default;
+
+ VPWidenRecipe *clone() override final {
+ llvm_unreachable("VPWidenStoreEVLRecipe cannot be cloned");
+ return nullptr;
+ }
+
+ VP_CLASSOF_IMPL(VPDef::VPWidenEVLSC);
+
+ VPValue *getEVL() { return getOperand(getNumOperands() - 1); }
+ const VPValue *getEVL() const { return getOperand(getNumOperands() - 1); }
+
+ /// Produce widened copies of all Ingredients.
----------------
fhahn wrote:
nit: there is only a single ingredient
https://github.com/llvm/llvm-project/pull/93854
More information about the llvm-commits
mailing list