[llvm] [InstCombine] Simplify nested selects with implied condition (PR #83739)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 10:48:02 PST 2024


dtcxzyw wrote:

> This looks basically fine, but I think it may subsume some existing folds?
> 
> For example, what about this one?
> 
> https://github.com/llvm/llvm-project/blob/27ce5121ee875c337dd0f977b00afcb756977f62/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp#L3646-L3651
> 
> There's also foldAndOrOfSelectUsingImpliedCond() -- I think your fold may be the same, but without the limitation that the top-level select is a logical one?

The compile-time improvement looks good:
http://llvm-compile-time-tracker.com/compare.php?from=732a5cba8c739ed40a7280b5d74ca717910c2c4c&to=2e94109d115a81f271cefc7d6c0e839920c52bba&stat=instructions%3Au

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


More information about the llvm-commits mailing list