[PATCH] D25374: [DAGCombiner] Update most ADD combines to support general vector combines

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 09:54:50 PDT 2022


RKSimon added a comment.

In D25374#3582196 <https://reviews.llvm.org/D25374#3582196>, @adriantong1024 wrote:

> In D25374#565483 <https://reviews.llvm.org/D25374#565483>, @RKSimon wrote:
>
>> Updated isNonOpaqueConstantOrConstantVector to isNonOpaqueConstantOrNonOpaqueConstantVector to check that no vector elements are opaque constants. Also added isConstantOrConstantVector helper that doesn't care about opaque. Both of these allow undef vector elements.
>>
>> Updated the helpers to not allow implicit truncation in build vectors - this will be necessary for the reuse of these helpers in other combines (e.g. SUB and MUL). This isn't necessary for the isNullConstantOrNullSplatConstant case.
>
> Hi @RKSimon
>
> I know this CR is quite old, I am trying to remove the "not allow implicit truncation" restriction for one optimization. I am somewhat new to this part of the compiler, can you please explain to me why this is necessary for SUB and MUL combines. An example would be great. Thanks !

I can't remember tbh - best way to find out would be for you to remove the restriction and run check-llvm-codegen to see what changes/regresses/asserts/explodes....


Repository:
  rL LLVM

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

https://reviews.llvm.org/D25374



More information about the llvm-commits mailing list