mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-19 18:24:05 +00:00
Tell TargetLoweringOpt whether it is running before
or after legalize. llvm-svn: 45321
This commit is contained in:
parent
f2aa80e0de
commit
a8f6fac7a3
@ -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;
|
||||
|
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user