[PATCH] D137433: [DAG] Add canonicalization to avoid redundant nots in concat vectors

Benjamin Maxwell via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 10 09:22:24 PST 2022


benmxwl-arm added a comment.

I think this could work for at least a few more binops if adjusted some something like:

   (concat ((truncate (binop x, const_a))),
           ((truncate (binop y, const_b))))
  ->
   (binop (concat (truncate x), (truncate y)), 
          (concat (truncate const_a), (truncate const_b)))

Though that admittedly looks a bit ugly.

However, I think this could be simplified to:

  (concat (binop x const_a) (binop y const_b))
  ->
  (binop (concat x y) (concat const_a const_b))

Though for that to work here the truncate narrowings form D55126 <https://reviews.llvm.org/D55126> would need to apply post-legalization, 
as the initial problem, this patch is trying to solve is entirely an artifact of legalizing vector floating point compares.

I am however, a little less confident making these more general changes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D137433



More information about the llvm-commits mailing list