summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* Expose InsertPreheaderForLoop from LoopSimplify to other passesHal Finkel2013-05-202-11/+38
| | | | | | | | | | | Other passes, PPC counter-loop formation for example, also need to add loop preheaders outside of the regular loop simplification pass. This makes InsertPreheaderForLoop a global function so that it can be used by other passes. No functionality change intended. llvm-svn: 182299
* [NVPTX] Fix mis-use of CurrentFnSym in NVPTXAsmPrinter. This was causing a ↵Justin Holewinski2013-05-202-9/+44
| | | | | | symbol name error in the output PTX. llvm-svn: 182298
* [NVPTX] Add programmatic interface to NVVMReflect passJustin Holewinski2013-05-202-3/+24
| | | | llvm-svn: 182297
* Rename PPC MTCTRse to MTCTRloopHal Finkel2013-05-203-7/+7
| | | | | | | | | | As the pairing of this instruction form with the bdnz/bdz branches is now enforced by the verification pass, make it clear from the name that these are used only for counter-based loops. No functionality change intended. llvm-svn: 182296
* Add a PPCCTRLoops verification passHal Finkel2013-05-203-0/+164
| | | | | | | | | | | | | | | | | | When asserts are enabled, this adds a verification pass for PPC counter-loop formation. Unfortunately, without sacrificing code quality, there is no better way of forming counter-based loops except at the (late) IR level. This means that we need to recognize, at the IR level, anything which might turn into a function call (or indirect branch). Because this is currently a finite set of things, and because SelectionDAG lowering is basic-block local, this can be done. Nevertheless, it is fragile, and failure results in a miscompile. This verification pass checks that all (reachable) counter-based branches are dominated by a loop mtctr instruction, and that no instructions in between clobber the counter register. If these conditions are not satisfied, then an ICE will be triggered. In short, this is to help us sleep better at night. llvm-svn: 182295
* R600: Fix bug detected by GCC warning.Benjamin Kramer2013-05-201-2/+2
| | | | | | | | | R600TextureIntrinsicsReplacer.cpp:232: warning: the address of ‘ArgsType’ will always evaluate as ‘true’ This doesn't have any effect on the output as a vararg intrinsic behaves the same way as a non-vararg one. llvm-svn: 182293
* R600: Fix rotr.ll on non-asserts buildsTom Stellard2013-05-201-6/+2
| | | | | | The -debug-only option is only available on asserts builds. llvm-svn: 182291
* R600/SI: Use a multiclass for MUBUF_Load_HelperTom Stellard2013-05-202-20/+30
| | | | | | | This will simplify the instructions and also the pattern definitions. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182288
* R600/SI: Add a pattern for S_LOAD_DWORDX2_* instructionsTom Stellard2013-05-201-0/+1
| | | | | Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182287
* R600/SI: Add pattern for rotrTom Stellard2013-05-202-9/+21
| | | | | Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182286
* R600: Swap the legality of rotl and rotrTom Stellard2013-05-208-28/+40
| | | | | | The hardware supports rotr and not rotl. llvm-svn: 182285
* R600/SI: Add patterns for 64-bit shift operationsTom Stellard2013-05-203-3/+25
| | | | | Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182284
* R600/SI: Use the same names for VOP3 operands and encoding fieldsTom Stellard2013-05-202-37/+37
| | | | | | | | This makes it possible to reorder the operands without breaking the encoding. Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182283
* R600/SI: Make fitsRegClass() operands constTom Stellard2013-05-202-2/+3
| | | | | Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182282
* VSTn instructions have a number of encoding constraints which are not ↵Mihai Popa2013-05-204-25/+117
| | | | | | implemented. I have added these using wrapper methods around the original custom decoder (incidentally - this is a huge poorly written method that should be cleaned up. I have left it as is since the changes would be much to hard to review). llvm-svn: 182281
* Q registers are encoded in fields of the same length as D registers. As Q ↵Mihai Popa2013-05-202-3/+3
| | | | | | registers are half as many, the ARM reference manual mandates the least significant bit to be zeroed out. Failure to do so should result in an undefined instruction. With this change test/MC/Disassembler/ARM/invalid-VQADD-arm.txt is passing (removed XFAIL). llvm-svn: 182279
* [SystemZ] Add long branch passRichard Sandiford2013-05-2017-37/+599
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, the SystemZ backend would use BRCL for all branches and only consider shortening them to BRC when generating an object file. E.g. a branch on equal would use the JGE alias of BRCL in assembly output, but might be shortened to the JE alias of BRC in ELF output. This was a useful first step, but it had two problems: (1) The z assembler isn't traditionally supposed to perform branch shortening or branch relaxation. We followed this rule by not relaxing branches in assembler input, but that meant that generating assembly code and then assembling it would not produce the same result as going directly to object code; the former would give long branches everywhere, whereas the latter would use short branches where possible. (2) Other useful branches, like COMPARE AND BRANCH, do not have long forms. We would need to do something else before supporting them. (Although COMPARE AND BRANCH does not change the condition codes, the plan is to model COMPARE AND BRANCH as a CC-clobbering instruction during codegen, so that we can safely lower it to a separate compare and long branch where necessary. This is not a valid transformation for the assembler proper to make.) This patch therefore moves branch relaxation to a pre-emit pass. For now, calls are still shortened from BRASL to BRAS by the assembler, although this too is not really the traditional behaviour. The first test takes about 1.5s to run, and there are likely to be more tests in this vein once further branch types are added. The feeling on IRC was that 1.5s is a bit much for a single test, so I've restricted it to SystemZ hosts for now. The patch exposes (and fixes) some typos in the main CodeGen/SystemZ tests. A later patch will remove the {{g}}s from that directory. llvm-svn: 182274
* Enable pod-like optimizations for pred and succ iterators.Benjamin Kramer2013-05-202-1/+4
| | | | llvm-svn: 182257
* [NVPTX] Add GenericToNVVM IR converter to better handle idiomatic LLVM IR inputsJustin Holewinski2013-05-208-80/+550
| | | | | | | | | | | | | | | This converter currently only handles global variables in address space 0. For these variables, they are promoted to address space 1 (global memory), and all uses are updated to point to the result of a cvta.global instruction on the new variable. The motivation for this is address space 0 global variables are illegal since we cannot declare variables in the generic address space. Instead, we place the variables in address space 1 and explicitly convert the pointer to address space 0. This is primarily intended to help new users who expect to be able to place global variables in the default address space. llvm-svn: 182254
* [NVPTX] Fix i1 kernel parameters and global variables. ABI rules say we ↵Justin Holewinski2013-05-203-2/+49
| | | | | | need to use .u8 for i1 parameters for kernels. llvm-svn: 182253
* PR15868 fix.Stepan Dyatkovskiy2013-05-208-19/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduction: In case when stack alignment is 8 and GPRs parameter part size is not N*8: we add padding to GPRs part, so part's last byte must be recovered at address K*8-1. We need to do it, since remained (stack) part of parameter starts from address K*8, and we need to "attach" "GPRs head" without gaps to it: Stack: |---- 8 bytes block ----| |---- 8 bytes block ----| |---- 8 bytes... [ [padding] [GPRs head] ] [ ------ Tail passed via stack ------ ... FIX: Note, once we added padding we need to correct *all* Arg offsets that are going after padded one. That's why we need this fix: Arg offsets were never corrected before this patch. See new test-cases included in patch. We also don't need to insert padding for byval parameters that are stored in GPRs only. We need pad only last byval parameter and only in case it outsides GPRs and stack alignment = 8. Though, stack area, allocated for recovered byval params, must satisfy "Size mod 8 = 0" restriction. This patch reduces stack usage for some cases: We can reduce ArgRegsSaveArea since inner N*4 bytes sized byval params my be "packed" with alignment 4 in some cases. llvm-svn: 182237
* Disable remote MCJIT on pre-v6 ARMRenato Golin2013-05-201-0/+11
| | | | llvm-svn: 182235
* Partially revert change in r181200 that tried to simplify JIT unit test #ifdefs.Bob Wilson2013-05-201-3/+25
| | | | | | | | | | | | | | The export list for this test requires the following symbols to be available: JITTest_AvailableExternallyFunction JITTest_AvailableExternallyGlobal The change in r181200 commented them out, which caused the test to fail to link, at least on Darwin. I have only reverted the change for arm, since I can't test the other targets and since it sounds like that change was fixing real problems for those other targets. It should be possible to rearrange the code to keep those definitions outside the #ifdefs, but that should be done by someone who can reproduce the problems that r181200 was trying to fix. llvm-svn: 182233
* Also expand 64-bit bitcasts.Jakob Stoklund Olesen2013-05-202-0/+18
| | | | llvm-svn: 182229
* Implement spill and fill of I64Regs.Jakob Stoklund Olesen2013-05-202-2/+17
| | | | llvm-svn: 182228
* Mark i64 SETCC as expand so it is turned into a SELECT_CC.Jakob Stoklund Olesen2013-05-202-0/+12
| | | | llvm-svn: 182227
* Replace some bit operations with simpler ones. No functionality change.Benjamin Kramer2013-05-193-12/+9
| | | | llvm-svn: 182226
* Don't use %g0 to materialize 0 directly.Jakob Stoklund Olesen2013-05-194-5/+14
| | | | | | | | The wired physreg doesn't work on tied operands like on MOVXCC. Add a README note to fix this later. llvm-svn: 182225
* Select i64 values with %icc conditions.Jakob Stoklund Olesen2013-05-192-0/+16
| | | | llvm-svn: 182224
* Remove declaration of __clear_cache for __APPLE__. <rdar://problem/13924072>Bob Wilson2013-05-191-0/+3
| | | | | | | | | | | | | | | This fixes a bootstrapping problem with builds for Apple ARM targets. Clang had the wrong prototype for __clear_cache with ARM targets. Rafael fixed that in clang svn r181784 and r181810, but without those changes, we can't build this code for ARM because clang reports an error about the declaration in Memory.inc not matching the builtin declaration. Some of our buildbots need to use an older compiler that doesn't have the clang fix. Since __clear_cache is never used here when __APPLE__ is defined, I'm just conditionalizing the declaration to match that. I also moved the declaration of sys_icache_invalidate inside the conditional for __APPLE__ while I was at it. llvm-svn: 182223
* Add floating point selects on %xcc predicates.Jakob Stoklund Olesen2013-05-192-0/+32
| | | | llvm-svn: 182222
* Implement SPselectfcc for i64 operands.Jakob Stoklund Olesen2013-05-193-27/+42
| | | | | | | Also clean up the arguments to all the MOVCC instructions so the operands always are (true-val, false-val, cond-code). llvm-svn: 182221
* SubArch support in MCJIT unittestRenato Golin2013-05-193-3/+31
| | | | llvm-svn: 182220
* [Sparc] Rearrange integer registers' allocation order so that register ↵Venkatraman Govindaraju2013-05-193-11/+24
| | | | | | | | allocator will use I and G registers before using L and O registers. Also, enable registers %g2-%g4 to be used in application and %g5 in 64 bit mode. llvm-svn: 182219
* AArch64: enable MCJIT unittestsTim Northover2013-05-193-1/+3
| | | | llvm-svn: 182217
* Handle i64 FrameIndex nodes in SPARC v9 mode.Jakob Stoklund Olesen2013-05-192-1/+11
| | | | llvm-svn: 182216
* AArch64: make RuntimeDyld relocations idempotentTim Northover2013-05-191-2/+22
| | | | | | | | | | AArch64 ELF uses .rela relocations so there's no need to actually make use of the bits we're setting in the destination However, we should make sure all bits are cleared properly since multiple runs of resolveRelocations are possible and these could combine to produce invalid results if stale versions remain in the code. llvm-svn: 182214
* Invalidate instruction cache when setting memory to be executable.Tim Northover2013-05-196-15/+7
| | | | | | | | | lli's remote MCJIT code calls setExecutable just prior to running code. In line with Darwin behaviour this seems to be the place to invalidate any caches needed so that relocations can take effect properly. llvm-svn: 182213
* Temporarily disable this test because it is failing when using libc++.Bob Wilson2013-05-191-2/+3
| | | | llvm-svn: 182212
* Move the remaining simplify-libcalls tests to instcombine, merging most of ↵Benjamin Kramer2013-05-1912-138/+137
| | | | | | them into a single file. llvm-svn: 182211
* Print uint64_t -debug text correctly on 32-bit hostsTim Northover2013-05-191-5/+5
| | | | | | | | On 32-bit hosts %p can print garbage when given a uint64_t, we should use %llx instead. This only affects the output of the debugging text produced by lli. llvm-svn: 182209
* Unsupported remote JIT on ARMRenato Golin2013-05-189-6/+17
| | | | llvm-svn: 182201
* isKnownToBeAPowerOfTwo: (X & Y) + Y is a power of 2 or zero if y is also.David Majnemer2013-05-182-0/+25
| | | | | | | This is useful if something that looks like (x & (1 << y)) ? 64 : 32 is the divisor in a modulo operation. llvm-svn: 182200
* LoopVectorize: Handle single edge PHIsArnold Schwaighofer2013-05-182-4/+26
| | | | | | | | We might encouter single edge PHIs - handle them with an identity select. Fixes PR15990. llvm-svn: 182199
* docs/Passes: fix some typosDmitri Gribenko2013-05-181-4/+4
| | | | | | Patch by Yacine Belkadi. llvm-svn: 182197
* Add basic support for ELF32-ppc relocations to llvm-dwarfdump.Benjamin Kramer2013-05-182-0/+17
| | | | | | Should help the ppc32 buildbot. llvm-svn: 182194
* Check InlineAsm clobbers in PPCCTRLoopsHal Finkel2013-05-182-0/+53
| | | | | | | | We don't need to reject all inline asm as using the counter register (most does not). Only those that explicitly clobber the counter register need to prevent the transformation. llvm-svn: 182191
* AArch64: add CMake dependency to fix very parallel buildsTim Northover2013-05-181-0/+2
| | | | llvm-svn: 182190
* X86: Bad peephole interaction between adc, MOV32r0David Majnemer2013-05-182-3/+45
| | | | | | | | | | | | | | | | The peephole tries to reorder MOV32r0 instructions such that they are before the instruction that modifies EFLAGS. The problem is that the peephole does not consider the case where the instruction that modifies EFLAGS also depends on the previous state of EFLAGS. Instead, walk backwards until we find an instruction that has a def for EFLAGS but does not have a use. If we find such an instruction, insert the MOV32r0 before it. If it cannot find such an instruction, skip the optimization. llvm-svn: 182184
* Remove duplicated commentMatt Arsenault2013-05-181-5/+0
| | | | | | The same comment is already made in the header llvm-svn: 182181
OpenPOWER on IntegriCloud