[llvm-dev] Disabling DAGCombine's specific optimization

Matt Arsenault via llvm-dev llvm-dev at lists.llvm.org
Mon May 15 01:13:32 PDT 2017


> On May 15, 2017, at 07:54, vivek pandya via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Hello LLVM Developers,
> 
> I am working on an architecture which have one bit shift operation if barrel shiftier hardware is not present in such cases some DAGCombine optimizations reduces performance of certain benchmarks upto 5% for example consider follwing optimization:
> fold (select_cc seteq (and x, y), 0, 0, A) -> (and (shr (shl x)) A)
> Here it introduce 2 shift operations and when barrel shiftier is not present these shifts will be converted to loops thus making it worst. I am sure there few architectures which have similar features. So how to disable these kind of optimizations in DAGCombine particularly when I want build and use LLVM for more than one target ?
> 
> Sincerely,
> Vivek
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

Sounds to me like this combine is missing a TLI.isOperationLegal(ISD::LSHR) or similar check

-Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170515/3dff2ae8/attachment-0001.html>


More information about the llvm-dev mailing list