[llvm] [clang] [clang-tools-extra] [VPlan] Add new VPUniformPerUFRecipe, use for step truncation. (PR #78113)

via cfe-commits cfe-commits at lists.llvm.org
Sun Jan 21 23:04:34 PST 2024


================
@@ -504,6 +504,15 @@ static VPValue *createScalarIVSteps(VPlan &Plan, const InductionDescriptor &ID,
     HeaderVPBB->insert(BaseIV->getDefiningRecipe(), IP);
   }
 
+  VPTypeAnalysis TypeInfo(SE.getContext());
+  if (TypeInfo.inferScalarType(BaseIV) != TypeInfo.inferScalarType(Step)) {
+    Step = new VPScalarCastRecipe(Instruction::Trunc, Step,
----------------
ayalz wrote:

Does this recipe only generate Trunc? No need to hold an Opcode, can be renamed VPScalarTruncRecipe. Assert that the type sizes correspond to Trunc?

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


More information about the cfe-commits mailing list