mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-28 05:19:42 +00:00
Remove DisableTailCalls from TargetOptions and the code in resetTargetOptions
that was resetting it. Remove the uses of DisableTailCalls in subclasses of TargetLowering and use the value of function attribute "disable-tail-calls" instead. Also, unconditionally add pass TailCallElim to the pipeline and check the function attribute at the start of runOnFunction to disable the pass on a per-function basis. This is part of the work to remove TargetMachine::resetTargetOptions, and since DisableTailCalls was the last non-fast-math option that was being reset in that function, we should be able to remove the function entirely after the work to propagate IR-level fast-math flags to DAG nodes is completed. Out-of-tree users should remove the uses of DisableTailCalls and make changes to attach attribute "disable-tail-calls"="true" or "false" to the functions in the IR. rdar://problem/13752163 Differential Revision: http://reviews.llvm.org/D10099 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
#ifndef LLVM_CODEGEN_COMMANDFLAGS_H
|
||||
#define LLVM_CODEGEN_COMMANDFLAGS_H
|
||||
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/IR/Module.h"
|
||||
#include "llvm/MC/MCTargetOptionsCommandFlags.h"
|
||||
#include "llvm//MC/SubtargetFeature.h"
|
||||
@@ -247,7 +248,6 @@ static inline TargetOptions InitTargetOptionsFromCodeGenFlags() {
|
||||
Options.FloatABIType = FloatABIForCalls;
|
||||
Options.NoZerosInBSS = DontPlaceZerosInBSS;
|
||||
Options.GuaranteedTailCallOpt = EnableGuaranteedTailCallOpt;
|
||||
Options.DisableTailCalls = DisableTailCalls;
|
||||
Options.StackAlignmentOverride = OverrideStackAlignment;
|
||||
Options.TrapFuncName = TrapFuncName;
|
||||
Options.PositionIndependentExecutable = EnablePIE;
|
||||
@@ -315,6 +315,11 @@ static inline void setFunctionAttributes(StringRef CPU, StringRef Features,
|
||||
"no-frame-pointer-elim",
|
||||
DisableFPElim ? "true" : "false");
|
||||
|
||||
if (DisableTailCalls.getNumOccurrences() > 0)
|
||||
NewAttrs = NewAttrs.addAttribute(Ctx, AttributeSet::FunctionIndex,
|
||||
"disable-tail-calls",
|
||||
toStringRef(DisableTailCalls));
|
||||
|
||||
// Let NewAttrs override Attrs.
|
||||
NewAttrs = Attrs.addAttributes(Ctx, AttributeSet::FunctionIndex, NewAttrs);
|
||||
F.setAttributes(NewAttrs);
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace llvm {
|
||||
HonorSignDependentRoundingFPMathOption(false),
|
||||
NoZerosInBSS(false),
|
||||
GuaranteedTailCallOpt(false),
|
||||
DisableTailCalls(false), StackAlignmentOverride(0),
|
||||
StackAlignmentOverride(0),
|
||||
EnableFastISel(false), PositionIndependentExecutable(false),
|
||||
UseInitArray(false), DisableIntegratedAS(false),
|
||||
CompressDebugSections(false), FunctionSections(false),
|
||||
@@ -137,10 +137,6 @@ namespace llvm {
|
||||
/// as their parent function, etc.), using an alternate ABI if necessary.
|
||||
unsigned GuaranteedTailCallOpt : 1;
|
||||
|
||||
/// DisableTailCalls - This flag controls whether we will use tail calls.
|
||||
/// Disabling them may be useful to maintain a correct call stack.
|
||||
unsigned DisableTailCalls : 1;
|
||||
|
||||
/// StackAlignmentOverride - Override default stack alignment for target.
|
||||
unsigned StackAlignmentOverride;
|
||||
|
||||
@@ -236,7 +232,6 @@ inline bool operator==(const TargetOptions &LHS,
|
||||
ARE_EQUAL(HonorSignDependentRoundingFPMathOption) &&
|
||||
ARE_EQUAL(NoZerosInBSS) &&
|
||||
ARE_EQUAL(GuaranteedTailCallOpt) &&
|
||||
ARE_EQUAL(DisableTailCalls) &&
|
||||
ARE_EQUAL(StackAlignmentOverride) &&
|
||||
ARE_EQUAL(EnableFastISel) &&
|
||||
ARE_EQUAL(PositionIndependentExecutable) &&
|
||||
|
||||
Reference in New Issue
Block a user