[PATCH] Add a Scalarize pass

Richard Sandiford rsandifo at linux.vnet.ibm.com
Wed Nov 13 05:54:25 PST 2013


  Renato Golin <renato.golin at linaro.org> writes:
  >>  We're always going
  >>   to scalarise eventually, whether it's at the IR level or at the CodeGen
  >>   level, and doing it at the IR level is preferable because it exposes more
  >>   optimisation opportunities.
  >>
  >
  > This is a good point, but still strikes me as a front-end option. There are
  > many front-end options that are enabled by default on certain targets.

  Do you mean front ends enable the options by default for specific targets,
  or that LLVM presents the options to front ends but sets their defaults
  based on the target?  If the latter, that'd certainly be fine with me.
  If the former, then it seems like we'd have to duplicate knowledge about
  the (lack of) vector capabilities of a target in LLVM and in any front
  end that might need to handle vectorised input.

  Since scalarisation happens anyway, I think this is more about knowing the
  best order for doing things rather than deciding whether something is done
  at all.

  >   Although the pass is added to the PassManagerBuilder by default, it
  >> doesn't
  >>   do anything unless the target wants it to.
  >>
  >
  > It should be a matter of features, not targets. Anyway, is there any other
  > pass that has this kind of target-specific behaviour?

  Like you say, isn't the vectoriser itself one of them?  We have passes
  that convert scalar operations to vector operations based on target
  properties, and this patch is adding a pass that converts vector
  operations to scalar operations based on target properties.

  Thanks,
  Richard

http://llvm-reviews.chandlerc.com/D2112



More information about the llvm-commits mailing list