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

Adrian Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 14 09:34:28 PDT 2022


adriantong1024 added a comment.
Herald added subscribers: jsji, pengfei.
Herald added projects: LLVM, All.

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 !


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