mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
[SDAG] Now that we have a way to communicate the exact bit on sdiv use it to simplify sdiv by a constant.
We had a hack in SDAGBuilder in place to work around this but now we can avoid that. Call BuildExactSDIV from BuildSDIV so DAGCombiner can perform this trick automatically. The added check in DAGCombiner is necessary to prevent exact sdiv by pow2 from regressing as the target-specific pow2 lowering is not aware of exact bits yet. This is mostly covered by existing tests. One side effect is that we get the better lowering for exact vector sdivs now too :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240891 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2718,8 +2718,6 @@ public:
|
||||
//===--------------------------------------------------------------------===//
|
||||
// Div utility functions
|
||||
//
|
||||
SDValue BuildExactSDIV(SDValue Op1, SDValue Op2, SDLoc dl,
|
||||
SelectionDAG &DAG) const;
|
||||
SDValue BuildSDIV(SDNode *N, const APInt &Divisor, SelectionDAG &DAG,
|
||||
bool IsAfterLegalization,
|
||||
std::vector<SDNode *> *Created) const;
|
||||
|
||||
Reference in New Issue
Block a user