[llvm-commits] [Review request] Jump threading and 'select'.

Chris Lattner clattner at apple.com
Tue Dec 14 21:51:04 PST 2010


On Dec 9, 2010, at 9:46 AM, Frits van Bommel wrote:

> The attached patch teaches jump threading to "look through" a select
> when the branch direction of a branch/switch/indirect depends on it.
> The new code tries to figure out whether the condition of the select
> is known in any of the predecessors and if so maps the operands
> appropriately.

This looks ok to me.  Please merge this:

+    if (TrueVal || FalseVal) {
+      PredValueInfoTy Conds;
+      if (ComputeValueKnownInPredecessors(SI->getCondition(), BB, Conds,
+                                          WantInteger)) {

Into something like this to reduce indentation:

+    PredValueInfoTy Conds;
+    if ((TrueVal || FalseVal) &&
         ComputeValueKnownInPredecessors(SI->getCondition(), BB, Conds, ..

and apply.

Is it helpful to know the condition of the select in one of the predecessors?

-Chris




More information about the llvm-commits mailing list