[PATCH] D15232: [InstCombine] Aggressively fold compares that can be discovered to be constant

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 4 12:36:18 PST 2015


reames added a subscriber: reames.
reames added a comment.

At a high level, I'm a bit unsure about the formulation chosen here.  I'm worried that seeking to find a set of constant values through a potentially large value graph might be expensive.

A couple of specific questions:

- The examples you've listed should be entirely handled by LazyValueInfo and either JumpThreading or CVP.  Do you have a strong reason InstCombine needs to perform the same optimization?
- Have you considered phrasing this as pushing the query (i.e. icmp) back along the inputs?  Doing this might a) let you terminate earlier or b) unswitch the comparison if the select is only used by the compare.


http://reviews.llvm.org/D15232





More information about the llvm-commits mailing list