summaryrefslogtreecommitdiffstats
path: root/llvm
Commit message (Collapse)AuthorAgeFilesLines
* r182085 introduced a change that triggered an assertion on ARM. This is an ↵David Tweed2013-05-171-2/+4
| | | | | | | | immediate fix which doesn't resolve the deeper problem. llvm-svn: 182098
* [PowerPC] Fix hi/lo encoding in old-style code emitterUlrich Weigand2013-05-174-33/+17
| | | | | | | | | | | | | | | | | This patch implements the equivalent change to r182091/r182092 in the old-style code emitter. Instead of having two separate 16-bit immediate encoding routines depending on the instruction, this patch introduces a single encoder that checks the machine operand flags to decide whether the low or high half of a symbol address is required. Since now both encoders make no further distinction between "symbolLo" and "symbolHi", the .td operand can now use a single getS16ImmEncoding method. Tested by running the old-style JIT tests on 32-bit Linux. llvm-svn: 182097
* [PowerPC] Merge/rename PPC fixup typesUlrich Weigand2013-05-175-53/+42
| | | | | | | | | | | | | | Now that fixup_ppc_ha16 and fixup_ppc_lo16 are being treated exactly the same everywhere, it no longer makes sense to have two fixup types. This patch merges them both into a single type fixup_ppc_half16, and renames fixup_ppc_lo16_ds to fixup_ppc_half16ds for consistency. (The half16 and half16ds names are taken from the description of relocation types in the PowerPC ABI.) No change in code generation expected. llvm-svn: 182092
* [PowerPC] Fix processing of ha16/lo16 fixupsUlrich Weigand2013-05-174-7/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current PowerPC MC back end distinguishes between fixup_ppc_ha16 and fixup_ppc_lo16, which are determined by the instruction the fixup applies to, and uses this distinction to decide whether a fixup ought to resolve to the high or the low part of a symbol address. This isn't quite correct, however. It is valid -if unusual- assembler to use, e.g. li 1, symbol@ha or lis 1, symbol@l Whether the high or the low part of the address is used depends solely on the @ suffix, not on the instruction. In addition, both li 1, symbol and lis 1, symbol are valid, assuming the symbol address fits into 16 bits; again, both will then refer to the actual symbol value (so li will load the value itself, while lis will load the value shifted by 16). To fix this, two places need to be adapted. If the fixup cannot be resolved at assembler time, a relocation needs to be emitted via PPCELFObjectWriter::getRelocType. This routine already looks at the VK_ type to determine the relocation. The only problem is that will reject any _LO modifier in a ha16 fixup and vice versa. This is simply incorrect; any of those modifiers ought to be accepted for either fixup type. If the fixup *can* be resolved at assembler time, adjustFixupValue currently selects the high bits of the symbol value if the fixup type is ha16. Again, this is incorrect; see the above example lis 1, symbol Now, in theory we'd have to respect a VK_ modifier here. However, in fact common code never even attempts to resolve symbol references using any nontrivial VK_ modifier at assembler time; it will always fall back to emitting a reloc and letting the linker handle it. If this ever changes, presumably there'd have to be a target callback to resolve VK_ modifiers. We'd then have to handle @ha etc. there. llvm-svn: 182091
* Fix a typo (ouput => output)Sylvestre Ledru2013-05-171-1/+1
| | | | llvm-svn: 182090
* Don't cast away constness.Benjamin Kramer2013-05-171-2/+2
| | | | llvm-svn: 182086
* Minor changes to the MCJITTest unittests to use the correct API for finalizingDavid Tweed2013-05-1713-33/+48
| | | | | | | the JIT object (including XFAIL an ARM test that now needs fixing). Also renames internal function for consistency. llvm-svn: 182085
* R600/SI: return undef instead of null for skipped argumentsChristian Konig2013-05-171-2/+2
| | | | | | | | | | | This is a candidate for the stable branch. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=64694 Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Michel Dänzer <michel.daenzer@amd.com> llvm-svn: 182084
* [Sparc] Prevent instructions that defines or uses %o7 to be in call's delay ↵Venkatraman Govindaraju2013-05-162-5/+26
| | | | | | slot. llvm-svn: 182063
* Generate debug info for by-value struct args even if they are not used.Adrian Prantl2013-05-162-1/+133
| | | | | | radar://problem/13865940 llvm-svn: 182062
* llvm-objdump: Initialize MCDisassembler once instead of for each section.Ahmed Bougacha2013-05-161-45/+45
| | | | llvm-svn: 182054
* [mips] Improve instruction selection for pattern (store (fp_to_sint $src), ↵Akira Hatanaka2013-05-164-9/+92
| | | | | | | | | | | | | | | | | $ptr). Previously, three instructions were needed: trunc.w.s $f0, $f2 mfc1 $4, $f0 sw $4, 0($2) Now we need only two: trunc.w.s $f0, $f2 swc1 $f0, 0($2) llvm-svn: 182053
* Remove addFrameMove.Rafael Espindola2013-05-168-130/+88
| | | | | | | Now that we have good testing, remove addFrameMove and create cfi instructions directly. llvm-svn: 182052
* More test coverage for addFrameMove.Rafael Espindola2013-05-161-0/+15
| | | | llvm-svn: 182051
* [mips] Factor out unaligned store lowering code.Akira Hatanaka2013-05-161-10/+14
| | | | llvm-svn: 182050
* Fix cpu on test CodeGen/PowerPC/ctrloop-fp64.llHal Finkel2013-05-161-1/+1
| | | | | | We need ppc instead of generic to override native features on ppc machines. llvm-svn: 182049
* Mips assembler: Add TwoOperandConstraint definitionsJack Carter2013-05-163-3/+14
| | | | | | | | | | | | | | | This patch removes alias definition for addiu $rs,$imm and instead uses the TwoOperandAliasConstraint field in the ArithLogicI instruction class. This way all instructions that inherit ArithLogicI class have the same macro defined. The usage examples are added to test files. Patch by Vladimir Medic llvm-svn: 182048
* Mips td file formatting: white space and long linesJack Carter2013-05-164-8/+13
| | | | llvm-svn: 182047
* More addFrameMove test coverage.Rafael Espindola2013-05-161-0/+2
| | | | llvm-svn: 182046
* Create an new preheader in PPCCTRLoops to avoid counter register clobbersHal Finkel2013-05-162-153/+197
| | | | | | | | | | | | | Some IR-level instructions (such as FP <-> i64 conversions) are not chained w.r.t. the mtctr intrinsic and yet may become function calls that clobber the counter register. At the selection-DAG level, these might be reordered with the mtctr intrinsic causing miscompiles. To avoid this situation, if an existing preheader has instructions that might use the counter register, create a new preheader for the mtctr intrinsic. This extra block will be remerged with the old preheader at the MI level, but will prevent unwanted reordering at the selection-DAG level. llvm-svn: 182045
* [mips] Test case for r182042. Add comment.Akira Hatanaka2013-05-162-0/+60
| | | | llvm-svn: 182044
* [mips] Fix instruction selection pattern for sint_to_fp node to avoid ↵Akira Hatanaka2013-05-163-5/+53
| | | | | | | | | | | | | | | | | | emitting an invalid instruction sequence. Rather than emitting an int-to-FP move instruction and an int-to-FP conversion instruction during instruction selection, we emit a pseudo instruction which gets expanded post-RA. Without this change, register allocation can possibly insert a floating point register move instruction between the two instructions, which is not valid according to the ISA manual. mtc1 $f4, $4 # int-to-fp move instruction. mov.s $f2, $f4 # move contents of $f4 to $f2. cvt.s.w $f0, $f2 # int-to-fp conversion. llvm-svn: 182042
* More test coverage for addFrameMove.Rafael Espindola2013-05-161-5/+7
| | | | llvm-svn: 182041
* Mips assembler: Add branch macro definitionsJack Carter2013-05-163-16/+40
| | | | | | | | | | | | This patch adds bnez and beqz instructions which represent alias definitions for bne and beq instructions as follows: bnez $rs,$imm => bne $rs,$zero,$imm beqz $rs,$imm => beq $rs,$zero,$imm The corresponding test cases are added. Patch by Vladimir Medic llvm-svn: 182040
* DAGCombine: Also shrink eq compares where the constant is exactly as large ↵Benjamin Kramer2013-05-162-1/+17
| | | | | | | | | | | | as the smaller type. if ((x & 255) == 255) before: movzbl %al, %eax cmpl $255, %eax after: cmpb $-1, %al llvm-svn: 182038
* [mips] Fix indentation.Akira Hatanaka2013-05-161-5/+5
| | | | llvm-svn: 182036
* [mips] Delete unused enum value.Akira Hatanaka2013-05-162-4/+0
| | | | llvm-svn: 182035
* Add TargetRegisterInfo::getCoveringLanes().Jakob Stoklund Olesen2013-05-165-9/+67
| | | | | | | | This lane mask provides information about which register lanes completely cover super-registers. See the block comment before getCoveringLanes(). llvm-svn: 182034
* [PowerPC] Use true offset value in "memrix" machine operandsUlrich Weigand2013-05-1612-194/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the second part of the change to always return "true" offset values from getPreIndexedAddressParts, tackling the case of "memrix" type operands. This is about instructions like LD/STD that only have a 14-bit field to encode immediate offsets, which are implicitly extended by two zero bits by the machine, so that in effect we can access 16-bit offsets as long as they are a multiple of 4. The PowerPC back end currently handles such instructions by carrying the 14-bit value (as it will get encoded into the actual machine instructions) in the machine operand fields for such instructions. This means that those values are in fact not the true offset, but rather the offset divided by 4 (and then truncated to an unsigned 14-bit value). Like in the case fixed in r182012, this makes common code operations on such offset values not work as expected. Furthermore, there doesn't really appear to be any strong reason why we should encode machine operands this way. This patch therefore changes the encoding of "memrix" type machine operands to simply contain the "true" offset value as a signed immediate value, while enforcing the rules that it must fit in a 16-bit signed value and must also be a multiple of 4. This change must be made simultaneously in all places that access machine operands of this type. However, just about all those changes make the code simpler; in many cases we can now just share the same code for memri and memrix operands. llvm-svn: 182032
* PPC32 cannot form counter loops around i64 FP conversionsHal Finkel2013-05-162-1/+33
| | | | | | | On PPC32, i64 FP conversions are implemented using runtime calls (which clobber the counter register). These must be excluded. llvm-svn: 182023
* Add a triple to the test to try to fix the windows bots.Rafael Espindola2013-05-161-1/+1
| | | | llvm-svn: 182022
* More addFrameMove test coverage.Rafael Espindola2013-05-161-1/+9
| | | | llvm-svn: 182021
* Use new CHECK-DAG support to stabilize CodeGen/PowerPC/recipest.llBill Schmidt2013-05-161-16/+16
| | | | | | | | | While testing some experimental code to add vector-scalar registers to PowerPC, I noticed that a couple of independent instructions were flipped by the scheduler. The new CHECK-DAG support is perfect for avoiding this problem. llvm-svn: 182020
* Add more addFrameMove test coverage.Rafael Espindola2013-05-161-0/+6
| | | | llvm-svn: 182019
* Fixing a 64-bit conversion warning in MSVC.Aaron Ballman2013-05-161-1/+1
| | | | llvm-svn: 182018
* Add more test coverage for addFrameMove.Rafael Espindola2013-05-161-0/+5
| | | | llvm-svn: 182017
* Remove dead calls to addFrameMove.Rafael Espindola2013-05-161-25/+0
| | | | | | Without a PROLOG_LABEL present, the cfi instructions are never printed. llvm-svn: 182016
* [PowerPC] Report true displacement value from getPreIndexedAddressPartsUlrich Weigand2013-05-162-2/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | DAGCombiner::CombineToPreIndexedLoadStore calls a target routine to decompose a memory address into a base/offset pair. It expects the offset (if constant) to be the true displacement value in order to perform optional additional optimizations; in particular, to convert other uses of the original pointer into uses of the new base pointer after pre-increment. The PowerPC implementation of getPreIndexedAddressParts, however, simply calls SelectAddressRegImm, which returns a TargetConstant. This value is appropriate for encoding into the instruction, but it is not always usable as true displacement value: - Its type is always MVT::i32, even on 64-bit, where addresses ought to be i64 ... this causes the optimization to simply always fail on 64-bit due to this line in DAGCombiner: // FIXME: In some cases, we can be smarter about this. if (Op1.getValueType() != Offset.getValueType()) { - Its value is truncated to an unsigned 16-bit value if negative. This causes the above opimization to generate wrong code. This patch fixes both problems by simply returning the true displacement value (in its original type). This doesn't affect any other user of the displacement. llvm-svn: 182012
* Add more addFrameMove test coverage.Rafael Espindola2013-05-161-1/+6
| | | | llvm-svn: 182011
* Extend test to check the .cfi instructions.Rafael Espindola2013-05-161-1/+15
| | | | | | | I am about to refactor the calls to addFrameMove and some of the ppc ones were not being tested. llvm-svn: 182009
* [SystemZ] Tweak register array commentRichard Sandiford2013-05-161-2/+5
| | | | llvm-svn: 182007
* Relax CHECK-NEXTs a bit to cope with atom's return nop padding.Benjamin Kramer2013-05-161-2/+2
| | | | llvm-svn: 181999
* [msan] Switch TLS globals to initial-exec model.Evgeniy Stepanov2013-05-162-8/+17
| | | | | | They are always defined in the main executable. llvm-svn: 181994
* Removed unused variable, detected by gccPatrik Hagglund2013-05-161-2/+0
| | | | | | -Wunused-but-set-variable. Leftover from r181979. llvm-svn: 181993
* Delete dead code.Rafael Espindola2013-05-161-1/+2
| | | | llvm-svn: 181982
* Don't call addFrameMove on XCore.Rafael Espindola2013-05-161-34/+0
| | | | | | | | getExceptionHandlingType is not ExceptionHandling::DwarfCFI on xcore, so etFrameInstructions is never called. There is no point creating cfi instructions if they are never used. llvm-svn: 181979
* Respect the 'nobuiltin' attribute when determining if a call is to a memory ↵Richard Smith2013-05-162-0/+21
| | | | | | builtin. llvm-svn: 181978
* Extend test for better coverage.Rafael Espindola2013-05-161-1/+6
| | | | | | | | | | | | | | | | | Without this change nothing was covering this addFrameMove: // For 64-bit SVR4 when we have spilled CRs, the spill location // is SP+8, not a frame-relative slot. if (Subtarget.isSVR4ABI() && Subtarget.isPPC64() && (PPC::CR2 <= Reg && Reg <= PPC::CR4)) { MachineLocation CSDst(PPC::X1, 8); MachineLocation CSSrc(PPC::CR2); MMI.addFrameMove(Label, CSDst, CSSrc); continue; } llvm-svn: 181976
* Removed dead code.Rafael Espindola2013-05-161-8/+4
| | | | llvm-svn: 181975
* Fix PBQP graph iterator typedefs.Lang Hames2013-05-161-4/+4
| | | | llvm-svn: 181973
OpenPOWER on IntegriCloud