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

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 30 12:18:28 PDT 2021


aeubanks added a comment.

In D108837#2972861 <https://reviews.llvm.org/D108837#2972861>, @lebedev.ri wrote:

> 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?

D108935 <https://reviews.llvm.org/D108935>



================
Comment at: llvm/lib/Transforms/Utils/SimplifyCFG.cpp:3140
 
+static bool isVectorOp(Instruction &I) {
+  return I.getType()->isVectorTy() || any_of(I.operands(), [](Use &U) {
----------------
lebedev.ri wrote:
> I think this should be in `Instruction`.
> Is there any instruction that takes scalars only but produces vector?
`Instruction` doesn't have methods that inspect the operands (except some equality methods). Currently this is specific to SimplifyCFG so I think at least for now it should be here.

Not sure if any instruction takes scalars and produces vectors, but those should count?


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