summaryrefslogtreecommitdiff
path: root/contrib/llvm/lib/Target/PowerPC
Commit message (Collapse)AuthorAgeFilesLines
* Merge llvm trunk r321017 to contrib/llvm.Dimitry Andric2017-12-2054-1904/+7751
| | | | Notes: svn path=/projects/clang600-import/; revision=327023
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r308421, and updateDimitry Andric2017-07-199-71/+134
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=321238
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r307894, and updateDimitry Andric2017-07-1311-89/+577
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320970
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306956, and updateDimitry Andric2017-07-0211-98/+111
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320572
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r306325, and updateDimitry Andric2017-06-2710-89/+81
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320397
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305575, and updateDimitry Andric2017-06-1711-43/+177
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=320041
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r305145, and updateDimitry Andric2017-06-1023-52/+178
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319799
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304460, and updateDimitry Andric2017-06-0112-39/+432
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319479
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304222, and updateDimitry Andric2017-05-301-3/+0
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319250
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r304149, and updateDimitry Andric2017-05-297-29/+155
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=319164
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303571, and updateDimitry Andric2017-05-224-7/+68
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=318681
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303291, and updateDimitry Andric2017-05-186-17/+81
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=318477
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r303197, and updateDimitry Andric2017-05-1611-52/+439
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=318384
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302418, and updateDimitry Andric2017-05-082-3/+2
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=317969
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r302069, and updateDimitry Andric2017-05-034-48/+69
| | | | | | | build glue (preliminary, not all option combinations work yet). Notes: svn path=/projects/clang500-import/; revision=317778
* Merge llvm, clang, lld, lldb, compiler-rt and libc++ r301441, and updateDimitry Andric2017-04-264-14/+13
| | | | | | | build glue. Notes: svn path=/projects/clang500-import/; revision=317472
* Merge llvm, clang, lld and lldb trunk r300890, and update build glue.Dimitry Andric2017-04-202-4/+4
| | | | Notes: svn path=/projects/clang500-import/; revision=317230
* Merge llvm trunk r300422 and resolve conflicts.Dimitry Andric2017-04-1635-518/+1315
| | | | Notes: svn path=/projects/clang500-import/; revision=317029
* Merge llvm, clang, compiler-rt, libc++, lld and lldb release_40 branchDimitry Andric2017-02-014-3/+30
| | | | | | | r293807, and update build glue. Notes: svn path=/projects/clang400-import/; revision=313067
* Merge llvm, clang, lld and lldb release_40 branch r292009. Also updateDimitry Andric2017-01-142-2/+3
| | | | | | | build glue. Notes: svn path=/projects/clang400-import/; revision=312197
* Merge llvm, clang, lld and lldb trunk r291274, and resolve conflicts.Dimitry Andric2017-01-064-1/+18
| | | | Notes: svn path=/projects/clang400-import/; revision=311544
* Merge llvm, clang, lld and lldb trunk r291012, and resolve conflicts.Dimitry Andric2017-01-041-40/+39
| | | | Notes: svn path=/projects/clang400-import/; revision=311327
* Update llvm to trunk r290819 and resolve conflicts.Dimitry Andric2017-01-0250-1191/+4299
| | | | Notes: svn path=/projects/clang400-import/; revision=311142
* Update llvm, clang, lld and lldb to release_39 branch r287912.Dimitry Andric2016-11-264-7/+177
| | | | Notes: svn path=/projects/clang391-import/; revision=309175
* Pull in r283060 from upstream llvm trunk (by Hal Finkel):Dimitry Andric2016-11-255-26/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [PowerPC] Refactor soft-float support, and enable PPC64 soft float This change enables soft-float for PowerPC64, and also makes soft-float disable all vector instruction sets for both 32-bit and 64-bit modes. This latter part is necessary because the PPC backend canonicalizes many Altivec vector types to floating-point types, and so soft-float breaks scalarization support for many operations. Both for embedded targets and for operating-system kernels desiring soft-float support, it seems reasonable that disabling hardware floating-point also disables vector instructions (embedded targets without hardware floating point support are unlikely to have Altivec, etc. and operating system kernels desiring not to use floating-point registers to lower syscall cost are unlikely to want to use vector registers either). If someone needs this to work, we'll need to change the fact that we promote many Altivec operations to act on v4f32. To make it possible to disable Altivec when soft-float is enabled, hardware floating-point support needs to be expressed as a positive feature, like the others, and not a negative feature, because target features cannot have dependencies on the disabling of some other feature. So +soft-float has now become -hard-float. Fixes PR26970. Pull in r283061 from upstream clang trunk (by Hal Finkel): [PowerPC] Enable soft-float for PPC64, and +soft-float -> -hard-float Enable soft-float support on PPC64, as the backend now supports it. Also, the backend now uses -hard-float instead of +soft-float, so set the target features accordingly. Fixes PR26970. Reported by: Mark Millard PR: 214433 Notes: svn path=/head/; revision=309149
* Pull in r282174 from upstream llvm trunk (by Krzysztof Parzyszek):Dimitry Andric2016-11-251-53/+198
| | | | | | | | | | | | | | | | | | | [PPC] Set SP after loading data from stack frame, if no red zone is present Follow-up to r280705: Make sure that the SP is only restored after all data is loaded from the stack frame, if there is no red zone. This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24466 Reported by: Mark Millard PR: 214433 Notes: svn path=/head/; revision=309147
* Pull in r280705 from upstream llvm trunk (by Krzysztof Parzyszek):Dimitry Andric2016-09-101-25/+91
| | | | | | | | | | | | | | | | | [PPC] Claim stack frame before storing into it, if no red zone is present Unlike PPC64, PPC32/SVRV4 does not have red zone. In the absence of it there is no guarantee that this part of the stack will not be modified by any interrupt. To avoid this, make sure to claim the stack frame first before storing into it. This fixes https://llvm.org/bugs/show_bug.cgi?id=26519. Differential Revision: https://reviews.llvm.org/D24093 Notes: svn path=/projects/clang390-import/; revision=305686
* Pull in r280350 from upstream llvm trunk (by Hal Finkel):Dimitry Andric2016-09-102-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add ISD::EH_DWARF_CFA, simplify @llvm.eh.dwarf.cfa on Mips, fix on PowerPC LLVM has an @llvm.eh.dwarf.cfa intrinsic, used to lower the GCC-compatible __builtin_dwarf_cfa() builtin. As pointed out in PR26761, this is currently broken on PowerPC (and likely on ARM as well). Currently, @llvm.eh.dwarf.cfa is lowered using: ADD(FRAMEADDR, FRAME_TO_ARGS_OFFSET) where FRAME_TO_ARGS_OFFSET defaults to the constant zero. On x86, FRAME_TO_ARGS_OFFSET is lowered to 2*SlotSize. This setup, however, does not work for PowerPC. Because of the way that the stack layout works, the canonical frame address is not exactly (FRAMEADDR + FRAME_TO_ARGS_OFFSET) on PowerPC (there is a lower save-area offset as well), so it is not just a matter of implementing FRAME_TO_ARGS_OFFSET for PowerPC (unless we redefine its semantics -- We can do that, since it is currently used only for @llvm.eh.dwarf.cfa lowering, but the better to directly lower the CFA construct itself (since it can be easily represented as a fixed-offset FrameIndex)). Mips currently does this, but by using a custom lowering for ADD that specifically recognizes the (FRAMEADDR, FRAME_TO_ARGS_OFFSET) pattern. This change introduces a ISD::EH_DWARF_CFA node, which by default expands using the existing logic, but can be directly lowered by the target. Mips is updated to use this method (which simplifies its implementation, and I suspect makes it more robust), and updates PowerPC to do the same. Fixes PR26761. Differential Revision: https://reviews.llvm.org/D24038 Notes: svn path=/projects/clang390-import/; revision=305683
* Pull in r280188 from upstream llvm trunk (by Hal Finkel):Dimitry Andric2016-09-101-0/+11
| | | | | | | | | | | | | | | | | | [PowerPC] Don't spill the frame pointer twice When a function contains something, such as inline asm, which explicitly clobbers the register used as the frame pointer, don't spill it twice. If we need a frame pointer, it will be saved/restored in the prologue/epilogue code. Explicitly spilling it again will reuse the same spill slot used by the prologue/epilogue code, thus clobbering the saved value. The same applies to the base-pointer or PIC-base register. Partially fixes PR26856. Thanks to Ulrich for his analysis and the small inline-asm reproducer. Notes: svn path=/projects/clang390-import/; revision=305681
* Pull in r280040 from upstream llvm trunk (by Hal Finkel):Dimitry Andric2016-09-104-1/+15
| | | | | | | | | | | | | | | | | | | | | | | | [PowerPC] Add support for -mlongcall The "long call" option forces the use of the indirect calling sequence for all calls (even those that don't really need it). GCC provides this option; This is helpful, under certain circumstances, for building very-large binaries, and some other specialized use cases. Fixes PR19098. Pull in r280041 from upstream clang trunk (by Hal Finkel): [PowerPC] Add support for -mlongcall Add support for GCC's PowerPC -mlongcall option; the backend supports the corresponding target feature as of r280040. Fixes PR19098. Notes: svn path=/projects/clang390-import/; revision=305680
* Update llvm to release_39 branch r279477.Dimitry Andric2016-08-241-1/+8
| | | | Notes: svn path=/projects/clang390-import/; revision=304770
* Update llvm to release_39 branch r276489, and resolve conflicts.Dimitry Andric2016-08-1663-2160/+5127
| | | | Notes: svn path=/projects/clang390-import/; revision=304240
* Update llvm and clang to release_38 branch r261684.Dimitry Andric2016-02-242-52/+188
| | | | Notes: svn path=/projects/clang380-import/; revision=296011
* Update llvm, clang and lldb to release_38 branch r260756.Dimitry Andric2016-02-132-12/+8
| | | | Notes: svn path=/projects/clang380-import/; revision=295600
* Update llvm, clang and lldb to trunk r257626, and update build glue.Dimitry Andric2016-01-147-36/+169
| | | | Notes: svn path=/projects/clang380-import/; revision=294024
* Update llvm to trunk r256633.Dimitry Andric2015-12-3043-884/+2590
| | | | Notes: svn path=/projects/clang380-import/; revision=292941
* Upgrade our copies of clang and llvm to 3.7.1 release. This is aDimitry Andric2015-12-2510-26/+235
| | | | | | | | | | bugfix-only release, with no new features. Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information. Notes: svn path=/head/; revision=292735
* Update llvm, clang and lldb to 3.7.0 release.Dimitry Andric2015-09-065-74/+109
| | | | Notes: svn path=/projects/clang370-import/; revision=287521
* Update llvm/clang to r242221.Dimitry Andric2015-08-1226-296/+586
| | | | Notes: svn path=/projects/clang-trunk/; revision=286684
* Update llvm/clang to r241361.Dimitry Andric2015-07-0531-112/+257
| | | | Notes: svn path=/projects/clang-trunk/; revision=285181
* Update llvm/clang to r240225.Dimitry Andric2015-06-2340-165/+173
| | | | Notes: svn path=/projects/clang-trunk/; revision=284734
* Update Makefiles and other build glue for llvm/clang 3.7.0, as of trunkDimitry Andric2015-06-1017-206/+272
| | | | | | | r239412. Notes: svn path=/projects/clang-trunk/; revision=284236
* Merge llvm trunk r238337 from ^/vendor/llvm/dist, resolve conflicts, andDimitry Andric2015-05-2764-3332/+9348
| | | | | | | preserve our customizations, where necessary. Notes: svn path=/projects/clang-trunk/; revision=283631
* Upgrade our copy of clang and llvm to 3.6.1 release.Dimitry Andric2015-05-251-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | This release contains the following cherry-picked revisions from upstream trunk: 226124 226151 226164 226165 226166 226407 226408 226409 226652 226905 226983 227084 227087 227089 227208 227209 227210 227211 227212 227213 227214 227269 227430 227482 227503 227519 227574 227822 227986 227987 227988 227989 227990 228037 228038 228039 228040 228188 228189 228190 228273 228372 228373 228374 228403 228765 228848 228918 229223 229225 229226 229227 229228 229230 229234 229235 229236 229238 229239 229413 229507 229680 229750 229751 229752 229911 230146 230147 230235 230253 230255 230469 230500 230564 230603 230657 230742 230748 230956 231219 231237 231245 231259 231280 231451 231563 231601 231658 231659 231662 231984 231986 232046 232085 232142 232176 232179 232189 232382 232386 232389 232425 232438 232443 232675 232786 232797 232943 232957 233075 233080 233351 233353 233409 233410 233508 233584 233819 233904 234629 234636 234891 234975 234977 235524 235641 235662 235931 236099 236306 236307 Please note that from 3.5.0 onwards, clang and llvm require C++11 support to build; see UPDATING for more information. Notes: svn path=/head/; revision=283526
* Merge llvm 3.6.0rc3 from ^/vendor/llvm/dist, merge clang 3.6.0rc3 fromDimitry Andric2015-02-141-1/+2
| | | | | | | ^/vendor/clang/dist, resolve conflicts, and update patches README. Notes: svn path=/projects/clang360-import/; revision=278757
* Merge llvm 3.6.0rc2 from ^/vendor/llvm/dist, merge clang 3.6.0rc2 fromDimitry Andric2015-01-311-7/+9
| | | | | | | ^/vendor/clang/dist, resolve conflicts, and cleanup patches. Notes: svn path=/projects/clang360-import/; revision=278002
* Merge llvm 3.6.0rc1 from ^/vendor/llvm/dist, merge clang 3.6.0rc1 fromDimitry Andric2015-01-2561-2255/+6206
| | | | | | | ^/vendor/clang/dist, resolve conflicts, and cleanup patches. Notes: svn path=/projects/clang360-import/; revision=277718
* Upgrade our copy of clang and llvm to 3.5.1 release. This is a bugfixDimitry Andric2015-01-189-62/+142
| | | | | | | | | | | | | | | | | only release, no new features have been added. Please note that this version requires C++11 support to build; see UPDATING for more information. Release notes for llvm and clang can be found here: <http://llvm.org/releases/3.5.1/docs/ReleaseNotes.html> <http://llvm.org/releases/3.5.1/tools/clang/docs/ReleaseNotes.html> MFC after: 1 month X-MFC-With: 276479 Notes: svn path=/head/; revision=277320
* Pull in r224890 from upstream llvm trunk (by David Majnemer):Dimitry Andric2014-12-281-0/+18
| | | | | | | | | | | | | | | | | | | | | PowerPC: CTR shouldn't fire if a TLS call is in the loop Determining the address of a TLS variable results in a function call in certain TLS models. This means that a simple ICmpInst might actually result in invalidating the CTR register. In such cases, do not attempt to rely on the CTR register for loop optimization purposes. This fixes PR22034. Differential Revision: http://reviews.llvm.org/D6786 This fixes a "Invalid PPC CTR loop" error when compiling parts of libc for PowerPC-32. Notes: svn path=/projects/clang350-import/; revision=276324
* Pull in r221703 from upstream llvm trunk (by Bill Schmidt):Dimitry Andric2014-12-277-125/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [PowerPC] Replace foul hackery with real calls to __tls_get_addr My original support for the general dynamic and local dynamic TLS models contained some fairly obtuse hacks to generate calls to __tls_get_addr when lowering a TargetGlobalAddress. Rather than generating real calls, special GET_TLS_ADDR nodes were used to wrap the calls and only reveal them at assembly time. I attempted to provide correct parameter and return values by chaining CopyToReg and CopyFromReg nodes onto the GET_TLS_ADDR nodes, but this was also not fully correct. Problems were seen with two back-to-back stores to TLS variables, where the call sequences ended up overlapping with unhappy results. Additionally, since these weren't real calls, the proper register side effects of a call were not recorded, so clobbered values were kept live across the calls. The proper thing to do is to lower these into calls in the first place. This is relatively straightforward; see the changes to PPCTargetLowering::LowerGlobalTLSAddress() in PPCISelLowering.cpp. The changes here are standard call lowering, except that we need to track the fact that these calls will require a relocation. This is done by adding a machine operand flag of MO_TLSLD or MO_TLSGD to the TargetGlobalAddress operand that appears earlier in the sequence. The calls to LowerCallTo() eventually find their way to LowerCall_64SVR4() or LowerCall_32SVR4(), which call FinishCall(), which calls PrepareCall(). In PrepareCall(), we detect the calls to __tls_get_addr and immediately snag the TargetGlobalTLSAddress with the annotated relocation information. This becomes an extra operand on the call following the callee, which is expected for nodes of type tlscall. We change the call opcode to CALL_TLS for this case. Back in FinishCall(), we change it again to CALL_NOP_TLS for 64-bit only, since we require a TOC-restore nop following the call for the 64-bit ABIs. During selection, patterns in PPCInstrInfo.td and PPCInstr64Bit.td convert the CALL_TLS nodes into BL_TLS nodes, and convert the CALL_NOP_TLS nodes into BL8_NOP_TLS nodes. This replaces the code removed from PPCAsmPrinter.cpp, as the BL_TLS or BL8_NOP_TLS nodes can now be emitted normally using their patterns and the associated printTLSCall print method. Finally, as a result of these changes, all references to get-tls-addr in its various guises are no longer used, so they have been removed. There are existing TLS tests to verify the changes haven't messed anything up). I've added one new test that verifies that the problem with the original code has been fixed. This fixes a fatal "Bad machine code" error when compiling parts of libgomp for 32-bit PowerPC. Notes: svn path=/projects/clang350-import/; revision=276301