[llvm] [VPlan] Handle calls in VPInstruction:opcodeMayReadOrWriteFromMemory. (PR #190681)
Luke Lau via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 9 23:57:48 PDT 2026
================
@@ -440,6 +440,22 @@ VPInstruction::VPInstruction(unsigned Opcode, ArrayRef<VPValue *> Operands,
"number of operands does not match opcode");
}
+/// For call VPInstructions, return the operand index of the called function and
+/// the called function itself. The function is either the last operand (for
+/// unmasked calls) or the second-to-last operand (for masked calls).
+static std::pair<unsigned, Function *>
+getCalledFunction(const VPInstruction &VPI) {
----------------
lukel97 wrote:
Would it be simpler to split this into two functions, `getCalledFunctionIndex` and `getCalledFunction` will just returns `cast<Function>(cast<VPIRValue>(VPI.getOperand(getCalledFunctionIndex(VPI)))->getValue())`?
https://github.com/llvm/llvm-project/pull/190681
More information about the llvm-commits
mailing list