[PATCH] D104832: [TargetLowering][ARM] Don't alter opaque constants in TargetLowering::ShrinkDemandedConstant.
Roger Ferrer Ibanez via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 24 03:34:57 PDT 2021
rogfer01 added a comment.
In D104832#2838062 <https://reviews.llvm.org/D104832#2838062>, @dmgreen wrote:
> 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.
Thanks a lot for the explanation David, makes sense.
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