[PATCH] D104832: [TargetLowering][ARM] Don't alter opaque constants in TargetLowering::ShrinkDemandedConstant.

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 24 02:30:39 PDT 2021


dmgreen added a comment.

In D104832#2838001 <https://reviews.llvm.org/D104832#2838001>, @rogfer01 wrote:

> The culprit seems to be a bitcast introduced by `consthoist` but I haven't tried to understand what it is doing to be honest. It looks like it is trying hard to push a constant into a (named) value (perhaps we want the constant materialised at all costs) and bitcast is a hackish way to achieve this?

Yep. Constant hoisting pulls expensive constants out of the code, in order to only materialize them once. It uses a bitcast to do that, which in turn is expected to produce an opaque constant. That never seemed like a great way of doing it to me, but apparently it is fairly important for codesize in some cases. It's controlled through the costs of getIntImmCostInst, and v6m will have fairly high costs for a lot of constants.

I don't think there is much point in pulling constants out into the same block, but that seems like a separate issue.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104832



More information about the llvm-commits mailing list