[PATCH] D139609: [AArch64][DAGCombiner] fold instruction BIC from ISD::AND

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 19 00:15:59 PST 2022


dmgreen added a comment.

> The headache thing here is DAGCombiner will revert the pattern to the origin if I use standard node. So I try to add a new AArch64ISD.



> Maybe I can put the transform to after legalize to make sure standard nodes exist longer.

Putting the transform late can certainly help, thats a good option if it is needed. It can sometimes be better to just prevent the DAG combine that is going in the wrong direction. There are a set of methods like shouldFoldConstantShiftPairToMask and isDesirableToCommuteWithShift that can be used by the target to control how the DAGCombiner acts. There can be problems if the transform is towards a canonical form that other DAG combines rely upon, but it sounds like in this case it might be easy enough to add?


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

https://reviews.llvm.org/D139609



More information about the llvm-commits mailing list