summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/FastISel.cpp1
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp16
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp8
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp4
4 files changed, 15 insertions, 14 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
index fb3d101f122..c1b93bf422d 100644
--- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -370,6 +370,7 @@ bool FastISel::SelectCall(User *I) {
unsigned Line = Subprogram.getLineNumber();
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
setCurDebugLoc(DebugLoc::get(MF.getOrCreateDebugLocID(SrcFile, Line, 0)));
+ DW->setFastCodeGen(true);
if (DW->getRecordSourceLineCount() != 1) {
const TargetInstrDesc &II = TII.get(TargetInstrInfo::DBG_LABEL);
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 0ab749638a8..3cfe4f47a0e 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -56,6 +56,7 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
TargetLowering &TLI;
SelectionDAG &DAG;
bool TypesNeedLegalizing;
+ bool Fast;
// Libcall insertion helpers.
@@ -137,7 +138,8 @@ class VISIBILITY_HIDDEN SelectionDAGLegalize {
}
public:
- explicit SelectionDAGLegalize(SelectionDAG &DAG, bool TypesNeedLegalizing);
+ explicit SelectionDAGLegalize(SelectionDAG &DAG, bool TypesNeedLegalizing,
+ bool fast);
/// getTypeAction - Return how we should legalize values of this type, either
/// it is already legal or we need to expand it into multiple registers of
@@ -362,9 +364,10 @@ SDNode *SelectionDAGLegalize::isShuffleLegal(MVT VT, SDValue Mask) const {
return TLI.isShuffleMaskLegal(Mask, VT) ? Mask.getNode() : 0;
}
-SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag, bool types)
+SelectionDAGLegalize::SelectionDAGLegalize(SelectionDAG &dag,
+ bool types, bool fast)
: TLI(dag.getTargetLoweringInfo()), DAG(dag), TypesNeedLegalizing(types),
- ValueTypeActions(TLI.getValueTypeActions()) {
+ Fast(fast), ValueTypeActions(TLI.getValueTypeActions()) {
assert(MVT::LAST_VALUETYPE <= 32 &&
"Too many value types for ValueTypeActions to hold!");
}
@@ -1289,9 +1292,8 @@ SDValue SelectionDAGLegalize::LegalizeOp(SDValue Op) {
unsigned Line = DSP->getLine();
unsigned Col = DSP->getColumn();
- const Function *F = DAG.getMachineFunction().getFunction();
- if (!F->hasFnAttr(Attribute::OptimizeForSize)) {
+ if (Fast) {
// A bit self-referential to have DebugLoc on Debug_Loc nodes, but it
// won't hurt anything.
if (useDEBUG_LOC) {
@@ -8640,9 +8642,9 @@ SDValue SelectionDAGLegalize::StoreWidenVectorOp(StoreSDNode *ST,
// SelectionDAG::Legalize - This is the entry point for the file.
//
-void SelectionDAG::Legalize(bool TypesNeedLegalizing) {
+void SelectionDAG::Legalize(bool TypesNeedLegalizing, bool Fast) {
/// run - This is the main entry point to this class.
///
- SelectionDAGLegalize(*this, TypesNeedLegalizing).LegalizeDAG();
+ SelectionDAGLegalize(*this, TypesNeedLegalizing, Fast).LegalizeDAG();
}
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
index 4c737298345..bc417138bfd 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuild.cpp
@@ -3915,6 +3915,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
if (Fast)
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
getRoot(), LabelID));
+ DW->setFastCodeGen(Fast);
}
return 0;
@@ -3950,9 +3951,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
// create a label if this is a beginning of inlined function.
unsigned Line = Subprogram.getLineNumber();
- // FIXME: Support more than just -Os.
- const Function *F = I.getParent()->getParent();
- if (!F->hasFnAttr(Attribute::OptimizeForSize)) {
+ if (Fast) {
unsigned LabelID = DW->RecordSourceLine(Line, 0, SrcFile);
if (DW->getRecordSourceLineCount() != 1)
DAG.setRoot(DAG.getLabel(ISD::DBG_LABEL, getCurDebugLoc(),
@@ -3966,8 +3965,7 @@ SelectionDAGLowering::visitIntrinsicCall(CallInst &I, unsigned Intrinsic) {
return 0;
}
case Intrinsic::dbg_declare: {
- const Function *F = I.getParent()->getParent();
- if (!F->hasFnAttr(Attribute::OptimizeForSize)) {
+ if (Fast) {
DwarfWriter *DW = DAG.getDwarfWriter();
DbgDeclareInst &DI = cast<DbgDeclareInst>(I);
Value *Variable = DI.getVariable();
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index dc5f7d79f39..e2b1c9edf38 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -621,9 +621,9 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
if (TimePassesIsEnabled) {
NamedRegionTimer T("DAG Legalization", GroupName);
- CurDAG->Legalize(DisableLegalizeTypes);
+ CurDAG->Legalize(DisableLegalizeTypes, Fast);
} else {
- CurDAG->Legalize(DisableLegalizeTypes);
+ CurDAG->Legalize(DisableLegalizeTypes, Fast);
}
DOUT << "Legalized selection DAG:\n";
OpenPOWER on IntegriCloud