mirror of
https://github.com/RPCS3/llvm.git
synced 2025-04-12 02:47:10 +00:00
[ExecutionEngine] After a heroic dev-meeting hack session, the JIT supports TLS.
Turns on EmulatedTLS support by default in EngineBuilder. ;) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@316200 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f56176dd98
commit
801676c9c6
@ -541,6 +541,7 @@ private:
|
|||||||
SmallVector<std::string, 4> MAttrs;
|
SmallVector<std::string, 4> MAttrs;
|
||||||
bool VerifyModules;
|
bool VerifyModules;
|
||||||
bool UseOrcMCJITReplacement;
|
bool UseOrcMCJITReplacement;
|
||||||
|
bool EmulatedTLS = true;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/// Default constructor for EngineBuilder.
|
/// Default constructor for EngineBuilder.
|
||||||
@ -641,6 +642,10 @@ public:
|
|||||||
this->UseOrcMCJITReplacement = UseOrcMCJITReplacement;
|
this->UseOrcMCJITReplacement = UseOrcMCJITReplacement;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setEmulatedTLS(bool EmulatedTLS) {
|
||||||
|
this->EmulatedTLS = EmulatedTLS;
|
||||||
|
}
|
||||||
|
|
||||||
TargetMachine *selectTarget();
|
TargetMachine *selectTarget();
|
||||||
|
|
||||||
/// selectTarget - Pick a target either via -march or by guessing the native
|
/// selectTarget - Pick a target either via -march or by guessing the native
|
||||||
|
@ -95,7 +95,8 @@ TargetMachine *EngineBuilder::selectTarget(const Triple &TargetTriple,
|
|||||||
TargetMachine *Target =
|
TargetMachine *Target =
|
||||||
TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,
|
TheTarget->createTargetMachine(TheTriple.getTriple(), MCPU, FeaturesStr,
|
||||||
Options, RelocModel, CMModel, OptLevel,
|
Options, RelocModel, CMModel, OptLevel,
|
||||||
/*JIT*/ true);
|
/*JIT*/ true);
|
||||||
|
Target->Options.EmulatedTLS = EmulatedTLS;
|
||||||
assert(Target && "Could not allocate target machine!");
|
assert(Target && "Could not allocate target machine!");
|
||||||
return Target;
|
return Target;
|
||||||
}
|
}
|
||||||
|
10
test/ExecutionEngine/MCJIT/tlvtest.ll
Normal file
10
test/ExecutionEngine/MCJIT/tlvtest.ll
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
; RUN: %lli %s > /dev/null
|
||||||
|
|
||||||
|
@x = thread_local local_unnamed_addr global i32 0
|
||||||
|
|
||||||
|
define i32 @main() {
|
||||||
|
entry:
|
||||||
|
store i32 42, i32* @x
|
||||||
|
ret i32 0
|
||||||
|
}
|
||||||
|
|
10
test/ExecutionEngine/OrcMCJIT/tlvtest.ll
Normal file
10
test/ExecutionEngine/OrcMCJIT/tlvtest.ll
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
; RUN: %lli %s > /dev/null
|
||||||
|
|
||||||
|
@x = thread_local local_unnamed_addr global i32 0
|
||||||
|
|
||||||
|
define i32 @main() {
|
||||||
|
entry:
|
||||||
|
store i32 42, i32* @x
|
||||||
|
ret i32 0
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user