search for: decomposemulbyconst

Displaying 2 results from an estimated 2 matches for "decomposemulbyconst".

2020 Jul 01
2
How to prevent llvm's default optimization
...if (AddNode.getNode()->hasOneUse() && TargetLowering.isCheaperCommuteAddMul(......)) return true; The virtual hook nethod isCheaperCommuteAddMul will return true by default, but specific targets like arm/riscv can make their own decision. Just like virtual bool TargetLowering::decomposeMulByConstant What's your opinion? Ben At 2020-07-01 02:29:36, "Sam Elliott" <selliott at lowrisc.org> wrote: >The relevant DAGCombine is controlled by a hook: `DAGCombiner::isMulAddWithConstProfitable`. > >It may be that, when optimising for size, this hook should take...
2020 Jun 30
2
How to prevent llvm's default optimization
Yes - this has been in InstCombine for a long time: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp#L268 We could say that the canonicalization should be reversed, but that probably uncovers more missing optimizations. The code size concern is legitimate. For example on x86, gcc asm is 2 bytes smaller on this example: