[llvm] [PowePC] using MTVSRBMI instruction instead of constant pool in power10+ (PR #144084)

Lei Huang via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 13:13:49 PDT 2025


================
@@ -9580,6 +9580,37 @@ static bool isValidSplatLoad(const PPCSubtarget &Subtarget, const SDValue &Op,
   return false;
 }
 
+bool isValidMtVsrbmi(APInt &BMI, BuildVectorSDNode &BVN) {
+  unsigned int NumOps = BVN.getNumOperands();
+  assert(NumOps > 0 && "isConstantSplat has 0-size build vector");
+
+  BMI.clearAllBits();
+  EVT VT = BVN.getValueType(0);
+  APInt ConstValue(VT.getSizeInBits(), 0);
+
+  unsigned EltWidth = VT.getScalarSizeInBits();
+
+  for (unsigned j = 0; j < NumOps; ++j) {
----------------
lei137 wrote:

Since BuildVectorSDNode is super class of SDNode, can we not use range based for loop to iterate over the operands?

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


More information about the llvm-commits mailing list