From: Chris Lattner Date: Sat, 22 Dec 2007 20:56:36 +0000 (+0000) Subject: Tell TargetLoweringOpt whether it is running before X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=b16f55f3c82fe72e2ca73f1071db5daaa2124e51;p=oota-llvm.git 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 --- diff --git a/include/llvm/Target/TargetLowering.h b/include/llvm/Target/TargetLowering.h index 5439ff667f4..f96322f946c 100644 --- a/include/llvm/Target/TargetLowering.h +++ b/include/llvm/Target/TargetLowering.h @@ -557,10 +557,12 @@ public: /// that want to combine struct TargetLoweringOpt { SelectionDAG &DAG; + bool AfterLegalize; SDOperand Old; SDOperand New; - explicit TargetLoweringOpt(SelectionDAG &InDAG) : DAG(InDAG) {} + explicit TargetLoweringOpt(SelectionDAG &InDAG, bool afterLegalize) + : DAG(InDAG), AfterLegalize(afterLegalize) {} bool CombineTo(SDOperand O, SDOperand N) { Old = O; diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index a1d8ad95de5..6eaf7ae7f40 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -141,7 +141,7 @@ namespace { /// it can be simplified or if things it uses can be simplified by bit /// propagation. If so, return true. bool SimplifyDemandedBits(SDOperand Op, uint64_t Demanded = ~0ULL) { - TargetLowering::TargetLoweringOpt TLO(DAG); + TargetLowering::TargetLoweringOpt TLO(DAG, AfterLegalize); uint64_t KnownZero, KnownOne; Demanded &= MVT::getIntVTBitMask(Op.getValueType()); if (!TLI.SimplifyDemandedBits(Op, Demanded, KnownZero, KnownOne, TLO))