[PATCH] D108837: [SimplifyCFG] Ignore free instructions when computing cost for folding branch to common dest

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 11:49:03 PDT 2021


lebedev.ri requested changes to this revision.
lebedev.ri added a comment.
This revision now requires changes to proceed.

Could you please split this into

1. introducing `instruction::isvectorop`
2. adding bonus when vector ops are present? i'm not sure it should be an increment, and i don't think this is the right function
3. rest of the patch?



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3140
 
+static bool isVectorOp(Instruction &I) {
+  return I.getType()->isVectorTy() || any_of(I.operands(), [](Use &U) {
----------------
I think this should be in `Instruction`.
Is there any instruction that takes scalars only but produces vector?


================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3230
   unsigned NumBonusInsts = 0;
+  unsigned VectorBonusThreshold = 0;
   const unsigned PredCount = Preds.size();
----------------
I think this should be a `cl::opt`, and applied as a multiplier to `BonusInstThreshold`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D108837/new/

https://reviews.llvm.org/D108837



More information about the llvm-commits mailing list