[PATCH] InstCombine: Be more agressive optimizing 'udiv' instructions with 'select' denominators

David Majnemer david.majnemer at gmail.com
Sun Jun 9 03:22:42 PDT 2013


Real world code [*] sometimes has the denominator of a 'udiv' be a 'select'
but the select operands may not have the same structural form.

The attached patch treats the true and false operands as right hand sides
of a divide and feeds them into the same logical than simplified 'udiv'
instructions.

I wouldn't be surprised if there was a better/more systematic way of
dealing with this problem, I'd be happy to implement suggestions.

-- 
David Majnemer

[*] AddressSanitizerModule::runOnModule
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130609/c7e559c0/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: select-udiv.diff
Type: application/octet-stream
Size: 5761 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130609/c7e559c0/attachment.obj>


More information about the llvm-commits mailing list