mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-02 16:56:39 +00:00
Tell TargetLoweringOpt whether it is running before
or after legalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45321 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1a3048bb8e
commit
b16f55f3c8
@ -557,10 +557,12 @@ public:
|
|||||||
/// that want to combine
|
/// that want to combine
|
||||||
struct TargetLoweringOpt {
|
struct TargetLoweringOpt {
|
||||||
SelectionDAG &DAG;
|
SelectionDAG &DAG;
|
||||||
|
bool AfterLegalize;
|
||||||
SDOperand Old;
|
SDOperand Old;
|
||||||
SDOperand New;
|
SDOperand New;
|
||||||
|
|
||||||
explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
|
explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize)
|
||||||
|
: DAG(InDAG), AfterLegalize(afterLegalize) {}
|
||||||
|
|
||||||
bool CombineTo(SDOperand O, SDOperand N) {
|
bool CombineTo(SDOperand O, SDOperand N) {
|
||||||
Old = O;
|
Old = O;
|
||||||
|
@ -141,7 +141,7 @@ namespace {
|
|||||||
/// it can be simplified or if things it uses can be simplified by bit
|
/// it can be simplified or if things it uses can be simplified by bit
|
||||||
/// propagation. If so, return true.
|
/// propagation. If so, return true.
|
||||||
bool SimplifyDemandedBits(SDOperand Op, uint64_t Demanded = ~0ULL) {
|
bool SimplifyDemandedBits(SDOperand Op, uint64_t Demanded = ~0ULL) {
|
||||||
TargetLowering::TargetLoweringOpt TLO(DAG);
|
TargetLowering::TargetLoweringOpt TLO(DAG, AfterLegalize);
|
||||||
uint64_t KnownZero, KnownOne;
|
uint64_t KnownZero, KnownOne;
|
||||||
Demanded &= MVT::getIntVTBitMask(Op.getValueType());
|
Demanded &= MVT::getIntVTBitMask(Op.getValueType());
|
||||||
if (!TLI.SimplifyDemandedBits(Op, Demanded, KnownZero, KnownOne, TLO))
|
if (!TLI.SimplifyDemandedBits(Op, Demanded, KnownZero, KnownOne, TLO))
|
||||||
|
Loading…
Reference in New Issue
Block a user