llvm.org GIT mirror llvm / b16f55f
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 Chris Lattner 12 years ago
2 changed file(s) with 4 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
556556 /// that want to combine
557557 struct TargetLoweringOpt {
558558 SelectionDAG &DAG;
559 bool AfterLegalize;
559560 SDOperand Old;
560561 SDOperand New;
561562
562 explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {}
563 explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize)
564 : DAG(InDAG), AfterLegalize(afterLegalize) {}
563565
564566 bool CombineTo(SDOperand O, SDOperand N) {
565567 Old = O;
140140 /// it can be simplified or if things it uses can be simplified by bit
141141 /// propagation. If so, return true.
142142 bool SimplifyDemandedBits(SDOperand Op, uint64_t Demanded = ~0ULL) {
143 TargetLowering::TargetLoweringOpt TLO(DAG);
143 TargetLowering::TargetLoweringOpt TLO(DAG, AfterLegalize);
144144 uint64_t KnownZero, KnownOne;
145145 Demanded &= MVT::getIntVTBitMask(Op.getValueType());
146146 if (!TLI.SimplifyDemandedBits(Op, Demanded, KnownZero, KnownOne, TLO))