summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRenato Golin <renato.golin@linaro.org>2015-11-28 17:23:46 +0000
committerRenato Golin <renato.golin@linaro.org>2015-11-28 17:23:46 +0000
commit5dbc8a5283dc205f99fa2251521692184e322cf6 (patch)
tree8ddbac4393afa6bd87fc23034945aa837df4f570 /llvm/lib
parentd9bb73b2367f7dffd3ab97987c252e0de3f2a2bb (diff)
downloadbcm5719-llvm-5dbc8a5283dc205f99fa2251521692184e322cf6.tar.gz
bcm5719-llvm-5dbc8a5283dc205f99fa2251521692184e322cf6.zip
Revert "[ARM] Generate ABI_optimization_goals build attribute, as described in the ARM ARM."
This reverts commit r254201 and r254202, as it broke test-suite, self-hosting and sanitizer tests on ARM buildbots. llvm-svn: 254234
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.cpp45
-rw-r--r--llvm/lib/Target/ARM/ARMAsmPrinter.h5
2 files changed, 4 insertions, 46 deletions
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
index 61141c0031d..67ebfa2b581 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.cpp
@@ -60,7 +60,7 @@ using namespace llvm;
ARMAsmPrinter::ARMAsmPrinter(TargetMachine &TM,
std::unique_ptr<MCStreamer> Streamer)
: AsmPrinter(TM, std::move(Streamer)), AFI(nullptr), MCP(nullptr),
- InConstantPool(false), OptimizationGoals(-1) {}
+ InConstantPool(false) {}
void ARMAsmPrinter::EmitFunctionBodyEnd() {
// Make sure to terminate any constant pools that were at the end
@@ -106,38 +106,9 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
Subtarget = &MF.getSubtarget<ARMSubtarget>();
SetupMachineFunction(MF);
- const Function* F = MF.getFunction();
- const TargetMachine& TM = MF.getTarget();
-
- // Calculate this function's optimization goal.
- unsigned OptimizationGoal;
- if (F->hasFnAttribute(Attribute::OptimizeNone))
- // For best debugging illusion, speed and small size sacrificed
- OptimizationGoal = 6;
- else if (F->optForMinSize())
- // Aggressively for small size, speed and debug illusion sacrificed
- OptimizationGoal = 4;
- else if (F->optForSize())
- // For small size, but speed and debugging illusion preserved
- OptimizationGoal = 3;
- else if (TM.getOptLevel() == CodeGenOpt::Aggressive)
- // Aggressively for speed, small size and debug illusion sacrificed
- OptimizationGoal = 2;
- else if (TM.getOptLevel() > CodeGenOpt::None)
- // For speed, but small size and good debug illusion preserved
- OptimizationGoal = 1;
- else // TM.getOptLevel() == CodeGenOpt::None
- // For good debugging, but speed and small size preserved
- OptimizationGoal = 5;
-
- // Combine a new optimization goal with existing ones.
- if (OptimizationGoals == -1) // uninitialized goals
- OptimizationGoals = OptimizationGoal;
- else if (OptimizationGoals != (int)OptimizationGoal) // conflicting goals
- OptimizationGoals = 0;
if (Subtarget->isTargetCOFF()) {
- bool Internal = F->hasInternalLinkage();
+ bool Internal = MF.getFunction()->hasInternalLinkage();
COFF::SymbolStorageClass Scl = Internal ? COFF::IMAGE_SYM_CLASS_STATIC
: COFF::IMAGE_SYM_CLASS_EXTERNAL;
int Type = COFF::IMAGE_SYM_DTYPE_FUNCTION << COFF::SCT_COMPLEX_TYPE_SHIFT;
@@ -535,16 +506,6 @@ void ARMAsmPrinter::EmitEndOfAsmFile(Module &M) {
// generates code that does this, it is always safe to set.
OutStreamer->EmitAssemblerFlag(MCAF_SubsectionsViaSymbols);
}
-
- // The last attribute to be emitted is ABI_optimization_goals
- MCTargetStreamer &TS = *OutStreamer->getTargetStreamer();
- ARMTargetStreamer &ATS = static_cast<ARMTargetStreamer &>(TS);
-
- if (OptimizationGoals > 0)
- ATS.emitAttribute(ARMBuildAttrs::ABI_optimization_goals, OptimizationGoals);
- OptimizationGoals = -1;
-
- ATS.finishAttributeSection();
}
//===----------------------------------------------------------------------===//
@@ -837,6 +798,8 @@ void ARMAsmPrinter::emitAttributes() {
else if (STI.hasVirtualization())
ATS.emitAttribute(ARMBuildAttrs::Virtualization_use,
ARMBuildAttrs::AllowVirtualization);
+
+ ATS.finishAttributeSection();
}
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Target/ARM/ARMAsmPrinter.h b/llvm/lib/Target/ARM/ARMAsmPrinter.h
index ed7be2de51c..fb925f162f7 100644
--- a/llvm/lib/Target/ARM/ARMAsmPrinter.h
+++ b/llvm/lib/Target/ARM/ARMAsmPrinter.h
@@ -51,11 +51,6 @@ class LLVM_LIBRARY_VISIBILITY ARMAsmPrinter : public AsmPrinter {
/// labels used for ARMv4t thumb code to make register indirect calls.
SmallVector<std::pair<unsigned, MCSymbol*>, 4> ThumbIndirectPads;
- /// OptimizationGoals - Maintain a combined optimization goal for all
- /// functions in a module: one of Tag_ABI_optimization_goals values,
- /// -1 if uninitialized, 0 if conflicting goals
- int OptimizationGoals;
-
public:
explicit ARMAsmPrinter(TargetMachine &TM,
std::unique_ptr<MCStreamer> Streamer);
OpenPOWER on IntegriCloud