[llvm] [clang] [ValueTracking] Add dominating condition support in computeKnownBits() (PR #73662)

Björn Pettersson via cfe-commits cfe-commits at lists.llvm.org
Mon Dec 11 07:25:50 PST 2023


bjope wrote:

> @bjope It looks like the InstCombine changes enable IndVars to perform LFTR, which is unprofitable in this case. Though the `umax(1)` call is actually completely unnecessary here, but SCEV doesn't realize it. I've put up #75039 to fix that. Does that improve things for you?

@nikic , thanks!
I was thinking that maybe I would need to do something to please the SCEVExpander::isHighCostExpansionHelper to prevent the IndVar transform. But with #75039 I no longer see the problem umax instructions appearing (and increasing the IR instruction count).
I still see some other regressions, but that could be due to limitations in the backend. I haven't found anything more that I can blame on this patch.

https://github.com/llvm/llvm-project/pull/73662


More information about the cfe-commits mailing list