- 19 Sep, 2014 2 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/577353003
-
Jan Voung authored
Lift the enums out of IceInstX8632.h and IceTargetLoweringX8632.h. This will later allow the assembler to share the enum values and use them as encodings where appropriate. E.g., to avoid having a separate enum in: https://codereview.chromium.org/476323004/diff/680001/src/assembler_constants_ia32.h The "all registers" enum is retained, but separate GPRRegister and XmmRegister enums are created with tags "Encoded_Reg_foo" to represent the encoded value of register "foo". Functions are added to convert from the "all registers" namespace to the encoded ones. Re-order the BrCond so that they match the encoding according to the "Instruction Subcode" in B.1 of the Intel Manuals. BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/582113003
-
- 18 Sep, 2014 2 commits
-
-
Jim Stichnoth authored
Use --llc to pass extra arguments to pnacl-translate. Use --sz to pass extra arguments to llvm2ice. The --stats argument is removed from the script because it is Subzero-only, and can now be done with --sz=--stats . BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/582593002
-
Jim Stichnoth authored
1. Unconditional branch to the next basic block is removed. 2. For a conditional branch with a "false" edge to the next basic block, remove the unconditional branch to the fallthrough block. 3. For a conditional branch with a "true" edge to the next basic block, invert the condition and do like #2. This is enabled only for O2, particularly because inverting the branch condition is a marginally risky operation. This decreases the instruction count by about 5-6%. Also, --stats prints a final tally to make it easier to post-process the output. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/580903005
-
- 17 Sep, 2014 5 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/576243002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/559723003
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/576853002
-
Jim Stichnoth authored
This is needed since we are now using an absolute (and non-standard) path to clang++. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/567393007
-
Jim Stichnoth authored
The following are collected: - Number of machine instructions emitted - Number of registers saved/restored in prolog/epilog - Number of stack frame bytes (non-alloca) allocated - Number of "spills", or stores to stack slots - Number of "fills", or loads/operations from stack slots - Fill+Spill count (sum of above two) These are somewhat reasonable approximations of code quality, and the primary intention is to compare before-and-after when trying out an optimization. The statistics are dumped after translating each function. Per-function and cumulative statistics are collected. The output lines have a prefix that is easy to filter. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/580633002
-
- 16 Sep, 2014 5 commits
-
-
Jan Voung authored
In many cases, we expect a constant to be 32-bits or less. This simplifies range checking for x86 memory operand displacements (can only be 32-bit), or immediates in instructions (also 32-bit), since we only store 32-bits (so it trivially fits in 32-bits). Checks for whether a constant fits in 8-bits can be done on the 32-bit value instead of the 64-bit value. When TargetLowering sees a 64-bit immediate as an operand on a 64-bit instruction, it should have split the 64-bit immediate into a 32-bit loOperand(), and a 32-bit hiOperand(). So what's left for the Emit pass should be 32-bit constants. Other places which work with constants: - intrinsic operands (the ABI only allows i32 params for atomic mem order, or atomic is lock free byte-size, or the longjmp param). - addressing mode optimization (gep expansion should be working with i32 constants). - insertelement, and extractelement constant indices (bitcode reader restricts the type of the index to be i32 also). I guess now you may end up with multiple copies of what may be the "same" constant (i64 0 vs i32 0). BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/569033002
-
Karl Schimpf authored
Also fixes error messages on instruction operands, to print out the operand (rather than pointer to it), since we can now print out operands. BUG= https://code.google.com/p/nativeclient/issues/detail?id=389 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/577703002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/551723003
-
Jim Stichnoth authored
One wants to omit the --init option to make things go faster, but then there's the risk that the pexe or llvm2ice or llc has changed and --init is actually necessary. This change automatically compares the modification timestamps of the pexe and the llvm2ice and llc binaries against the modification timestamps of the object files to determine whether re-translation is needed. The --init option forces re-translation regardless of timestamps. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/551373008
-
Jim Stichnoth authored
A "standalone" version of dump() is provided, taking just an Ostream argument and not requiring a Cfg or GlobalContext argument. BUG= none R=kschimpf@google.com Review URL: https://codereview.chromium.org/570713006
-
- 15 Sep, 2014 2 commits
-
-
Karl Schimpf authored
LLVM objects/libraries are now built using clang from chrome. This CL changes the compiler to chrome clang, and adds an appropriate dynamic library path to the linked executable so that llvm2ice can be run in any directory. BUG=None R=jvoung@chromium.org Review URL: https://codereview.chromium.org/571973004
-
Jim Stichnoth authored
Also, refactor the key part of the address mode inference into separate functions, since it's getting unwieldy. The main thing is that we mark phi temporaries as multi-definition, and disallow address mode inference transformations that involve such temporaries, because this is incorrect particular when there are backward branches involved. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/557953007
-
- 12 Sep, 2014 4 commits
-
-
Jim Stichnoth authored
In x86-32, floating point values are returned to the caller on the top of the x87 floating point stack. The caller is required to remove it from the x87 FP stack, e.g. via the fstp instruction. This must be done even when the return value is not actually used anywhere else in the function, in which case O2 is likely to want to dead-code eliminate the fstp instruction. We enforce this by adding a fake use of the fstp destination. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/563303003
-
Jan Voung authored
ffs() vs findFirstSet() are slightly different, indexing is 0-based instead of 1-based. Example mingw error: http://build.chromium.org/p/tryserver.nacl/builders/nacl-toolchain-win7-pnacl-x86_64/builds/1920/steps/llvm_i686_w64_mingw32%20%28build%29/logs/stdio BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/563303002
-
Karl Schimpf authored
This is a workaround for issue that Subzero currently assumes all global addresses have a name, but finalized pexe files leave most global addresses unnamed. It does this by allowing two optional command-line flag name prefixes that are used to generate names for unnamed global addresses. BUG= None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/567703003
-
Jan Voung authored
BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/567553003
-
- 11 Sep, 2014 3 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/568473002
-
Jim Stichnoth authored
BUG= none R=jfb@chromium.org Review URL: https://codereview.chromium.org/565553002
-
Karl Schimpf authored
Also fixes minor issues with branches in instructions (i.e. defining entry node and computing predecessors). BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/561823002
-
- 10 Sep, 2014 3 commits
-
-
Karl Schimpf authored
Fixes call to extractElement. BUG= None R=stichnot@chromium.org Review URL: https://codereview.chromium.org/562783002
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3892 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/561883002
-
Jim Stichnoth authored
This addresses a TODO and fixes a code generation bug that was causing sprintf and _vfprintf_r to execute incorrectly. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/560773002
-
- 09 Sep, 2014 5 commits
-
-
Jan Voung authored
Ended up needing to fix the InstX8632Lockable error that JF ran into now that -O0 is really -O0: https://codereview.chromium.org/512933006/ BUG=none R=stichnot@chromium.org Review URL: https://codereview.chromium.org/557933002
-
Jim Stichnoth authored
BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/560493002
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/545623005
-
Jim Stichnoth authored
The script translates a pexe using both Subzero and llc, and then uses linker tricks to resolve each symbol into either its Subzero or llc version. This enables quick bisection-based debugging of Subzero code generation. BUG= none R=jfb@chromium.org, jvoung@chromium.org Review URL: https://codereview.chromium.org/551953002
-
Jim Stichnoth authored
1. Modify dump() to match LLVM. 2. If it weren't for minimum stack alignment, the alignment code would be broken, so add a test in case the alignment code changes. BUG= none R=jvoung@chromium.org, kschimpf@google.com Review URL: https://codereview.chromium.org/557533003
-
- 08 Sep, 2014 4 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/548553002
-
Jim Stichnoth authored
This makes it much easier to run scripts from different working directories, as long as they are run somewhere under the native_client directory. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/554013002
-
Jim Stichnoth authored
One issue is that the test_arith cross test defined functions on i1 but never actually invoked them. Another issue is that the lowering was using 8-bit registers for i1 values, but was being sloppy about leaving stuff in the upper 7 bits, and then using all 8 bits for tests. This takes the approach of explicitly masking the result whenever it's possible for the result to exceed one bit, such as trunc, fptosi, fptoui. Another possibility might be to allow the upper 7 bits to stay sloppy, and explicitly only test the lower bit. Additionally, some "CHECK: ret" lines were removed, since they aren't actually needed after the change to use CHECK-LABEL, and they are affected by an llvm-dump bug (which is fixed in LLVM 3.6). BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/547033002
-
Jim Stichnoth authored
This is the truncating cvt instruction instead of rounding. A few interesting floating point inputs are added to the cross tests. Also, the cross test error output is modified to be more clear. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/550723002
-
- 05 Sep, 2014 2 commits
-
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/545603003
-
Karl Schimpf authored
BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/543793003
-
- 04 Sep, 2014 3 commits
-
-
Jim Stichnoth authored
Also declare a few variables as Constant* instead of Operand* when they hold the result of Ctx->getConstantInt(), to be consistent with the rest of the code. BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/541093002
-
Karl Schimpf authored
BUG=https: //code.google.com/p/nativeclient/issues/detail?id=3894 R=stichnot@chromium.org Review URL: https://codereview.chromium.org/531123002
-
Jim Stichnoth authored
There's already a hack that emits asm like: lea eax, myglobal instead of: mov eax, [myglobal] because of an llvm-mc parser bug. However, the lea hack still doesn't work if the symbol is a reserved word, e.g.: lea eax, flags The extra hack is to drop into AT&T syntax temporarily: .att_syntax leal flags, %eax .intel_syntax BUG= none R=jvoung@chromium.org Review URL: https://codereview.chromium.org/543803002
-