summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2009-02-24 02:35:30 +0000
committerBill Wendling <isanbard@gmail.com>2009-02-24 02:35:30 +0000
commit786c5973f7777dadca85a4be6a312df23b3d3bc6 (patch)
treed0b50012bb724093a38360b963a9e48b3a5c2772 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parentcce27f55023428423dbb8ef2ffa64d8140d0bcca (diff)
downloadbcm5719-llvm-786c5973f7777dadca85a4be6a312df23b3d3bc6.tar.gz
bcm5719-llvm-786c5973f7777dadca85a4be6a312df23b3d3bc6.zip
- Use the "Fast" flag instead of "OptimizeForSize" to determine whether to emit
a DBG_LABEL or not. We want to fall back to the original way of emitting debug info when we're in -O0/-fast mode. - Add plumbing in to pass the "Fast" flag to places that need it. - XFAIL DebugInfo/deaddebuglabel.ll. This is finding 11 labels instead of 8. I need to investigate still. llvm-svn: 65367
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp16
1 files changed, 9 insertions, 7 deletions
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();
}
OpenPOWER on IntegriCloud