[PATCH] D58877: [InstCombine] fold add(add(A, ~B), 1) -> sub(A, B)

Amaury SECHET via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 12 12:59:22 PDT 2019


deadalnix added a comment.

@spatel I'm not sure, you tell me :) The history of this patch is that this pattern shows up in practice post legalization, so I submitted a patch for it for DAGCombiner. From there, @ lebedev.ri noticed that InstCombine wasn't doing it and suggested it to be added there as well.

As far as I can tell, -reassociate also fails to trigger this transform: https://godbolt.org/z/gweK6j


Repository:
  rL LLVM

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

https://reviews.llvm.org/D58877





More information about the llvm-commits mailing list