[llvm-commits] [llvm] r54404 - in /llvm/tags/Apple/llvmCore-2061: include/llvm/Target/TargetOptions.h lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp lib/Target/PowerPC/PPCISelLowering.cpp lib/Target/PowerPC/PPCTargetMachine.cpp lib/Target/TargetMachine.cpp utils/buildit/build_llvm
Bill Wendling
isanbard at gmail.com
Tue Aug 5 23:17:09 PDT 2008
Author: void
Date: Wed Aug 6 01:17:09 2008
New Revision: 54404
URL: http://llvm.org/viewvc/llvm-project?rev=54404&view=rev
Log:
Pull r54248 into llvmCore-2061:
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.
Modified:
llvm/tags/Apple/llvmCore-2061/include/llvm/Target/TargetOptions.h
llvm/tags/Apple/llvmCore-2061/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCTargetMachine.cpp
llvm/tags/Apple/llvmCore-2061/lib/Target/TargetMachine.cpp
llvm/tags/Apple/llvmCore-2061/utils/buildit/build_llvm
Modified: llvm/tags/Apple/llvmCore-2061/include/llvm/Target/TargetOptions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/include/llvm/Target/TargetOptions.h?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/include/llvm/Target/TargetOptions.h (original)
+++ llvm/tags/Apple/llvmCore-2061/include/llvm/Target/TargetOptions.h Wed Aug 6 01:17:09 2008
@@ -97,6 +97,10 @@
/// 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
Modified: llvm/tags/Apple/llvmCore-2061/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/tags/Apple/llvmCore-2061/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Aug 6 01:17:09 2008
@@ -1900,8 +1900,9 @@
}
static inline bool areJTsAllowed(const TargetLowering &TLI) {
- return (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
- TLI.isOperationLegal(ISD::BRIND, MVT::Other));
+ return !DisableJumpTables &&
+ (TLI.isOperationLegal(ISD::BR_JT, MVT::Other) ||
+ TLI.isOperationLegal(ISD::BRIND, MVT::Other));
}
/// handleJTSwitchCase - Emit jumptable for current switch case range
Modified: llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCISelLowering.cpp?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCISelLowering.cpp Wed Aug 6 01:17:09 2008
@@ -43,7 +43,7 @@
: TargetLowering(TM), PPCSubTarget(*TM.getSubtargetImpl()) {
setPow2DivIsCheap();
-
+
// Use _setjmp/_longjmp instead of setjmp/longjmp.
setUseUnderscoreSetJmp(true);
setUseUnderscoreLongJmp(true);
Modified: llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCTargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCTargetMachine.cpp?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCTargetMachine.cpp (original)
+++ llvm/tags/Apple/llvmCore-2061/lib/Target/PowerPC/PPCTargetMachine.cpp Wed Aug 6 01:17:09 2008
@@ -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 @@
// 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);
}
Modified: llvm/tags/Apple/llvmCore-2061/lib/Target/TargetMachine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/lib/Target/TargetMachine.cpp?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/lib/Target/TargetMachine.cpp (original)
+++ llvm/tags/Apple/llvmCore-2061/lib/Target/TargetMachine.cpp Wed Aug 6 01:17:09 2008
@@ -39,6 +39,7 @@
unsigned StackAlignment;
bool RealignStack;
bool VerboseAsm;
+ bool DisableJumpTables;
}
static cl::opt<bool, true> PrintCode("print-machineinstrs",
@@ -156,6 +157,11 @@
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
Modified: llvm/tags/Apple/llvmCore-2061/utils/buildit/build_llvm
URL: http://llvm.org/viewvc/llvm-project/llvm/tags/Apple/llvmCore-2061/utils/buildit/build_llvm?rev=54404&r1=54403&r2=54404&view=diff
==============================================================================
--- llvm/tags/Apple/llvmCore-2061/utils/buildit/build_llvm (original)
+++ llvm/tags/Apple/llvmCore-2061/utils/buildit/build_llvm Wed Aug 6 01:17:09 2008
@@ -138,8 +138,7 @@
make $JOBS_FLAG $OPTIMIZE_OPTS UNIVERSAL=1 UNIVERSAL_ARCH="$TARGETS" \
LLVM_SUBMIT_VERSION=$LLVM_SUBMIT_VERSION \
LLVM_SUBMIT_SUBVERSION=$LLVM_SUBMIT_SUBVERSION \
- CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'" \
- CC=/usr/bin/gcc-4.0 CXX=/usr/bin/g++-4.0
+ CXXFLAGS="-DLLVM_VERSION_INFO='\" Apple Build #$LLVM_VERSION\"'"
if ! test $? == 0 ; then
echo "error: LLVM 'make' failed!"
More information about the llvm-commits
mailing list