mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-05-20 20:38:48 +00:00
Disable DAGCombine's alignment inference in "fast" codegen mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55059 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b8d2f550b8
commit
a267651b7e
@ -169,7 +169,7 @@ public:
|
|||||||
/// certain types of nodes together, or eliminating superfluous nodes. When
|
/// certain types of nodes together, or eliminating superfluous nodes. When
|
||||||
/// the AfterLegalize argument is set to 'true', Combine takes care not to
|
/// the AfterLegalize argument is set to 'true', Combine takes care not to
|
||||||
/// generate any nodes that will be illegal on the target.
|
/// generate any nodes that will be illegal on the target.
|
||||||
void Combine(bool AfterLegalize, AliasAnalysis &AA);
|
void Combine(bool AfterLegalize, AliasAnalysis &AA, bool Fast);
|
||||||
|
|
||||||
/// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
|
/// LegalizeTypes - This transforms the SelectionDAG into a SelectionDAG that
|
||||||
/// only uses types natively supported by the target.
|
/// only uses types natively supported by the target.
|
||||||
|
@ -51,6 +51,7 @@ namespace {
|
|||||||
SelectionDAG &DAG;
|
SelectionDAG &DAG;
|
||||||
TargetLowering &TLI;
|
TargetLowering &TLI;
|
||||||
bool AfterLegalize;
|
bool AfterLegalize;
|
||||||
|
bool Fast;
|
||||||
|
|
||||||
// Worklist of all of the nodes that need to be simplified.
|
// Worklist of all of the nodes that need to be simplified.
|
||||||
std::vector<SDNode*> WorkList;
|
std::vector<SDNode*> WorkList;
|
||||||
@ -237,10 +238,11 @@ namespace {
|
|||||||
SDValue FindBetterChain(SDNode *N, SDValue Chain);
|
SDValue FindBetterChain(SDNode *N, SDValue Chain);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DAGCombiner(SelectionDAG &D, AliasAnalysis &A)
|
DAGCombiner(SelectionDAG &D, AliasAnalysis &A, bool fast)
|
||||||
: DAG(D),
|
: DAG(D),
|
||||||
TLI(D.getTargetLoweringInfo()),
|
TLI(D.getTargetLoweringInfo()),
|
||||||
AfterLegalize(false),
|
AfterLegalize(false),
|
||||||
|
Fast(fast),
|
||||||
AA(A) {}
|
AA(A) {}
|
||||||
|
|
||||||
/// Run - runs the dag combiner on all nodes in the work list
|
/// Run - runs the dag combiner on all nodes in the work list
|
||||||
@ -4411,7 +4413,7 @@ SDValue DAGCombiner::visitLOAD(SDNode *N) {
|
|||||||
SDValue Ptr = LD->getBasePtr();
|
SDValue Ptr = LD->getBasePtr();
|
||||||
|
|
||||||
// Try to infer better alignment information than the load already has.
|
// Try to infer better alignment information than the load already has.
|
||||||
if (LD->isUnindexed()) {
|
if (!Fast && LD->isUnindexed()) {
|
||||||
if (unsigned Align = InferAlignment(Ptr, DAG)) {
|
if (unsigned Align = InferAlignment(Ptr, DAG)) {
|
||||||
if (Align > LD->getAlignment())
|
if (Align > LD->getAlignment())
|
||||||
return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0),
|
return DAG.getExtLoad(LD->getExtensionType(), LD->getValueType(0),
|
||||||
@ -4529,7 +4531,7 @@ SDValue DAGCombiner::visitSTORE(SDNode *N) {
|
|||||||
SDValue Ptr = ST->getBasePtr();
|
SDValue Ptr = ST->getBasePtr();
|
||||||
|
|
||||||
// Try to infer better alignment information than the store already has.
|
// Try to infer better alignment information than the store already has.
|
||||||
if (ST->isUnindexed()) {
|
if (!Fast && ST->isUnindexed()) {
|
||||||
if (unsigned Align = InferAlignment(Ptr, DAG)) {
|
if (unsigned Align = InferAlignment(Ptr, DAG)) {
|
||||||
if (Align > ST->getAlignment())
|
if (Align > ST->getAlignment())
|
||||||
return DAG.getTruncStore(Chain, Value, Ptr, ST->getSrcValue(),
|
return DAG.getTruncStore(Chain, Value, Ptr, ST->getSrcValue(),
|
||||||
@ -5664,8 +5666,9 @@ SDValue DAGCombiner::FindBetterChain(SDNode *N, SDValue OldChain) {
|
|||||||
|
|
||||||
// SelectionDAG::Combine - This is the entry point for the file.
|
// SelectionDAG::Combine - This is the entry point for the file.
|
||||||
//
|
//
|
||||||
void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA) {
|
void SelectionDAG::Combine(bool RunningAfterLegalize, AliasAnalysis &AA,
|
||||||
|
bool Fast) {
|
||||||
/// run - This is the main entry point to this class.
|
/// run - This is the main entry point to this class.
|
||||||
///
|
///
|
||||||
DAGCombiner(*this, AA).Run(RunningAfterLegalize);
|
DAGCombiner(*this, AA, Fast).Run(RunningAfterLegalize);
|
||||||
}
|
}
|
||||||
|
@ -5369,9 +5369,9 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
|
|||||||
// Run the DAG combiner in pre-legalize mode.
|
// Run the DAG combiner in pre-legalize mode.
|
||||||
if (TimePassesIsEnabled) {
|
if (TimePassesIsEnabled) {
|
||||||
NamedRegionTimer T("DAG Combining 1", GroupName);
|
NamedRegionTimer T("DAG Combining 1", GroupName);
|
||||||
DAG.Combine(false, *AA);
|
DAG.Combine(false, *AA, Fast);
|
||||||
} else {
|
} else {
|
||||||
DAG.Combine(false, *AA);
|
DAG.Combine(false, *AA, Fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
DOUT << "Optimized lowered selection DAG:\n";
|
DOUT << "Optimized lowered selection DAG:\n";
|
||||||
@ -5413,9 +5413,9 @@ void SelectionDAGISel::CodeGenAndEmitDAG(SelectionDAG &DAG) {
|
|||||||
// Run the DAG combiner in post-legalize mode.
|
// Run the DAG combiner in post-legalize mode.
|
||||||
if (TimePassesIsEnabled) {
|
if (TimePassesIsEnabled) {
|
||||||
NamedRegionTimer T("DAG Combining 2", GroupName);
|
NamedRegionTimer T("DAG Combining 2", GroupName);
|
||||||
DAG.Combine(true, *AA);
|
DAG.Combine(true, *AA, Fast);
|
||||||
} else {
|
} else {
|
||||||
DAG.Combine(true, *AA);
|
DAG.Combine(true, *AA, Fast);
|
||||||
}
|
}
|
||||||
|
|
||||||
DOUT << "Optimized legalized selection DAG:\n";
|
DOUT << "Optimized legalized selection DAG:\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user