[llvm-commits] [PATCH] Phi node folding improvements

Peter Collingbourne peter at pcc.me.uk
Fri Jul 30 13:15:30 PDT 2010


Hi,

The attached patches improve the flexibility of the phi node folding
mechanism by assigning a cost to each non-trapping instruction and
allowing the user to specify a maximum cost threshold.  By increasing
the threshold the user can apply phi node folding to more complex
expressions.

I developed this patch as part of my work with the Klee symbolic
virtual machine, which can handle symbolic expressions containing
selects more efficiently than branches conditional on symbolic
expressions.  However I imagine it could also provide an advantage on
architectures with relatively expensive branch operations (I haven't
done any experiments to determine if this is the case though).

The patches should not contain any changes to default functionality,
except for adding more instructions to the list of "cheap" (folded
by default) instructions.

OK to commit?

Thanks,
-- 
Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-Trunc-ZExt-and-SExt-to-the-list-of-cheap-instruc.patch
Type: text/x-diff
Size: 927 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100730/1af696fd/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-CostRemaining-parameter-to-DominatesMergePoint.patch
Type: text/x-diff
Size: 4957 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100730/1af696fd/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Expose-phi-node-folding-cost-threshold-as-command-li.patch
Type: text/x-diff
Size: 1618 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20100730/1af696fd/attachment-0002.patch>


More information about the llvm-commits mailing list