mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Add a flag to disable jump table generation (all
switches use the binary search algorithm) for environments that don't support it. PPC64 JIT is such an environment; turn the flag on for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54248 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
75dcf08243
commit
7232464bda
@ -97,6 +97,10 @@ namespace llvm {
|
||||
/// VerboseAsm - When this flag is set, the asm printer prints additional
|
||||
/// comments to asm directives.
|
||||
extern bool VerboseAsm;
|
||||
|
||||
/// DisableJumpTables - This flag indicates jump tables should not be
|
||||
/// generated.
|
||||
extern bool DisableJumpTables;
|
||||
} // End llvm namespace
|
||||
|
||||
#endif
|
||||
|
@ -1916,7 +1916,8 @@ bool SelectionDAGLowering::handleSmallSwitchRange(CaseRec& CR,
|
||||
}
|
||||
|
||||
static inline bool areJTsAllowed(const TargetLowering &TLI) {
|
||||
return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
|
||||
return !DisableJumpTables &&
|
||||
(TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
|
||||
TLI.isOperationLegal(ISD::BRIND, MVT::Other));
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include "llvm/Module.h"
|
||||
#include "llvm/PassManager.h"
|
||||
#include "llvm/Target/TargetMachineRegistry.h"
|
||||
#include "llvm/Target/TargetOptions.h"
|
||||
using namespace llvm;
|
||||
|
||||
// Register the targets
|
||||
@ -144,6 +145,9 @@ bool PPCTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
|
||||
// instructions to materialize arbitrary global variable + function +
|
||||
// constant pool addresses.
|
||||
setRelocationModel(Reloc::PIC_);
|
||||
// Temporary workaround for the inability of PPC64 JIT to handle jump
|
||||
// tables.
|
||||
DisableJumpTables = true;
|
||||
} else {
|
||||
setRelocationModel(Reloc::Static);
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ namespace llvm {
|
||||
unsigned StackAlignment;
|
||||
bool RealignStack;
|
||||
bool VerboseAsm;
|
||||
bool DisableJumpTables;
|
||||
}
|
||||
|
||||
static cl::opt<bool, true> PrintCode("print-machineinstrs",
|
||||
@ -156,6 +157,11 @@ AsmVerbose("asm-verbose", cl::desc("Add comments to directives."),
|
||||
cl::location(VerboseAsm),
|
||||
cl::init(false));
|
||||
|
||||
static cl::opt<bool, true>
|
||||
DisableSwitchTables(cl::Hidden, "disable-jump-tables",
|
||||
cl::desc("Do not generate jump tables."),
|
||||
cl::location(DisableJumpTables),
|
||||
cl::init(false));
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
// TargetMachine Class
|
||||
|
Loading…
Reference in New Issue
Block a user