mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-31 16:02:52 +01:00
5f190b5e4e
In r143502, we renamed getHostTriple() to getDefaultTargetTriple() as part of work to allow the user to supply a different default target triple at configure time. This change also affected the JIT. However, it is inappropriate to use the default target triple in the JIT in most circumstances because this will not necessarily match the current architecture used by the process, leading to illegal instruction and other such errors at run time. Introduce the getProcessTriple() function for use in the JIT and its clients, and cause the JIT to use it. On architectures with a single bitness, the host and process triples are identical. On other architectures, the host triple represents the architecture of the host CPU, while the process triple represents the architecture used by the host CPU to interpret machine code within the current process. For example, when executing 32-bit code on a 64-bit Linux machine, the host triple may be 'x86_64-unknown-linux-gnu', while the process triple may be 'i386-unknown-linux-gnu'. This fixes JIT for the 32-on-64-bit (and vice versa) build on non-Apple platforms. Differential Revision: http://llvm-reviews.chandlerc.com/D254 llvm-svn: 172627
33 lines
1.4 KiB
LLVM
33 lines
1.4 KiB
LLVM
; RUN: %lli_mcjit %s > /dev/null
|
|
|
|
define i32 @main() {
|
|
%shamt = add i8 0, 1 ; <i8> [#uses=8]
|
|
%shift.upgrd.1 = zext i8 %shamt to i32 ; <i32> [#uses=1]
|
|
%t1.s = shl i32 1, %shift.upgrd.1 ; <i32> [#uses=0]
|
|
%t2.s = shl i32 1, 4 ; <i32> [#uses=0]
|
|
%shift.upgrd.2 = zext i8 %shamt to i32 ; <i32> [#uses=1]
|
|
%t1 = shl i32 1, %shift.upgrd.2 ; <i32> [#uses=0]
|
|
%t2 = shl i32 1, 5 ; <i32> [#uses=0]
|
|
%t2.s.upgrd.3 = shl i64 1, 4 ; <i64> [#uses=0]
|
|
%t2.upgrd.4 = shl i64 1, 5 ; <i64> [#uses=0]
|
|
%shift.upgrd.5 = zext i8 %shamt to i32 ; <i32> [#uses=1]
|
|
%tr1.s = ashr i32 1, %shift.upgrd.5 ; <i32> [#uses=0]
|
|
%tr2.s = ashr i32 1, 4 ; <i32> [#uses=0]
|
|
%shift.upgrd.6 = zext i8 %shamt to i32 ; <i32> [#uses=1]
|
|
%tr1 = lshr i32 1, %shift.upgrd.6 ; <i32> [#uses=0]
|
|
%tr2 = lshr i32 1, 5 ; <i32> [#uses=0]
|
|
%tr1.l = ashr i64 1, 4 ; <i64> [#uses=0]
|
|
%shift.upgrd.7 = zext i8 %shamt to i64 ; <i64> [#uses=1]
|
|
%tr2.l = ashr i64 1, %shift.upgrd.7 ; <i64> [#uses=0]
|
|
%tr3.l = shl i64 1, 4 ; <i64> [#uses=0]
|
|
%shift.upgrd.8 = zext i8 %shamt to i64 ; <i64> [#uses=1]
|
|
%tr4.l = shl i64 1, %shift.upgrd.8 ; <i64> [#uses=0]
|
|
%tr1.u = lshr i64 1, 5 ; <i64> [#uses=0]
|
|
%shift.upgrd.9 = zext i8 %shamt to i64 ; <i64> [#uses=1]
|
|
%tr2.u = lshr i64 1, %shift.upgrd.9 ; <i64> [#uses=0]
|
|
%tr3.u = shl i64 1, 5 ; <i64> [#uses=0]
|
|
%shift.upgrd.10 = zext i8 %shamt to i64 ; <i64> [#uses=1]
|
|
%tr4.u = shl i64 1, %shift.upgrd.10 ; <i64> [#uses=0]
|
|
ret i32 0
|
|
}
|