[InstCombine] add helper for icmp with dominator; NFC
authorSanjay Patel <spatel@rotateright.com>
Tue, 4 Dec 2018 15:35:17 +0000 (15:35 +0000)
committerSanjay Patel <spatel@rotateright.com>
Tue, 4 Dec 2018 15:35:17 +0000 (15:35 +0000)
commita40bf9fff7ee71d20451a3d0e380a85646e3a7df
tree1e16f9b3c8c09b6f6bde81ca484d9a47d0f36d09
parent2c1ff9dda762e010075f429e18ce1c499f1f4d0e
[InstCombine] add helper for icmp with dominator; NFC

There's a potential small enhancement to this code that could
solve the cases currently under proposal in D54827 via SimplifyCFG.

Whether instcombine should be doing this kind of semi-non-local
analysis in the first place is an open question, but separating
the logic out can only help if/when we decide to move it to a
different pass.

AFAICT, any proposal to do this in SimplifyCFG could also be seen
as an overreach + it would be incomplete to start the fold from a
branch rather than an icmp.

There's another question here about the code for processUGT_ADDCST_ADD().
That part may be completely dead after rL234638 ?

llvm-svn: 348273
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h