[PATCH] D46760: [InstCombine] Enhance narrowUDivURem.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 8 09:28:05 PDT 2018


spatel added a comment.

In https://reviews.llvm.org/D46760#1124250, @bixia wrote:

>   To handle the case here (such as the pattern "lshr followed by shl" you mentioned) , is it acceptable to add a new optimization to aggressive-instcombine that can increase the number of zext/sext instructions? 


I haven't had a chance to look at the new example yet, but let me answer this in general: no. Currently, aggressive-instcombine is a target-independent canonicalization pass just like regular instcombine. And we've said that increasing instruction count is not usually canonical for instcombine.

The only difference for aggressive-instcombine is that we can pursue more expensive pattern matching there because that was deemed acceptable for -O3. So whatever we try to do to use narrow ops should result in equal or less total instructions.


Repository:
  rL LLVM

https://reviews.llvm.org/D46760





More information about the llvm-commits mailing list