[PATCH] Add an instcombine rule to optimize max(~a, ~b) to ~min(a, b) when profitable
Sanjoy Das
sanjoy at playingwithpointers.com
Sun Feb 22 19:51:16 PST 2015
Hi majnemer, hfinkel,
This case is interesting because ScalarEvolutionExpander lowers min(a, b) as ~max(~a,~b). I think the profitability heuristics can be made more clever/aggressive, but this is a start.
A clang bootstrapped with this change passes `make check`. The rule fires 159 times.
http://reviews.llvm.org/D7821
Files:
lib/Transforms/InstCombine/InstCombineSelect.cpp
test/Transforms/InstCombine/max-of-nots.ll
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7821.20488.patch
Type: text/x-patch
Size: 5144 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150223/8fc34cfe/attachment.bin>
More information about the llvm-commits
mailing list