mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-04 05:33:04 -04:00
Squashed commit of the following: commit 4d555935ac5c77164d9af2494f470abdb542a434 Author: Duncan Sands <baldrick@free.fr> Date: Tue Jan 26 11:58:04 2010 +0000 Tweak the way appendModuleInlineAsm works, so you aren't obliged to append a newline when using setModuleInlineAsm in case later someone calls appendModuleInlineAsm - make newline handling fully automatic. In case anyone is wondering there is only one user of appendModuleInlineAsm: the dragonegg plugin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94539 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16cc9fd0863e778a34ef4559180f059224d2e78b Author: Edwin Török <edwintorok@gmail.com> Date: Tue Jan 26 08:50:50 2010 +0000 Regenerate configure. With the previous cleanup to configure.ac, configure is now only 393k, instead of 1.1M! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94535 91177308-0d34-0410-b5e6-96231b3b80d8 commit 239f981ac0b583f113a8c6ffcf51002b1dc5994c Author: Edwin Török <edwintorok@gmail.com> Date: Tue Jan 26 08:48:04 2010 +0000 Remove unneeded checks from configure.ac. HAVE_{BI,STD,FWD}_ITERATOR and HAVE_NAMESPACES were not used in the code. bison and flex are no longer used. CAN_DLOPEN_SELF was never used either. AC_PROG_LIBTOOL is not needed since we don't use libtool, we only need the libltdl checks for dlopen. Add check for AR, it used to be done by AC_PROG_LIBTOOL. AC_TYPE_SIGNAL is deprecated, follow autoupdate's suggestion and replace with void. Remove unused m4 files. Configure can now be generated using autoconf 2.65 too, without any warnings! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94534 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad97ab8596f7ffb831e6b494ceb735d0a0ef0286 Author: Edwin Török <edwintorok@gmail.com> Date: Tue Jan 26 08:43:05 2010 +0000 Fix autoconf 2.65 warning (don't use _cv_ inside AC_CACHE_VAL). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94533 91177308-0d34-0410-b5e6-96231b3b80d8 commit 708db218ba4afbd6c96c7648dda80f4b20185d19 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Jan 26 08:27:24 2010 +0000 Remove warning about non return on a non-void function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94532 91177308-0d34-0410-b5e6-96231b3b80d8 commit 56178773f3fa4ba2a3f0c0286cb42eaeeb9ba049 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 06:53:37 2010 +0000 eliminate the TargetLowering::UsesGlobalOffsetTable bool, which is subsumed by TargetLowering::getJumpTableEncoding(). Change uses of it to be more specific. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94529 91177308-0d34-0410-b5e6-96231b3b80d8 commit ab9d79bdabd469ecd40d76f77cb9e391e052115a Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 06:42:44 2010 +0000 Now that printPICJumpTableSetLabel is not overloaded, inline it into its only caller, allowing us to simplify it and hoist bits out of the loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94528 91177308-0d34-0410-b5e6-96231b3b80d8 commit 576b9165cf59ce6b435defb6718b31d7a501615e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 06:28:43 2010 +0000 Move getJTISymbol from MachineJumpTableInfo to MachineFunction, which is more convenient, and change getPICJumpTableRelocBaseExpr to take a MachineFunction to match. Next, move the X86 code that create a PICBase symbol to X86TargetLowering::getPICBaseSymbol from X86MCInstLower::GetPICBaseSymbol, which was an asmprinter specific library. This eliminates a 'gross hack', and allows us to implement X86ISelLowering::getPICJumpTableRelocBaseExpr which now calls it. This in turn allows us to eliminate the X86AsmPrinter::printPICJumpTableSetLabel method, which was the only overload of printPICJumpTableSetLabel. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94526 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7ab57e0e40914ec7c9da51dc7af422a9bb4742d2 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 05:58:28 2010 +0000 add a new MachineJumpTableInfo::getJTISymbol method, use it to implement the default TargetLowering::getPICJumpTableRelocBaseExpr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94523 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ae50d6c969ea5319b4ac36a92f6ae3bb2db9510 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 05:30:30 2010 +0000 stub out a new target hook, need some refactoring before I can implement it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94521 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5edab094dc771c2ea605feefa4168589c1703b50 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 05:15:20 2010 +0000 simplify asmprinter: only emit .set directives when entries have EK_LabelDifference32 kind and the target has .set support. Simplify X86AsmPrinter::printPICJumpTableSetLabel to make use of recent helpers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94518 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9dd8c76971b200d5e6da9b582322fa6b4ee03fc9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 05:10:10 2010 +0000 rename printPICJumpTableEntry -> EmitJumpTableEntry, make it private and non-virtual. It handles the non-pic case too, so just use it, simplifying EmitJumpTableInfo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94517 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5ed376c1534bd482cae00ca58365945a5c595d06 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 05:02:42 2010 +0000 implement X86 @GOTOFF jump table entries with the new EK_Custom32 jump table entry kind, instead of overloading AsmPrinter::printPICJumpTableEntry. This has a pretty horrible and inefficient FIXME around how @GOTOFF is currently smashed into the mcsymbol name, but otherwise this is much cleaner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94516 91177308-0d34-0410-b5e6-96231b3b80d8 commit 92baedd90eca87c18f5734141f68123843bf94af Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 04:55:51 2010 +0000 add a new MachineBasicBlock::getSymbol method, replacing the AsmPrinter::GetMBBSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94515 91177308-0d34-0410-b5e6-96231b3b80d8 commit c240962977fb769c537028a4a033e509b61b2b5f Author: Lang Hames <lhames@gmail.com> Date: Tue Jan 26 04:49:58 2010 +0000 New PBQP solver. * Fixed a reduction bug which occasionally led to infinite-cost (invalid) register allocation solutions despite the existence finite-cost solutions. * Significantly reduced memory usage (>50% reduction). * Simplified a lot of the solver code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94514 91177308-0d34-0410-b5e6-96231b3b80d8 commit 52ec98318a4a336d37048613565c031a0cb1dc5f Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 26 04:40:18 2010 +0000 Fix the the ceiling-division used in computing the MaxBECount so that it doesn't have trouble with an intermediate add overflowing. Also, be more conservative about the case where the induction variable in an SLT loop exit can step past the RHS of the SLT and overflow in a single step. Make getSignedRange more aggressive, to recover for some common cases which the above fixes pessimized. This addresses rdar://7561161. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94512 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87c00880896deb3d3c7e0cc11954fecc5cf7c75e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 04:38:11 2010 +0000 don't bother setting the AsmPrinter::MF ivar, now that AsmPrinter::SetupMachineFunction sets it. Note that systemz and msp430 didn't. Yay for reduced inconsistency! :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94510 91177308-0d34-0410-b5e6-96231b3b80d8 commit b73ec923cd277bd24bff2d81c4b29b4a7661f344 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 04:35:26 2010 +0000 make MachineFunction keep track of its ID and make MachineFunctionAnalysis dole them out, instead of having AsmPrinter do both. Have the AsmPrinter::SetupMachineFunction method set the 'AsmPrinter::MF' variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94509 91177308-0d34-0410-b5e6-96231b3b80d8 commit 451d50e0b00fecc00fcb8657552384f318055ae2 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 04:19:00 2010 +0000 this hook should be const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94508 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd665558f42e47780aff6e3a4555e00d1789e064 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 26 04:13:15 2010 +0000 Add a comment about a missed opportunity. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94507 91177308-0d34-0410-b5e6-96231b3b80d8 commit c1a154b0075a9f31b1850e26ff4f9462484756f7 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 26 04:12:55 2010 +0000 Print empty and full sets specially. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94506 91177308-0d34-0410-b5e6-96231b3b80d8 commit 98639cc055c3420fc68e8cbe308b4c9070c58bd5 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 04:05:28 2010 +0000 Add support for target-specific 32-bit custom-lowered jump table entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94505 91177308-0d34-0410-b5e6-96231b3b80d8 commit dd80b5194431e0ce5b27852dc72c695ad4f7d5a7 Author: Daniel Dunbar <daniel@zuster.org> Date: Tue Jan 26 03:56:22 2010 +0000 Unbreak MSVC/CMake build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94502 91177308-0d34-0410-b5e6-96231b3b80d8 commit ce044b9c7e5dc2c587984ad10fa7b5ed3e31fa82 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 03:47:15 2010 +0000 make jit jump table emission be based on the EntryKind instead of magic variables. JITInfo::getPICJumpTableEntry can probably be removed now, but I don't plan to do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94501 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3ff0256e58dc792e6b1a99ae095326f06764e44c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 26 03:43:22 2010 +0000 switch jump table entry emission to be based on EntryKind instead of magic variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94500 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7829479065b2c9e3593040f3ea9eb731fa505a5 Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 26 02:42:15 2010 +0000 In mem2reg, for all alloca/stores that get promoted where the alloca has an associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94493 91177308-0d34-0410-b5e6-96231b3b80d8 commit 772e788108793a13d4c154974d151e9755b09373 Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 26 02:36:35 2010 +0000 Add MDNode::getIfExists(), an efficient way to determine if a value is used by metadata (since metadata does not appear in a value's use list) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94492 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2bdbbc8c8bd9261fce6c90f6546fca5e743f071b Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 26 02:07:38 2010 +0000 Assert when debug intrinsic insert functions are passed empty arguments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94491 91177308-0d34-0410-b5e6-96231b3b80d8 commit 35442a5bd501a65850e46ab87e77a0bf254227ef Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 26 02:00:44 2010 +0000 Implement cond ? -1 : 0 with sbb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94490 91177308-0d34-0410-b5e6-96231b3b80d8 commit 91945aed6441c5fee15f0b4da9f74ff5fdb161b4 Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 26 01:54:26 2010 +0000 Accept immediate as value of a dbg_value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94489 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2798a565988f04b8e8e9b385ce7a1a9a671dc747 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Tue Jan 26 01:26:46 2010 +0000 Re-enable unit tests disabled in r94164 by telling GTest about the lack of RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94484 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4eac23ed3a3dcf627e2b346bbadb6e6acd05eb12 Author: Sean Callanan <scallanan@apple.com> Date: Tue Jan 26 01:00:10 2010 +0000 Added the implementation of the Intel-specific TargetAsmLexer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94482 91177308-0d34-0410-b5e6-96231b3b80d8 commit bfe2023a6987b4201e612b8b787cbb40b4b29e7d Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 26 00:09:58 2010 +0000 Generate DEBUG_VALUE comments on x86. The (limited) dbg.declare's we currently generate go through both register allocators without perturbing the results. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94480 91177308-0d34-0410-b5e6-96231b3b80d8 commit 38465e0f8e0ce74d6a4721e4d667194e4ee3ee6c Author: Sean Callanan <scallanan@apple.com> Date: Tue Jan 26 00:08:25 2010 +0000 Added the TargetAsmLexer implementation for AT&T syntax. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94479 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21cf5dc841bfce418403b3909f5ab8c9e6087b9a Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 26 00:03:12 2010 +0000 use findDebugLoc in more places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94477 91177308-0d34-0410-b5e6-96231b3b80d8 commit 23703f10f4ee82ce35381cb63a06300ced4e98d7 Author: Jim Grosbach <grosbach@apple.com> Date: Mon Jan 25 23:50:13 2010 +0000 Minor jump table cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94475 91177308-0d34-0410-b5e6-96231b3b80d8 commit f51056a64833520d9a19dd4e66d439622e3a7794 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 23:38:14 2010 +0000 in 32-bit pic mode for targets with a GOT, x86 emits jump table entries with @GOTOFF whih is EK_GPRel32BlockAddress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94474 91177308-0d34-0410-b5e6-96231b3b80d8 commit 02f40bc55023ba2181ecb32aeb8d0c265624d176 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 23:28:03 2010 +0000 fix quoting problem jim noticed! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94472 91177308-0d34-0410-b5e6-96231b3b80d8 commit f64ffc4e7521176024d0c53f2e3a702c6de98133 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 23:26:13 2010 +0000 Rearrange handling of jump tables. Highlights: 1. MachineJumpTableInfo is now created lazily for a function the first time it actually makes a jump table instead of for every function. 2. The encoding of jump table entries is now described by the MachineJumpTableInfo::JTEntryKind enum. This enum is determined by the TLI::getJumpTableEncoding() hook, instead of by lots of code scattered throughout the compiler that "knows" that jump table entries are always 32-bits in pic mode (for example). 3. The size and alignment of jump table entries is now calculated based on their kind, instead of at machinefunction creation time. Future work includes using the EntryKind in more places in the compiler, eliminating other logic that "knows" the layout of jump tables in various situations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94470 91177308-0d34-0410-b5e6-96231b3b80d8 commit cfe7b7a54a60a928e30896b5a21233fa0cbca0a4 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 23:22:00 2010 +0000 prep work to support a future where getJumpTableInfo will return a null pointer for functions with no jump tables. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94469 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5badd6703d1f8fc552f45023ba10dec5e6d9b0a Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 23:18:11 2010 +0000 add a method to get the alignment of an integer type even when we don't have one laying around. Useful if you don't have an llvmcontext handy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94468 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8c6e446caaa411d8f44f2abe82c5d0b39118f79a Author: Johnny Chen <johnny.chen@apple.com> Date: Mon Jan 25 22:54:29 2010 +0000 Make it SP, LR, PC for GPR Register Class instead of LR, SP, PC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94465 91177308-0d34-0410-b5e6-96231b3b80d8 commit 43b18d3c46b16a3d07cb6ae9856439af29626749 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 22:41:33 2010 +0000 eliminate redundant argument to EmitJumpTableInfo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94464 91177308-0d34-0410-b5e6-96231b3b80d8 commit ba0c53b5194a4a00042844d89815229ffcae3ada Author: Johnny Chen <johnny.chen@apple.com> Date: Mon Jan 25 22:13:10 2010 +0000 Implemented ARMInstPrinter::printThumbS4ImmOperand(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94457 91177308-0d34-0410-b5e6-96231b3b80d8 commit dfceef4d7c86e1faff86b76962fd49cbf69748db Author: Sean Callanan <scallanan@apple.com> Date: Mon Jan 25 21:59:20 2010 +0000 Implemented the dialect decision logic for the X86 TargetAsmLexer. Dialect-specific lexing code will be placed in the functions LexTokenATT() and LexTokenIntel(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94456 91177308-0d34-0410-b5e6-96231b3b80d8 commit da756cedbd90c7c5c4cb88ce020567a2980d93d4 Author: Johnny Chen <johnny.chen@apple.com> Date: Mon Jan 25 21:56:35 2010 +0000 Fixed the order of GPR RegisterClass regs to be: ..., R10, R11, R12, ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94455 91177308-0d34-0410-b5e6-96231b3b80d8 commit f995e69497f878e241907c577840be9a4001517d Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 25 21:55:39 2010 +0000 Fix the bitcode reader to deserialize nuw/nsw/etc. bits properly in the case of a forward-reference, which doesn't use an "abbrev" encoding. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94454 91177308-0d34-0410-b5e6-96231b3b80d8 commit dc57be1812ac38d5966a819ad4ed495c074a7795 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 21:28:50 2010 +0000 mcstreamerize gprel32 emission. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94452 91177308-0d34-0410-b5e6-96231b3b80d8 commit e45fe963cf0ac976f60815cecbb5fa7816c32aa1 Author: Bob Wilson <bob.wilson@apple.com> Date: Mon Jan 25 21:28:05 2010 +0000 Remove check for an impossible condition: the condition of the while loop has already checked that TmpBB->getSinglePredecessor() is non-null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94451 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7db595672d1825bc31a0bd3cf9258cbdbe233601 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 21:22:22 2010 +0000 mcize the non-gprel cases of AsmPrinter::printPICJumpTableEntry git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94450 91177308-0d34-0410-b5e6-96231b3b80d8 commit 72d7c91660fc92b769b87c3464c038e1e1ff2ded Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 21:17:10 2010 +0000 handle the _set_ symbol with an MCSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94449 91177308-0d34-0410-b5e6-96231b3b80d8 commit 75bd561e510de2d6376a8573fcbcaabf0e1f8b9f Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 21:10:10 2010 +0000 rename MAI::PICJumpTableDirective to MAI::GPRel32Directive to make it clear what it is, instead of how it is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94448 91177308-0d34-0410-b5e6-96231b3b80d8 commit c50dd923eb17911f40d1a354c08b2d3e45cb5316 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 21:01:58 2010 +0000 pull the non-pic jump table case out of printPICJumpTableEntry and MCize the non-pic case. Now printPICJumpTableEntry really is just about printing PIC entries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94446 91177308-0d34-0410-b5e6-96231b3b80d8 commit cffc498b7b150de1d0d48a56a57550609ab61e4a Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 20:52:54 2010 +0000 remove JumpTableDirective, it is always null. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94445 91177308-0d34-0410-b5e6-96231b3b80d8 commit 98e00c465b19ccdcf0ad3ff2bb1919d190b4945c Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 20:37:36 2010 +0000 no need to implement these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94443 91177308-0d34-0410-b5e6-96231b3b80d8 commit 010d3c27b44c66695ad2c967722fa39c7dc454c4 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 19:51:38 2010 +0000 mcize jump table symbol manipulation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94441 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8a81c36e4a0786baacf13b1744d3aaebc9baed0 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 19:39:52 2010 +0000 sink an arm specific method out of asmprinter into the ARMAsmPrinter and rename it to avoid shadowing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94440 91177308-0d34-0410-b5e6-96231b3b80d8 commit 758f781239b7876a4589e4a8ea8486400cfc02d5 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 19:23:04 2010 +0000 remove dead code: the x86 target never sets usesGlobalOffsetTable, even on x86-32/elf which uses a GOT. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94439 91177308-0d34-0410-b5e6-96231b3b80d8 commit be8c61a305dd714126a1dd308024b765a5e5de15 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 19:02:58 2010 +0000 wirte up .file and .file to the mc asmparser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94438 91177308-0d34-0410-b5e6-96231b3b80d8 commit eaf065b751af99a0cc1fdc304e9118e9b8f7906f Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 18:58:59 2010 +0000 mcstreamerize .file and .file. This also fixes an issue where the normal form of .file would fail if the filename had a weird character in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94437 91177308-0d34-0410-b5e6-96231b3b80d8 commit f20ca12ef34f3e557241346f0db15bfa93ef989e Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 18:33:40 2010 +0000 emit ELF .type directives through MCStreamer instead of doing it textually. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94436 91177308-0d34-0410-b5e6-96231b3b80d8 commit 82ede98c5928c480b7b8d2d79b481c936fba99cd Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 18:30:45 2010 +0000 add symbol attribute support for the ELF .type directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94435 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0b3d624c931bc42d3aadbb505b81b91498ce4b1c Author: Bob Wilson <bob.wilson@apple.com> Date: Mon Jan 25 18:26:54 2010 +0000 Change Value::getUnderlyingObject to have the MaxLookup value specified as a parameter with a default value, instead of just hardcoding it in the implementation. The limit of MaxLookup = 6 was introduced in r69151 to fix a performance problem with O(n^2) behavior in instcombine, but the scalarrepl pass is relying on getUnderlyingObject to go all the way back to an AllocaInst. Making the limit part of the method signature makes it clear that by default the result is limited and should help avoid similar problems in the future. This fixes pr6126. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94433 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0699b0384ab44c2c0344673d6c96fd246e0811f Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 25 17:52:13 2010 +0000 Revert r94260 until findDbgDeclare() is made more efficient git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94432 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0271305987a4170ef3daa793c2a367338c0e32cb Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Mon Jan 25 15:32:10 2010 +0000 Update test for darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94421 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4b84343d60c4140df8b11c6f5f23c8e981e0871 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:53:05 2010 +0000 add a comment git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94417 91177308-0d34-0410-b5e6-96231b3b80d8 commit aaa7b1bae9af996efdaa0f230800f59198b55ca8 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:52:13 2010 +0000 emit the .size directive for global variables on ELF through mcstreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94416 91177308-0d34-0410-b5e6-96231b3b80d8 commit 516b4d673d1cfba74c5c0e0f1db49abe77ca5853 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:43:40 2010 +0000 we removed support for darwin8 tools. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94414 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1f9165d2391eba416439e4467bd333e9daa99d9a Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:29:13 2010 +0000 all supported target now have aligned common support. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94413 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9378674bdedadfe3fefb8aecfebee0b8cbbf25ad Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:26:17 2010 +0000 Remove support for i386 tiger tools for aligned common symbols. Previously we would just silently miscompile code that used aligned common's, now at least you'll get a build error. tiger-ppc already triggered the build error because it didn't have a version of this logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94412 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c3d2bf9419127c61c0d5e0bd43fab2e827cb0c2 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:23:14 2010 +0000 don't set value to its default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94411 91177308-0d34-0410-b5e6-96231b3b80d8 commit 34ed3bc8b335e54535f48b8182bebc0db0c2b477 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 25 07:20:44 2010 +0000 coff targets support alignment on .comm git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94410 91177308-0d34-0410-b5e6-96231b3b80d8 commit d8a8280017dfb9207e6e4f92dfaf485777a6c336 Author: Jim Grosbach <grosbach@apple.com> Date: Mon Jan 25 04:59:07 2010 +0000 ARM does accept the .comm directive alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94408 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6751d70c7fe47be58fdd937e3766ce4344ccff8e Author: Eric Christopher <echristo@apple.com> Date: Mon Jan 25 04:10:28 2010 +0000 Fix autoconf llvm srcdir location for generic projects. Patch by Torvald Riegel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94405 91177308-0d34-0410-b5e6-96231b3b80d8 commit c9a5d80089360065d335b9a46911b7b679d4e193 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Mon Jan 25 02:27:39 2010 +0000 Fix PR6134. We are not emitting alignments on Darwin for "bar". Not sure what is the correct way to do it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94400 91177308-0d34-0410-b5e6-96231b3b80d8 commit 69b0fad03edc822efa7497bfbf5051475d9904f5 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Jan 25 00:54:13 2010 +0000 Attempt to unbreak test on Linux. Chris, please check. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94399 91177308-0d34-0410-b5e6-96231b3b80d8 commit e05be056a19a8ee169ea2676f2c2a8b42050ff33 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Jan 25 00:45:01 2010 +0000 This example requires RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94398 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0f6edb89f62862757145752b50c465e990879cbd Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:54:45 2010 +0000 linux/ppc does use alignment in bytes, not pow-2. This fixes PR6129. It looks like linux/arm and linux/mips have the same setting, which are probably wrong. Someone who cares about ARM and MIPS should investigate with the testcase in PR6129. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94381 91177308-0d34-0410-b5e6-96231b3b80d8 commit 04e65245cdab942a551de170237973c9cb6b903e Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:53:12 2010 +0000 don't reset the default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94380 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1adf597745f664fdea164b2d25695e3aca78ee8c Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:43:08 2010 +0000 make -fno-rtti the default unless a directory builds with REQUIRES_RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8 commit 117674051a2501cce79ca6e0b3ecc00e1382ffb7 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:22:08 2010 +0000 mark some libraries that currently require RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94377 91177308-0d34-0410-b5e6-96231b3b80d8 commit 696f0cfe623a89ef7575ff6c0b3948c34d2f3baf Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:21:50 2010 +0000 libs that need EH need RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94376 91177308-0d34-0410-b5e6-96231b3b80d8 commit b08bea7868ae3094051469e7f360eb945f35d973 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:20:40 2010 +0000 ENABLE_EXPENSIVE_CHECKS shouldn't know how rtti is enabled, let REQUIRES_RTTI handle it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94375 91177308-0d34-0410-b5e6-96231b3b80d8 commit 073777efc9f8dcc11201a24b257d1ad3efc73f0b Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:17:09 2010 +0000 reassociate should do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94374 91177308-0d34-0410-b5e6-96231b3b80d8 commit 34cc79c227e1bbe3c1d78a2ebbdf31e7289e9f2d Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 20:01:41 2010 +0000 add a note. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94373 91177308-0d34-0410-b5e6-96231b3b80d8 commit cdf289c59d527d18a7b3d6b29d7dc0cb2d006860 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 19:23:09 2010 +0000 just remove this test, it is not reduced, is not clear what its testing for and it is dying due to fragility in the asmprinter .s comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94372 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8eba210656b1b46a627a53f27607eb78bee0b46c Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 19:13:39 2010 +0000 this test has been failing or a long time, just disable it for now to get back to green. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94371 91177308-0d34-0410-b5e6-96231b3b80d8 commit b35037aec3f60518a97f86050098e0c3597b8e14 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 19:01:06 2010 +0000 fix some issues where we weren't emitting enough newlines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94370 91177308-0d34-0410-b5e6-96231b3b80d8 commit f6e18804c095c7a9580161cec25457910ff1e470 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 18:54:17 2010 +0000 when emitting DIEs, emit the comment on the same line as the directive. This fixes FrontendObjC/2009-11-30-Objc-ID.m git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94369 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5ef7cf97cd5f40a660e36c637284eb120528dd04 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 02:27:03 2010 +0000 move PR5945 here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94350 91177308-0d34-0410-b5e6-96231b3b80d8 commit b30a9d51185aed4a863737ce8f4aa01770a91426 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 01:07:33 2010 +0000 fix a parsing problem on instructions like: movw $8, (_cost_table_-L97$pb)+66(%eax) After the parens, we could still have a binop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94345 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8075fd5cc680647735c00aa160597d438924b9d9 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 00:25:09 2010 +0000 This corrects an error in the type of the Llvm.dispose_context function. Patch by James Woodyatt! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94343 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8bfb35b04c180f4b1c9ef08026d4d79e6dcbc22e Author: Mon P Wang <wangmp@apple.com> Date: Sun Jan 24 00:24:43 2010 +0000 It seems better to scalarize vectors of size 1 instead of widening them. Add support to widen SETCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94342 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6bb7a3c88d365944ffbd6f7c6602d6634fd7eba3 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 24 00:09:49 2010 +0000 change the canonical form of "cond ? -1 : 0" to be "sext cond" instead of a select. This simplifies some instcombine code, matches the policy for zext (cond ? 1 : 0 -> zext), and allows us to generate better code for a testcase on ppc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94339 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2de8d73b7944fa39803d9531719da96e0921a345 Author: Mon P Wang <wangmp@apple.com> Date: Sun Jan 24 00:05:03 2010 +0000 Improved widening loads by adding support for wider loads if the alignment allows. Fixed a bug where we didn't use a vector load/store for PR5626. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94338 91177308-0d34-0410-b5e6-96231b3b80d8 commit b9256a922c459a26e590d0ffbce1a7fa151421a1 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 23:31:46 2010 +0000 fix a potential overflow issue Eli pointed out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94336 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21dbf2fe88b87852d3b644752152fa4c939d9f67 Author: Nick Lewycky <nicholas@mxc.ca> Date: Sat Jan 23 20:32:12 2010 +0000 Speculatively revert r94322 to see if it fixes darwin selfhost buildbot. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94331 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8070ec0e39fe9fa098e05c8480fefeeafdab9e63 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 19:21:31 2010 +0000 third bug from PR6119: the xor dupe extension allows for arbitrary terminators in predecessors, don't assume it is a conditional or uncond branch. The testcase shows an example where they can happen with switches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94323 91177308-0d34-0410-b5e6-96231b3b80d8 commit ed230ec24e2639545b5f72ce86ceebd809b0f483 Author: Nick Lewycky <nicholas@mxc.ca> Date: Sat Jan 23 19:19:34 2010 +0000 Teach DAE that even though it can't modify the function signature of an externally visible function, it can still find all callers of it and replace the parameters to a dead argument with undef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94322 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2e27c8ab6d591b7c0b95f174bc4bb1788241a6ea Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 19:16:25 2010 +0000 add an early out to ProcessBranchOnXOR to speed it up, handle the case when we can infer an input to the xor from all inputs that agree, instead of going into an infinite loop. Another part of PR6199 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94321 91177308-0d34-0410-b5e6-96231b3b80d8 commit b8d56ca2576b026967c306f6b2d4a7818215958f Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 18:56:07 2010 +0000 fix a crash in jump threading, PR6119 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94319 91177308-0d34-0410-b5e6-96231b3b80d8 commit 79bda77aa67a5fb3ce416b072e5a7757ef2f0757 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 18:49:30 2010 +0000 implement a simple instcombine xform that has been in the readme forever. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94318 91177308-0d34-0410-b5e6-96231b3b80d8 commit c577b8344b6fe79cd250ceaf95303a6405af12e9 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 18:42:37 2010 +0000 add a note git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94317 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2d28a9d1cd2f682c8fb812c2ba04a25c67cc2a76 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 17:59:23 2010 +0000 add some notes, making posix-memalign be nocapture would be an easy improvement. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94312 91177308-0d34-0410-b5e6-96231b3b80d8 commit fcc37a1838a832ec99f3f469c7dbb26751a1db2c Author: Bill Wendling <isanbard@gmail.com> Date: Sat Jan 23 10:26:57 2010 +0000 Remove the '-disable-scheduling' flag and replace it with the 'source' option of the '-pre-RA-sched' flag. It actually makes more sense to do it this way. Also, keep track of the SDNode ordering by default. Eventually, we would like to make this ordering a way to break a "tie" in the scheduler. However, doing that now breaks the "CodeGen/X86/abi-isel.ll" test for 32-bit Linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94308 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21733fda3761f7209a4ec0e54dfeba60009c8af9 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Sat Jan 23 09:54:23 2010 +0000 Respect operator precedence (and silence a gcc 4.3 warning). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94304 91177308-0d34-0410-b5e6-96231b3b80d8 commit bab5d64f0e7f902588a78294cb2196c498f1836a Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 07:47:02 2010 +0000 mcize lcomm, simplify .comm, extend both to support 64-bit sizes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94299 91177308-0d34-0410-b5e6-96231b3b80d8 commit e5282425d454ae746a266d1c41175564545c057f Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 07:21:06 2010 +0000 resolve a fixme: the "nonexecutable stack directive" is actually a .section. Switch to it with SwitchSection. However, I think that this directive should be safe on any ELF target. If so, we should hoist it up out of the X86 and SystemZ targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94298 91177308-0d34-0410-b5e6-96231b3b80d8 commit ce83c429c23fb6f94d987e49e39563fb2ccb9b1e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 07:17:54 2010 +0000 remove a dead call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94297 91177308-0d34-0410-b5e6-96231b3b80d8 commit a60bdbe226bb00daa15b7bc5a7fd9d3f0c1c2bc1 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 07:00:21 2010 +0000 use helpers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94296 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0952125a6ba77ae0bb54f995adc9dbbc0d5544a2 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 06:53:23 2010 +0000 mcize visibility directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94295 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5bec06f70cf3f98437d065cd7ddd80dfaa14d949 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 06:39:22 2010 +0000 move the various directive enums out of the MCStreamer class into a new MCDirectives.h file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94294 91177308-0d34-0410-b5e6-96231b3b80d8 commit 37bfafecbfdfd1d13c67939872f500b1b73c83e0 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 06:17:14 2010 +0000 Change constantexpr global variable initializers to convert the constants to MCExpr then emit them through MCStreamer with EmitValue. I think all global variable initializers are now going through mcstreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94293 91177308-0d34-0410-b5e6-96231b3b80d8 commit da960b1ecc70e2eb5b8fd2553d30f094b2c1ffb7 Author: Eric Christopher <echristo@apple.com> Date: Sat Jan 23 06:02:43 2010 +0000 Don't lower splat vector load to relative to the esp if the stack may be misaligned. Update test accordingly. Patch by Evan Cheng! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94291 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5cfb025a75f48ca48aacb4728e0fa2ab208e0cbb Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 05:51:36 2010 +0000 mcstreamerize .no_dead_strip and .reference for static ctors/dtors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94290 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7aeeb28d19bdaece1ae9de1f16c3280a576f84c3 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 05:45:28 2010 +0000 stop testing for invalid output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94288 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea28a60728a6cf566ca89bb76b8eff841a6f78dd Author: Eric Christopher <echristo@apple.com> Date: Sat Jan 23 05:29:06 2010 +0000 Reapply 94059 while fixing the calling convention setup for strcpy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94287 91177308-0d34-0410-b5e6-96231b3b80d8 commit d07f6755bbae6d71080f76f4067704e5ccd8f973 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 05:28:25 2010 +0000 remove unneeded directive set. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94286 91177308-0d34-0410-b5e6-96231b3b80d8 commit d5071b187e87991fe21c9237bd05a4be888a9ca0 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 05:26:25 2010 +0000 use some helpers instead of duplicating logic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94285 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8977ba554ce5b1683adae55836e0710badcaa6f1 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 05:19:23 2010 +0000 mcize jump table and constant pool entry labels, .local on elf, and some .weak directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94284 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0f700b2c30b62395cf6c35a63c5ae4dca45ddbd4 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 04:54:10 2010 +0000 emit .ascii and .asciz through MCStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94282 91177308-0d34-0410-b5e6-96231b3b80d8 commit a7fa27941f0d710932f12d55fe155abbcae09136 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 04:42:42 2010 +0000 simplify code a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94281 91177308-0d34-0410-b5e6-96231b3b80d8 commit fecdf6a06df7033f4c867bd13acfbeb966cd65d0 Author: Mon P Wang <wangmp@apple.com> Date: Sat Jan 23 04:35:57 2010 +0000 InstCombine should not fold sext/zext of a vector and a bitcast to a scalar to a sext/zext git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94280 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1a7c14bf328f64ff4193dd3cf0295b8f93b8c3c2 Author: Ted Kremenek <kremenek@apple.com> Date: Sat Jan 23 04:01:37 2010 +0000 Update CMake build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94278 91177308-0d34-0410-b5e6-96231b3b80d8 commit d7466a925f7b8617abd8bc8b24bd7a5b3503316e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 03:11:46 2010 +0000 remove one form of EmitString, just use EmitBytes instead. We must be careful to add a \0 at the end though, because EmitString didn't do this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94277 91177308-0d34-0410-b5e6-96231b3b80d8 commit f04952804f541d3122cfb43ec40cc0942325c23d Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 03:11:10 2010 +0000 remove this test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94276 91177308-0d34-0410-b5e6-96231b3b80d8 commit b6ab361317fd3574732ff553d10208aac92d0fd3 Author: Sean Callanan <scallanan@apple.com> Date: Sat Jan 23 02:43:15 2010 +0000 Added the skeleton for the implementation of the X86 target-specific AsmLexer, and added the appropriate registration calls. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94275 91177308-0d34-0410-b5e6-96231b3b80d8 commit 059df4def56ac9f1eb215a3fb849a2f21891360a Author: Evan Cheng <evan.cheng@apple.com> Date: Sat Jan 23 01:21:27 2010 +0000 Fix test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94272 91177308-0d34-0410-b5e6-96231b3b80d8 commit c2ff4823326a56abb0ba669b821a5936b4352e8c Author: Evan Cheng <evan.cheng@apple.com> Date: Sat Jan 23 01:19:28 2010 +0000 Fix tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94271 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7a921beb95ccea2238dbebe2c41d9178e894c3a Author: Sean Callanan <scallanan@apple.com> Date: Sat Jan 23 00:40:33 2010 +0000 Modified the register matcher function in AsmMatcher to be static. Also made it possible for clients to get it and no other functions from ...GenAsmMatcher.inc by defining REGISTERS_ONLY before including GenAsmMatcher.inc. This sets the stage for target-specific lexers that can identify registers and return AsmToken::Register as appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94266 91177308-0d34-0410-b5e6-96231b3b80d8 commit da5a810fe5032fa06d1f50db89b0caf0c4af9be5 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 23 00:26:28 2010 +0000 Avoid using "Type" as the variable name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94262 91177308-0d34-0410-b5e6-96231b3b80d8 commit 17d6b5bc6ba2bedc3843f2650dc32f8f87240e22 Author: Daniel Dunbar <daniel@zuster.org> Date: Sat Jan 23 00:26:16 2010 +0000 AsmMatcher: Add a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94261 91177308-0d34-0410-b5e6-96231b3b80d8 commit d24eb84b7e60f8eee20cdf617eba33ebfa52b900 Author: Victor Hernandez <vhernandez@apple.com> Date: Sat Jan 23 00:17:34 2010 +0000 In mem2reg, for all alloca/stores that get promoted where the alloca has an associated llvm.dbg.declare instrinsic, insert an llvm.dbg.var intrinsic before each store git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94260 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2724561e93d576930911903b1f91abfe1681dc61 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 23 00:15:00 2010 +0000 teach MCAsmStreamer::EmitBytes to use .ascii and .asciz git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94259 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0147ebbe1e565c30ea095212467d0c31c3cbfd9e Author: Victor Hernandez <vhernandez@apple.com> Date: Sat Jan 23 00:03:28 2010 +0000 Make sure ValueFn starts off empty git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94256 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0122611496dacf43dcb8fd246258d0a835bc9988 Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 22 23:49:45 2010 +0000 Enable pre-regalloc scheduling load clustering by default. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94255 91177308-0d34-0410-b5e6-96231b3b80d8 commit c95d6a904c9d796664f720423f50a7a8e553dad9 Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 22 23:49:11 2010 +0000 Be more conservative with clustering f32 / f64 loads. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94254 91177308-0d34-0410-b5e6-96231b3b80d8 commit e1ca0cc113a5e7d4078729904274608de82c861d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 23:47:11 2010 +0000 move "EOL" from asmprinter to dwarfprinter. It should eventually be completely eliminated, but today is not that day. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94253 91177308-0d34-0410-b5e6-96231b3b80d8 commit 29f89d3d786ccb37ed00a96a4b439aa4ca95a4ec Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 23:43:14 2010 +0000 remove uses of EOL. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94252 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6d806e74cc94867843b050698b4daa39d5776321 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 23:40:08 2010 +0000 add a new EmitCFAByte method and use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94251 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa01d51d21d54f2ca00b78e4d2091d53533eaf5e Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 23:18:42 2010 +0000 move uleb printing from asmprinter to dwarfprinter, mcize, cleanup and eliminate a bunch more uses of "EOL". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94250 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7b1235ab731407403eea3a6b513ca1507fd973f1 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Fri Jan 22 23:04:39 2010 +0000 Make OProfile support compile again after r93630 removed DebugLocTuple. Also use an AssertingVH to ensure that MDNodes aren't destroyed while the FilenameCache is using them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94245 91177308-0d34-0410-b5e6-96231b3b80d8 commit f91ddc3b77bfd40e84a928da86fac608cd113eb6 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 22:56:55 2010 +0000 move sleb printing out of asmprinter into dwarf printer, make clients handle the comment better, MCize the non-.sleb case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94244 91177308-0d34-0410-b5e6-96231b3b80d8 commit f57bfb4bcc2519b3e7409d385a4ff119ce21296c Author: Devang Patel <dpatel@apple.com> Date: Fri Jan 22 22:52:10 2010 +0000 Remove MetadataBase class because it is not adding significant value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94243 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ba10c12d0d4e205923380005bcd2a551fe3b707 Author: Sean Callanan <scallanan@apple.com> Date: Fri Jan 22 22:42:22 2010 +0000 Added a Register token to AsmToken and the appropriate accessor method for its value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94241 91177308-0d34-0410-b5e6-96231b3b80d8 commit 275991914793014fb284c1dec811d7684b3b2f1c Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 22 22:38:21 2010 +0000 Ignore DEBUG_VALUE when building live intervals; this makes the code work transparently the same whether they're there or not. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94240 91177308-0d34-0410-b5e6-96231b3b80d8 commit e50e6d22c237b7287afa87cd358578cf1884111a Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 22:38:16 2010 +0000 add a new DwarfPrinter::EmitEncodingByte method which handles pretty printing encoding comments and eliminates redundancy on the client side. We now get pretty dwarf like this again: .byte 255 ## @LPStart Encoding = omit .byte 0 ## @TType Encoding = absptr .byte 0x28 ## @TType base offset .byte 3 ## Call site Encoding = udata4 .byte 0x1a ## Call site table size ... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94239 91177308-0d34-0410-b5e6-96231b3b80d8 commit b70eff364cde6a60a00a0e549df9fd6d308d8355 Author: Sean Callanan <scallanan@apple.com> Date: Fri Jan 22 22:35:01 2010 +0000 Filled out the skeleton of the TargetAsmLexer to behave exactly like an MCAsmLexer. (The difference is that the TargetAsmLexer knows how to handle target-specific stuff like registers, whereas the MCAsmLexer is fully generic.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94237 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4c68039af93eedd5a3a85bcfd6e0c9e04c83faa9 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 22:23:57 2010 +0000 rename the dwarf class to DwarfPrinter. This matches the filename and much more accurately describes what it is all about. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94233 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1d9f592d5ea82a8ccc47e86ca24b11fe7a32c91d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 22:19:51 2010 +0000 fix indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94232 91177308-0d34-0410-b5e6-96231b3b80d8 commit 09bcfe29cc1206b4488ff52151b9aff6734aebd8 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 22:09:00 2010 +0000 inline away the trivial AsmPrinter::EOL() method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94230 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2b03593d029ac231ebcf9d581bcabcc3a4c40094 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:57:56 2010 +0000 inline AsmPrinter::PrintHex into its two trivial callers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94228 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4baf399c89cac6a77f292eec358fcde663ba990 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:50:41 2010 +0000 change this to be a static function instead of a method on asmprinter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94227 91177308-0d34-0410-b5e6-96231b3b80d8 commit b8e3a9c1508eeeb8475fa824bc6188a383e089ba Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:43:28 2010 +0000 make the loop comment printer print out a much better structured output. An example: .align 4, 0x90 LBB1_5: ## %while.cond3 ## Parent Loop BB1_1 Depth=1 ## => This Loop Header: Depth=2 ## Child Loop BB1_8 Depth 3 ## Child Loop BB1_6 Depth 3 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94225 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7a083046e39014715254eec809993afe6557058f Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:16:10 2010 +0000 Changes to fix buffering that I forgot to commit with previous patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94222 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2898d5c0c9f4a403de67ca714336612887d2220e Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:11:06 2010 +0000 For blocks that are not loop headers, just print their loop depth and header BB. For loop headers, print Inner loop along with the other stuff so it doesn't take an extra line. We now get stuff like this: LBB1_4: ## %land.end ## in Loop: Header=BB1_1 Depth=1 notb %al testb $1, %al jne LBB1_8 and: LBB1_6: ## %while.cond7 ## Inner Loop Header: Depth=3 ## Inside Loop BB1_5 Depth 2 ## Inside Loop BB1_1 Depth 1 which still isn't great for loop headers, but is much less verbose. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94221 91177308-0d34-0410-b5e6-96231b3b80d8 commit 992dadad54a34560aeb714f9b6330d50483e8242 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 21:00:45 2010 +0000 reenable the label loop comments and switch them to use the formatted comment emission stuff. I'm going to rewrite this though because the current output doesn't make sense. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94215 91177308-0d34-0410-b5e6-96231b3b80d8 commit b879eef258dd7a9b8480c7b2e1259a58de0278c4 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 20:16:37 2010 +0000 Mark EH_RETURN64 as CodeGenOnly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94205 91177308-0d34-0410-b5e6-96231b3b80d8 commit f9a0c6d6bf9f548fa5c0710eb87fbf81e38982e3 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Fri Jan 22 20:00:21 2010 +0000 Another strncmp -> StringRef.startswith simplification. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94203 91177308-0d34-0410-b5e6-96231b3b80d8 commit b03dee3f599868a20c569540c53956914a71d25b Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 19:52:01 2010 +0000 Convert some more random-comment-printing stuff to use AddComment and GetCommentOS. Add a blank line between globals (even in non-verbose mode) to make the assembly more readable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94202 91177308-0d34-0410-b5e6-96231b3b80d8 commit b671b3566275e21443b7430bef6610948a660c05 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 19:51:08 2010 +0000 make this less constrained, we want blank lines between globals. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94201 91177308-0d34-0410-b5e6-96231b3b80d8 commit 643754db2ef4713fceda458b858e60e562ca815a Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 19:17:48 2010 +0000 add a new MCAsmStreamer::GetCommentOS method to simplify stuff that doesn't want to use twines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94199 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54bb43ce6bdbfc08a4c8651209c256c64c875afb Author: Bob Wilson <bob.wilson@apple.com> Date: Fri Jan 22 19:16:40 2010 +0000 Revert 94059. It is breaking the MultiSource/Benchmarks/Prolangs-C/bison test on ARM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94198 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4daebf7f7de736ff476a1a219a95e524a81fec54 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 19:11:53 2010 +0000 add missing break, PR6114, patch by M Wahab. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94197 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5637abcbf760d7f372d8cdf20a2fe639aa801f87 Author: Victor Hernandez <vhernandez@apple.com> Date: Fri Jan 22 19:06:12 2010 +0000 Fix/strengthen verification of llvm.dbg.declare git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94195 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54c6af0ac878c25b5854545cdb11cc7d1d41176e Author: Victor Hernandez <vhernandez@apple.com> Date: Fri Jan 22 19:05:05 2010 +0000 Keep ignoring pointer-to-pointer bitcasts git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94194 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0d63ba1ff03dbb2e5b2f7e7cc329c80ef8ff920a Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 18:33:00 2010 +0000 use both the Mangler and the CBE's mangler for identifiers, this should fix a problem duncan saw handling symbols with '.' in them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94192 91177308-0d34-0410-b5e6-96231b3b80d8 commit 426fd0e36872e4959e3c40579c219fa4660e45fd Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 18:21:35 2010 +0000 rename addComment -> AddComment for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94190 91177308-0d34-0410-b5e6-96231b3b80d8 commit cfd854a8b0cf3b1506b06476d66d2b882a4e0226 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Fri Jan 22 18:21:23 2010 +0000 Simplify some uses of str(n)cmp with StringRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94189 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8a7c2dd91fab40da7f5730e1bb47e32f1f4bba59 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 18:14:27 2010 +0000 CMake: Don't try to descend into projects/compiler-rt, it doesn't work. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94187 91177308-0d34-0410-b5e6-96231b3b80d8 commit d6f53ec8a5f6329e9eb99fcd9721154e95863012 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 18:14:21 2010 +0000 Make GetSourceVersion more portable, thanks Pawel! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94186 91177308-0d34-0410-b5e6-96231b3b80d8 commit f8b2a7fec64b897bdc32a1ce9aed6de2110a8937 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 18:14:14 2010 +0000 Update CMake LibDeps git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94185 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3ea2167f18c86a5582b9a68051017ed54dfe0c71 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 18:10:54 2010 +0000 make: Make .o files depend on Makefile, at least for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94184 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6be4f1bb09a28c828765c25ae8137c1978bdb27d Author: Edwin Török <edwintorok@gmail.com> Date: Fri Jan 22 15:51:31 2010 +0000 Fix TimeValue::now() on Unix. TimeValue()::now().toEpochTime() is supposed to be the same as time(), but it wasn't, because toEpoch subtracted PosixZeroTime, but now() didn't add PosixZeroTime! Add a unittest to check this works. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94178 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1bd4726718a54b82545b70f82de80a7790aeeeb2 Author: Dan Gohman <gohman@apple.com> Date: Fri Jan 22 10:48:28 2010 +0000 Revert r94066, which was the patch which added a Verifier pass after LoopStrengthReduce, as it's causing too much trouble (even with the old LoopStrengthReduce code). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94172 91177308-0d34-0410-b5e6-96231b3b80d8 commit a72e6a456823a00213f97a896fad80ac43225769 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 07:36:39 2010 +0000 add comment support to the rest of the directives. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94168 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7c50aa145f4d32af5f49598eee5d3a14a11961d8 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 07:34:12 2010 +0000 stop using strtoll, it gives windows heartburn. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94167 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9eb7b072080725f485626551827d77072e6a3e6d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 07:29:22 2010 +0000 Add the ability for MCStreamer to emit comments on the same line as directives. Switch over the asm-verbose comment for double values to use it. We now get: _x: .long 343597384 ## double 1.231200e+02 .long 1079953326 For example, note that the comment is on the same line as the .long. Woo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94166 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7e035d5fccfddc47297de0da99ee914d9a2bd214 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 07:06:15 2010 +0000 pass "-fasm-verbose" into createAsmStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94165 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac91dc93e5e0703418e786d0b53dafcfc588b600 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 06:49:46 2010 +0000 Stop building RTTI information for *most* llvm libraries. Notable missing ones are libsupport, libsystem and libvmcore. libvmcore is currently blocked on bugpoint, which uses EH. Once it stops using EH, we can switch it off. This #if 0's out 3 unit tests, because gtest requires RTTI information. Suggestions welcome on how to fix this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8 commit 224823eaea4e1907b9a12bc9323d3a479aca3b1d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 06:29:25 2010 +0000 give PassNameParser a home. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94162 91177308-0d34-0410-b5e6-96231b3b80d8 commit 22c5b90647c0f6db016708b0c818beb032926b95 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 06:25:37 2010 +0000 add an out-of-line virtual method to CmpInst to give it a home. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94161 91177308-0d34-0410-b5e6-96231b3b80d8 commit 660a65c9b195dabacec7c583743ab48bc7fdd7cf Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 06:03:06 2010 +0000 elimiante the dynamic_cast's from opt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94160 91177308-0d34-0410-b5e6-96231b3b80d8 commit 228d59aef55e700c353f51d4d2e087b9f659a8ae Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 05:54:03 2010 +0000 simplify code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94159 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0bc3c3b1cfae9e7dbc2bb023f0ff2b42f814e061 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 05:52:51 2010 +0000 drop the pass name from the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94158 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5f6a77614269d316aecbd92759ace12f5f1cf8a4 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 05:46:59 2010 +0000 eliminate dynamic_cast from this file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94157 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8745ad5250e7744a3e2ea5962522c8d4dff1828d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 05:37:10 2010 +0000 eliminate a bunch more unneeded dynamic_cast's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94156 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3205d176601749b3b9823acdf7584f2c165aee22 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 05:24:46 2010 +0000 eliminate a bunch of dynamic_cast's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94155 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1efffa891157a377aa759adb556d32818dc1d8a8 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 04:55:08 2010 +0000 eliminate a bunch of dynamic_cast's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94154 91177308-0d34-0410-b5e6-96231b3b80d8 commit c766713d70923e886ae2dde5840c83cb3f6fa74b Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 22 03:36:51 2010 +0000 Teach pre-regalloc scheduler to schedule loads from nearby addresses. It may improve cache locality. This is controlled by -cluster-loads for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94148 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea0e0c0e1cfa23c6ed276798c7e6c98d00497cca Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 22 03:34:51 2010 +0000 Add two target hooks to determine whether two loads are near and should be scheduled together. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94147 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5444b9fe0858807f206081cab447f46d25a36e13 Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 22 03:33:01 2010 +0000 Add DenseMapInfo for signed long long. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94146 91177308-0d34-0410-b5e6-96231b3b80d8 commit c9539e24981a586ee732e16d2710dd7bf4be1a54 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 02:04:33 2010 +0000 CMake: Add MCParser directory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94135 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54a7255c0b8f3703008ce88acf09afec3c801008 Author: Daniel Dunbar <daniel@zuster.org> Date: Fri Jan 22 02:04:28 2010 +0000 lit: Separate test suite from test name with spaces, to make it easier to cut and paste. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94134 91177308-0d34-0410-b5e6-96231b3b80d8 commit fa52e910d9b9ffff0d86f7183cccad9d74330991 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:58:44 2010 +0000 add new file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94132 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0d0e32c35c92fb073da29ec06f5b54ffd6bb30c7 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:58:08 2010 +0000 move some files out of the llvm-mc tool into the MCParser library so other tools can link it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94131 91177308-0d34-0410-b5e6-96231b3b80d8 commit c1cd87d00fbb71385ddd4d2da812723ad9c6b5ed Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:55:10 2010 +0000 forgot to svn add these, doh. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94130 91177308-0d34-0410-b5e6-96231b3b80d8 commit 808bf3bd80522a075959bea601c9e9ae06f72035 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:44:57 2010 +0000 create a new MCParser library and move some stuff into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94129 91177308-0d34-0410-b5e6-96231b3b80d8 commit c28a9238761facfb1a2519da236192fd316f7700 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:17:12 2010 +0000 remove some confused code that used strtoull git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94128 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2cea4f37aca55c4a1d6e24349d96ce488fca895f Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 01:10:40 2010 +0000 allow registering target lexers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94127 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8dbec783f4a5d12c6f883b8379e3c48685d2320f Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 22 00:58:59 2010 +0000 stub out a new TargetAsmLexer interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94125 91177308-0d34-0410-b5e6-96231b3b80d8 commit fa9de114313d06a89d317306683589ba43922d52 Author: Dan Gohman <gohman@apple.com> Date: Fri Jan 22 00:46:49 2010 +0000 Revert LoopStrengthReduce.cpp to pre-r94061 for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94123 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1e4d5f45ee8b2a4602b3ea0fd5b133932eea4ae4 Author: Ted Kremenek <kremenek@apple.com> Date: Fri Jan 22 00:28:27 2010 +0000 Store flags in bitfields instead of masking them into the pointer for the left child. This leads to some nice conceptually cleanups. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94121 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e634910a9e7d494064057658ca2847e629d26a7 Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 22 00:08:13 2010 +0000 Fix PR5694. The CMN instructions set the flags differently from CMP, so they cannot be directly interchanged for comparisons against negated values. Disable the CMN instructions for the time being. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94119 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7205efd48b24a4d02771fd0e1f07c78ee6461163 Author: Ted Kremenek <kremenek@apple.com> Date: Thu Jan 21 23:42:57 2010 +0000 Tidy up assertion syntax. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94117 91177308-0d34-0410-b5e6-96231b3b80d8 commit 53bdfacf7beb2906e3dbecbe7d5f81f4c9f5338b Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 23:09:12 2010 +0000 No need to look through bitcasts for DbgInfoIntrinsic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94114 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf4f0e59d781441ebf28d7bc8b7b0eac8a23cf99 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 23:08:36 2010 +0000 DbgInfoIntrinsic no longer appear in an instruction's use list git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94113 91177308-0d34-0410-b5e6-96231b3b80d8 commit e498e711f16d8456d555e9b15bea0e02ed57f7f4 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 23:07:15 2010 +0000 No need to look through bitcasts for DbgInfoIntrinsic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94112 91177308-0d34-0410-b5e6-96231b3b80d8 commit 45846ac009ca010097d85e2c548d97a6a70036e0 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 23:05:53 2010 +0000 DbgInfoIntrinsics no longer appear in an instruction's use list; so clean up looking for them in use iterations and remove OnlyUsedByDbgInfoIntrinsics() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94111 91177308-0d34-0410-b5e6-96231b3b80d8 commit c95dce9668375cf950162fee2a64eb20ce297f77 Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 23:01:22 2010 +0000 When inserting expressions for post-increment users which contain loop-variant components, adds must be inserted after the increment. Keep track of the increment position for this case, and insert these adds in the correct location. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94110 91177308-0d34-0410-b5e6-96231b3b80d8 commit 06efd96affdf537dff3f5991aad8204ffb2d8d1d Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 22:46:32 2010 +0000 Include IVUsers information in LSR's debug output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94108 91177308-0d34-0410-b5e6-96231b3b80d8 commit f874582d8f5e44e304c58f824c61026f751bb4d1 Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 22:42:49 2010 +0000 Prune the search for candidate formulae if the number of register operands exceeds the number of registers used in the initial solution, as that wouldn't lead to a profitable solution anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94107 91177308-0d34-0410-b5e6-96231b3b80d8 commit 59caf2b6453440d6b553b9a11be808608e41cd61 Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 21 21:44:43 2010 +0000 Trim unneeded includes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94105 91177308-0d34-0410-b5e6-96231b3b80d8 commit 349291bfb714d8b1b75fd9c711995f990664b008 Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 21:31:09 2010 +0000 Add a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94104 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5c21610ada2f50338f60a4c311b61cabaacdda9a Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 21:29:25 2010 +0000 It turns out that this #include is needed because otherwise ValueMapper.cpp ends up calling an out of line __ZNK4llvm12PATypeHolder3getEv, which is a template and llvm-config determines arbitrarily to use the one in libipo. This sucks, but keeping the #include is a reasonable workaround. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94103 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4e69ba2ec15421ddd7a9d18985bf32a087981520 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 21:20:51 2010 +0000 unbreak the build, apparently without this transformutils starts depending on libipa? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94102 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5be1d63a362791581a0c1c02bdfb85664b71f93b Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 21:05:54 2010 +0000 tidy up git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94101 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0d62ac57a4a36d8a3208ee6a7efd02a2a6114b16 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 21:01:47 2010 +0000 tidy up git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94100 91177308-0d34-0410-b5e6-96231b3b80d8 commit 68abe9242583b94f39e6dd55f595ce87f3172f57 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 20:43:39 2010 +0000 remove dead .erase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94098 91177308-0d34-0410-b5e6-96231b3b80d8 commit ce178f1cad0e27378f696f07bec6c2ad9727ba08 Author: Jim Grosbach <grosbach@apple.com> Date: Thu Jan 21 20:10:22 2010 +0000 back this out for now. Growing Function is not good. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94097 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9b80d3e6abe702b0570db64706220d71172a69fb Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 20:01:04 2010 +0000 testcase for r94095 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94096 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ca22403c61266e8f3039493f9e649aa01f3d74c Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 19:58:19 2010 +0000 fix a problem with a missing _, testcase pending. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94095 91177308-0d34-0410-b5e6-96231b3b80d8 commit 399f540a943ada4219992eb5fbed256026ffc706 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 19:33:59 2010 +0000 Don't need to include IntrinsicInst.h any more git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94092 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6b2e3d7c7fa479da9ad73c9cd5a6c891a68ca65e Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 21 19:26:20 2010 +0000 No need to map NULL operands of metadata git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94091 91177308-0d34-0410-b5e6-96231b3b80d8 commit 09e5cd4c6046361c494a73c048b94f1238f49672 Author: Daniel Dunbar <daniel@zuster.org> Date: Thu Jan 21 16:09:59 2010 +0000 Add a simple script for getting a version tag from a svn/git-svn/git repository. Feel free to add support for your favorite VCS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94077 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1b797ca4dfdd5e70f8815092a7abe8c872c786a Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 21 15:40:14 2010 +0000 struct/class mismatch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94075 91177308-0d34-0410-b5e6-96231b3b80d8 commit b6ce7fcc5c5c28af35a89c9c1cfda56649e5a990 Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 10:15:06 2010 +0000 Make the parser include the lower level error message in its own error message, to be more informative. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94072 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6decbcedb01ad0a677cda94b7d2e88c07144a06e Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 10:13:27 2010 +0000 Avoid printing a spurious semicolon when there is no filename. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94071 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5eac35732d05e5fde2933456cc74d6453fba0616 Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 10:08:42 2010 +0000 When re-using an existing cast for a user, it's still necessary to call rememberInstruction so that future users of that user will be inserted in the correct position. This fixes the Darwin selfhost. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94070 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f89af189aaa7413b37cf34bb6712abdfc6d5c47 Author: Nick Lewycky <nicholas@mxc.ca> Date: Thu Jan 21 07:03:21 2010 +0000 Fix a crasher trying to fold each element in a comparison between two vectors if one of the vectors didn't have elements (such as undef). Fixes PR 6096. Fix an issue in the constant folder where fcmp (<2 x %ty>, <2 x %ty>) would have <2 x i1> type if constant folding was successful and i1 type if it wasn't. This exposed a related issue in the bitcode reader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94069 91177308-0d34-0410-b5e6-96231b3b80d8 commit ccedfaf8a570d896c179fcbdf4c76cff9254bab3 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 06:11:03 2010 +0000 remove a couple of asserts that use RTTI. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94068 91177308-0d34-0410-b5e6-96231b3b80d8 commit f351d251e90ab22adfc8323aca899d880c8d87fc Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 03:51:36 2010 +0000 Run the verifier after LSR, to help catch use-before-def errors before they reach codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94066 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2003be1aa5b51b63f438ac33637b161ba97ec1db Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 21 02:09:26 2010 +0000 Re-implement the main strength-reduction portion of LoopStrengthReduction. This new version is much more aggressive about doing "full" reduction in cases where it reduces register pressure, and also more aggressive about rewriting induction variables to count down (or up) to zero when doing so reduces register pressure. It currently uses fairly simplistic algorithms for finding reuse opportunities, but it introduces a new framework allows it to combine multiple strategies at once to form hybrid solutions, instead of doing all full-reduction or all base+index. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94061 91177308-0d34-0410-b5e6-96231b3b80d8 commit a0173bf117d7ff7ea00824e62d0457ad646bc7bb Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 21 02:07:07 2010 +0000 eliminate dynamic_cast from the pass manager. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94060 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4a4e8e8647c04d0dcf2b47f527ac7394187a7602 Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 21 01:04:38 2010 +0000 Add strcpy_chk -> strcpy support for "don't know" object size answers. This will update as object size checking gets better information. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94059 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea70dd4fcb20d2abf70a8c03157add6b03c0f2ac Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 21 00:55:14 2010 +0000 Fix a minor issue in x86 load / store folding table. movups does an unaligned load so it doesn't require 16-byte alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94058 91177308-0d34-0410-b5e6-96231b3b80d8 commit e96029f9f29e697bfccbc8f7bb0fe9426a58df6b Author: Jim Grosbach <grosbach@apple.com> Date: Thu Jan 21 00:43:30 2010 +0000 Make sure that landing pad entries in the EH call site table are in the proper order for SjLj style exception handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94055 91177308-0d34-0410-b5e6-96231b3b80d8 commit df9e5096b6fe734bdcda8e724dd816624e0e6695 Author: Sean Callanan <scallanan@apple.com> Date: Thu Jan 21 00:19:58 2010 +0000 Moved handling of inclusion from the AsmLexer to the AsmParser, breaking AsmLexer's dependence on SourceMgr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94054 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36c6b186829848ef935fc8d6388d77fc6c2bbea8 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 23:30:28 2010 +0000 simplify this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94048 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a9ae98ab368fdd5f7c9c4e2f130d1b2b05f27b6 Author: Sean Callanan <scallanan@apple.com> Date: Wed Jan 20 23:19:55 2010 +0000 Changed the AsmParser to handle error messages itself rather than passing them off to the AsmLexer to handle. This means the AsmLexer no longer requires a SourceMgr to do error handling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94047 91177308-0d34-0410-b5e6-96231b3b80d8 commit b0885e7b9b0f6b89af155696c4412afb25f8a56a Author: Jim Grosbach <grosbach@apple.com> Date: Wed Jan 20 23:03:55 2010 +0000 SjLj EH introduces can introduce an additional edge to a landing pad and pad normalization needs to take this into account. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94046 91177308-0d34-0410-b5e6-96231b3b80d8 commit e155f8fbe86c8354938ba7dd3efce0578b99fc29 Author: Sean Callanan <scallanan@apple.com> Date: Wed Jan 20 22:45:23 2010 +0000 Promoted the reference to the SourceMgr from AsmLexer into AsmParser, in preparation for making AsmLexer independent of the SourceMgr git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94043 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4b79aa91db34d6149052b68e0989f22200bf29b1 Author: Sean Callanan <scallanan@apple.com> Date: Wed Jan 20 22:18:24 2010 +0000 Modified MCAsmLexer to return error information upward rather than printing it locally, reducing its dependence on SourceMgr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94041 91177308-0d34-0410-b5e6-96231b3b80d8 commit 501eb0b812c54273e6621d5c3fe67b4c969316a8 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 21:36:48 2010 +0000 eliminate FnStubInfo, using MachineModuleInfoMachO instead. this makes function stub emission determinstic. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94033 91177308-0d34-0410-b5e6-96231b3b80d8 commit c0312ac5aef609cc96308d1ad389af8728c58ffe Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 20 21:36:02 2010 +0000 make findDebugLoc a class method git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94032 91177308-0d34-0410-b5e6-96231b3b80d8 commit 658deae41f27c8716ab47c2221238a7e091290ae Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 21:19:44 2010 +0000 split function stub printing out to its own function, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94030 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5432f843148c71db548070383c2a150255bc20bb Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 21:16:14 2010 +0000 eliminate the GVStubs and HiddenGVStubs maps, and use MachineModuleInfoMachO instead. This eliminates two sources of nondeterministic output in the ppc backend, but function stubs are still bad. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94029 91177308-0d34-0410-b5e6-96231b3b80d8 commit d11d8c1016cd1bcc66fe24bce6123aa12d3ba67b Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 20:48:59 2010 +0000 don't forget to initialize an instance variable! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94021 91177308-0d34-0410-b5e6-96231b3b80d8 commit 610d6cbe506606fc86525c0c30c68842e3723993 Author: David Greene <greened@obbligato.org> Date: Wed Jan 20 20:13:31 2010 +0000 When XDEBUG is enabled, check for SelectionDAG cycles at some key points. This will help us find future problems like the one described in PR6019. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94019 91177308-0d34-0410-b5e6-96231b3b80d8 commit 576e34ee28c04a3321e3693e1e431bbf9688f256 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 20:09:02 2010 +0000 adopt getAdjustedAnalysisPointer in a few more passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94018 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9917244e222bb4758cb5dd033de03763cad6e077 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 19:53:32 2010 +0000 adopt getAdjustedAnalysisPointer in two more passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94017 91177308-0d34-0410-b5e6-96231b3b80d8 commit 73d5e3f43961009732292aadf5987ffac2dee486 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 19:51:46 2010 +0000 adopt getAdjustedAnalysisPointer in BasicCallGraph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94015 91177308-0d34-0410-b5e6-96231b3b80d8 commit d3ff296dffce1990825ce3503b5532f46f0491d9 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 19:26:14 2010 +0000 add some new methods to adjust this pointers. Not used yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94013 91177308-0d34-0410-b5e6-96231b3b80d8 commit a0252e0a4f296dee7670281ae95d43ca08e28478 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 19:25:45 2010 +0000 add a helper method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94012 91177308-0d34-0410-b5e6-96231b3b80d8 commit e8391018c707eecd15793967a7e076eee6eddd40 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 17:57:50 2010 +0000 don't send null pointers through the constantexpr codepath unneededly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94010 91177308-0d34-0410-b5e6-96231b3b80d8 commit 674ee7197741c9fdea7dc81a29969ff5d72aa5a6 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 17:53:51 2010 +0000 reduce redundant are's. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94008 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7d97c90f9d4c28592c4711451f52c502246ca3ef Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 20 17:51:28 2010 +0000 Move per-function inline threshold calculation to a method. No functional change except the forgotten test for InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94007 91177308-0d34-0410-b5e6-96231b3b80d8 commit cf85333d1f13d5b3d702cf865a7075136f76dcad Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 17:50:30 2010 +0000 use getGlobalDirective(), don't hardcode .globl. PR6093 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94006 91177308-0d34-0410-b5e6-96231b3b80d8 commit ff9bf035c5b0e263e1f4da7785141eef996cd427 Author: David Greene <greened@obbligato.org> Date: Wed Jan 20 15:27:19 2010 +0000 Fix an infinite recursion problem. dbgs() should return errs() in release mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94001 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac4b96795f374059d5989eac501d97a983183a0c Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 07:41:15 2010 +0000 eliminate some uses of AsmPrinter::EmitIntXXX git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93996 91177308-0d34-0410-b5e6-96231b3b80d8 commit c3663a67fde068e214d251c0c399c35b045a0a22 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 07:37:49 2010 +0000 Backout r93990 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93995 91177308-0d34-0410-b5e6-96231b3b80d8 commit b4f4d33117cd1e581608f0a1a24591d4bcb3173b Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 07:33:29 2010 +0000 inline and radically simplify printDataDirective. It will eventually go completely away. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93994 91177308-0d34-0410-b5e6-96231b3b80d8 commit e03a029d04eabab1cc3164c336b34cb3b8004876 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 07:24:05 2010 +0000 emit basic block labels with mcstreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93993 91177308-0d34-0410-b5e6-96231b3b80d8 commit 17b54b8fd322deb00afde2bec9443984ad8c7e35 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 07:19:19 2010 +0000 emit integer and fp zeros as (e.g.) .byte 0 instead of .space 1, for tidiness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93992 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1dee1cd01c05f2585b9561f81597af2f03c3a62 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 07:11:32 2010 +0000 signficant cleanups to EmitGlobalConstant (including streamerization of int initializers), change some methods to be static functions, use raw_ostream::write_hex instead of a smallstring dance with APValue::toStringUnsigned(S, 16). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93991 91177308-0d34-0410-b5e6-96231b3b80d8 commit e4e1863f0d65b0efdbf69c607aedfa138c144a3c Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 06:57:02 2010 +0000 Fix/strengthen verification of llvm.dbg.declare git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93990 91177308-0d34-0410-b5e6-96231b3b80d8 commit d3792faac8c633d0d89915ea142f9e740675b2d4 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 06:56:16 2010 +0000 Switch Elts from vector to SmallVector git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93989 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ca943c75e9469b1c2a0439959c354c7c323a6a3 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 06:53:37 2010 +0000 switch ConstantFP emission to use MCStreamer, significantly simplifying the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93988 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5a6317d5dcbd14e2c7b5001df315bd930d480244 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 06:45:39 2010 +0000 make mcasmstreamer handle expanding 8 byte integer constants to 4-byte constants if .quad isn't supported. Switch a bunch of methods used by the dwarf writer to use OutStreamer.EmitIntValue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93987 91177308-0d34-0410-b5e6-96231b3b80d8 commit 15fbb193b82579b419a06f4d86b8c0f08a086182 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 06:39:07 2010 +0000 give createAsmStreamer an 'isLittleEndian' argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93986 91177308-0d34-0410-b5e6-96231b3b80d8 commit 996551e1439e0a0e34c022826ccd8f87b2b5b9e2 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 20 06:34:14 2010 +0000 revert 93934, removing the MCAsmInfo endianness bit. I can't stomache MCAsmInfo having this, and I found a better solution to this layering issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93985 91177308-0d34-0410-b5e6-96231b3b80d8 commit 84b83d85f7e1b7ef91558699bee248afe19e80a2 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 06:22:33 2010 +0000 Fix if/else brackets; getFunctionForValue() is to be called for non-metadata values git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93984 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6bacf0a37188b473012e23bf916dca97727584df Author: Chandler Carruth <chandlerc@gmail.com> Date: Wed Jan 20 06:01:02 2010 +0000 Fix the conditions to unambiguously show the logic they represent. This is the logic enforced in the test case as well, so hopefully it is correct. Please review Victor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93980 91177308-0d34-0410-b5e6-96231b3b80d8 commit e419cf483658b209342b05b465819759004ef7dc Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 05:49:59 2010 +0000 Map operands of all function-local metadata, not just metadata passed to llvm.dbg.declare intrinsics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93979 91177308-0d34-0410-b5e6-96231b3b80d8 commit b671414043b6a956cc23051ef13ba48b86d8ae5a Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 05:44:11 2010 +0000 Avoid unnecessary Elts array git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93978 91177308-0d34-0410-b5e6-96231b3b80d8 commit 10e291fa4a937d83b23f7f5a293e1ff76e9f1961 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 20 04:45:57 2010 +0000 Refactor common parts of MDNode::getFunction() and assertLocalFunction() into getFunctionForValue() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93977 91177308-0d34-0410-b5e6-96231b3b80d8 commit 475a3f29b6e1497b3a413506c1a5911312ccb0d6 Author: Devang Patel <dpatel@apple.com> Date: Wed Jan 20 02:05:23 2010 +0000 If a instruction belongs to another function (and not current function) as per debug info attached with the instruction then ignore the dangling lexical scope of this instruction. Such scopes are unreachable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93967 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9f878d30358199527a32ee39043cc5cee162dc7b Author: David Greene <greened@obbligato.org> Date: Wed Jan 20 00:59:23 2010 +0000 Add some asserts to check SelectionDAG problems earlier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93960 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf5ecb9ec5f838a6a720894b13584e90c238d2cf Author: Daniel Dunbar <daniel@zuster.org> Date: Wed Jan 20 00:43:07 2010 +0000 For 'install-clang' target, also traverse tools/clang/lib/Runtime. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93958 91177308-0d34-0410-b5e6-96231b3b80d8 commit 075532b7273ecaf827fca3e1683c9c14831af19a Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 20 00:19:24 2010 +0000 Move findDebugLoc somewhere more central. Fix more cases where debug declarations affect debug line info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93953 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7271e860285ff2a5f7b111f4ba55cc5426837a28 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 23:30:49 2010 +0000 Fold (add x, shl(0 - y, n)) -> sub(x, shl(y, n)), to simplify some code that SCEVExpander can produce when running on behalf of LSR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93949 91177308-0d34-0410-b5e6-96231b3b80d8 commit bc4aaeb19b543b2582c14e621da711a90f968956 Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Jan 19 22:56:26 2010 +0000 Wrap some comments to 80 columns. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93940 91177308-0d34-0410-b5e6-96231b3b80d8 commit 39f55232c932dd44ce3807a6d1967c98fae1970e Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 22:53:50 2010 +0000 Make SCEVAddRecExpr's getType return a pointer type when the add has a pointer member. This helps reduce unnecessary bitcasting and uglygeps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93939 91177308-0d34-0410-b5e6-96231b3b80d8 commit a5c5cf3c26fb368e1f28b4f8f6c06ab401058886 Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 19 22:50:05 2010 +0000 Fix a case where debug_value was perturbing the line number info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93937 91177308-0d34-0410-b5e6-96231b3b80d8 commit 147d8bd28abfcc314802fd9123b09236ba95b62b Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 22:45:06 2010 +0000 When doing address-mode sinking, expand the base register first, rather than the scaled register. This makes it more likely that subsequent AddrModeMatcher queries will match the new address the same way as the old, instead of accidentally matching what had been the base register as the new scaled register, and then failing to match the scaled register. This fixes some problems with address-mode sinking multiple muls into a block, which will be a lot more common with some upcoming LoopStrengthReduction changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93935 91177308-0d34-0410-b5e6-96231b3b80d8 commit e1644edcfb4b34a1fafc20e708820c5544cf24f4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 22:42:28 2010 +0000 give MCAsmInfo a 'has little endian' bit. This is unfortunate, but I really want clients of the streamer to be able to say "emit this 64-bit integer" and have it get broken down right by the streamer. I may change this in the future, we'll see how it works out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93934 91177308-0d34-0410-b5e6-96231b3b80d8 commit d86a19eac282c33ef3dd894a7286ef22a32ececb Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 22:27:22 2010 +0000 Add a comment and tidy up some whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93932 91177308-0d34-0410-b5e6-96231b3b80d8 commit da9eea0223433c3c7c1d5995888b04fca0d3151f Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 22:26:02 2010 +0000 Fix a typo and an 80-column violation in comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93931 91177308-0d34-0410-b5e6-96231b3b80d8 commit c56417c271387318cb2d6cd23da4e3483d1109c5 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 22:21:27 2010 +0000 Give ScalarEvolution access to the DominatorTree. It'll need this to make more intellegent AddRec folding decisions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93930 91177308-0d34-0410-b5e6-96231b3b80d8 commit f304d1a34c6af7a35230cbaa3cabea35229810a9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 22:16:33 2010 +0000 simplify the rest of fp constant printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93929 91177308-0d34-0410-b5e6-96231b3b80d8 commit 132bf14002c41c445a57af51652adec7d7ff7e04 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 22:11:05 2010 +0000 simplify the code for printing x86 long double, don't do work for -fverbose-asm unless it's on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93926 91177308-0d34-0410-b5e6-96231b3b80d8 commit 77abfc1e6ce83fc23427e1b0f07a97bf3d9a417a Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Tue Jan 19 22:08:34 2010 +0000 Identify predicate and optional-def operands when printing machine instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93925 91177308-0d34-0410-b5e6-96231b3b80d8 commit ed6d8c436e06abdd9b9993c32e21876ef0ddb648 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 22:03:38 2010 +0000 add a new EmitIntValue method that MCStreamer impls can optionally define and that clients can use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93923 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8149786c50b3532bf702b45ace4b2388a1341d41 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 21:55:32 2010 +0000 Add a new helper function to IVUsers for returning the "canonical" form of an expression. This is the expression without the post-increment adjustment made, which is useful in determining which registers will be used by the expansion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93921 91177308-0d34-0410-b5e6-96231b3b80d8 commit 68867702f7a6049e8b8a8a6b193424a3c0505aaf Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 19 21:51:51 2010 +0000 Add nounwinds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93919 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0b51ee89fee658d8ef29b8060e15767fc67455b6 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 21:51:22 2010 +0000 eliminate AsmPrinter::EmitZeros: just use MCStreamer directly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93918 91177308-0d34-0410-b5e6-96231b3b80d8 commit bda38003386beaad6a24d5b821738a0bd46f64b4 Author: Sean Callanan <scallanan@apple.com> Date: Tue Jan 19 21:44:56 2010 +0000 Promoted the getTok() method to MCAsmParser so that the two token accessor functions are declared consistently. Modified the clients of MCAsmParser to reflect this change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93916 91177308-0d34-0410-b5e6-96231b3b80d8 commit dddb79d966889b268f642461bbb932c9f2c822cf Author: Xerxes Ranby <xerxes@zafena.se> Date: Tue Jan 19 21:26:05 2010 +0000 Stubs for getHostCPUFeatures API. This implements part of PR5389. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93913 91177308-0d34-0410-b5e6-96231b3b80d8 commit e044e95d47bc670e115a814ebe80cafbaa783cff Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Tue Jan 19 21:08:28 2010 +0000 Remove predicates when changing an add into an unpredicable mov. Since the mov is executed unconditionally, make sure that the add didn't have any predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93909 91177308-0d34-0410-b5e6-96231b3b80d8 commit 632fa82c8d0060a9049ee0ec5d6badabbe7ebaaa Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 19 20:59:04 2010 +0000 Update CMake list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93905 91177308-0d34-0410-b5e6-96231b3b80d8 commit 396e20751d87b0194dcc9e4b947a1575338d25f7 Author: David Greene <greened@obbligato.org> Date: Tue Jan 19 20:37:34 2010 +0000 Add some new debugging APIs to print out "raw" SelectionDAGs to make understanding CannotYTetSelect and other errors easier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93901 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7bb069114798422089019fb5ca25b462cfc0d5fd Author: Sean Callanan <scallanan@apple.com> Date: Tue Jan 19 20:27:46 2010 +0000 Propagated the parser-side Lex function's declaration to MCAsmParser, and changed the target-specific AsmParsers to use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93900 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7d4aa347f157579aa9a192e68506850d9780d4c Author: Sean Callanan <scallanan@apple.com> Date: Tue Jan 19 20:22:31 2010 +0000 Added a Lex function to the AsmParser, to allow handling of include directives to occur within the parser itself. This will break the lexer's dependency on a SourceMgr as input. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93899 91177308-0d34-0410-b5e6-96231b3b80d8 commit db5b0d575b7cb1f776fbcf4a766bf146a9f7627f Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Tue Jan 19 19:57:07 2010 +0000 Fix a bug introduced on r92564 where the name "Node" was already in use by Mips. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93897 91177308-0d34-0410-b5e6-96231b3b80d8 commit cafc2da44c01a7d1a766451bd55a0f6d9cebdf35 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 19:46:13 2010 +0000 Generalize mcasmstreamer data emission APIs to take an address space identifier. There is no way to work around it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93896 91177308-0d34-0410-b5e6-96231b3b80d8 commit c19dbe068d8b59c298a4d835f0d7c5ada6bd2954 Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 19 19:45:51 2010 +0000 Do not extend extension results beyond the use of a PHI instruction at the start of a use block. A PHI use is expected to kill its source values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93895 91177308-0d34-0410-b5e6-96231b3b80d8 commit a62bf10496e55c0a70ddc0c6b21502e34d794333 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 19:10:44 2010 +0000 refactor code to be static functions instead of methods on AsmPrinter. This fixes some bugs handling address spaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93891 91177308-0d34-0410-b5e6-96231b3b80d8 commit b07e5f66f20e04da9f41e3ab172c35a5167dd525 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 18:58:52 2010 +0000 mcstreamerize AsmPrinter::EmitZeros, at least when emitting to the default address space. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93890 91177308-0d34-0410-b5e6-96231b3b80d8 commit 689f7609fc35781483edf60e5be16030abc931b3 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 18:52:28 2010 +0000 add an MCAsmStreamer::EmitFill specialization of EmitFill that emits one directive instead of N. Not doing this would be a significant regression on the # bytes generated by .fill. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93889 91177308-0d34-0410-b5e6-96231b3b80d8 commit dea52e11c0b7f330a62b6cd9964abff399e97ded Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 18:45:47 2010 +0000 add a "MCStreamer::EmitFill" method, and move the default implementation (which just iteratively emits bytes) to MCStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93888 91177308-0d34-0410-b5e6-96231b3b80d8 commit 264871c452f0b74abbce18f24f542d0d3d468187 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 18:37:01 2010 +0000 remove MAI::ZeroDirectiveSuffix, which is only used by MASM, which we don't support anymore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93886 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3b139e487e2130ae43ccff63246fad86d23df9c0 Author: Jim Grosbach <grosbach@apple.com> Date: Tue Jan 19 18:31:11 2010 +0000 For aligned load/store instructions, it's only required to know whether a function can support dynamic stack realignment. That's a much easier question to answer at instruction selection stage than whether the function actually will have dynamic alignment prologue. This allows the removal of the stack alignment heuristic pass, and improves code quality for cases where the heuristic would result in dynamic alignment code being generated when it was not strictly necessary. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93885 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21782ed354253d6780e6caa48d6e8bc0f1dbe4f0 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 18:16:19 2010 +0000 optimize ~(~X >>s Y) --> (X >>s Y), patch by Edmund Grimley Evans! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93884 91177308-0d34-0410-b5e6-96231b3b80d8 commit 01dfd518ef5a3c0680a6c91283371ced13ff8525 Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Tue Jan 19 17:00:43 2010 +0000 On pic function calls some arguments were marked dead and the instruction to load those args removed. This fix PR6071 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93880 91177308-0d34-0410-b5e6-96231b3b80d8 commit a1ecb26fd9ca637d5154f07c2a5692652f3b69b6 Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Jan 19 16:42:10 2010 +0000 The change in r90189 adds a link in a directory outside the iPhone platform directory when building the llvmCore_Embedded project. Fix this by putting the iPhone platform directory into DEST_DIR instead of DEST_ROOT. I also noticed what appears to be an unintentional use of DEVELOPER_BIN instead of DEVELOPER_DIR, so I fixed that and changed to use DEVELOPER_DIR in some places that were hardcoded to "Developer". Finally, the other changes here allowed some refactoring and simplification, which I have done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93878 91177308-0d34-0410-b5e6-96231b3b80d8 commit d93965f3a98c09263a9983d28b91c0c5a06a9b05 Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Tue Jan 19 12:53:04 2010 +0000 load f64 +0.0 in a cleaner way. This fix part of PR5445 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93876 91177308-0d34-0410-b5e6-96231b3b80d8 commit 37e6aad4b09529afa22b87248909da7b43d7a8d0 Author: Bruno Cardoso Lopes <bruno.cardoso@gmail.com> Date: Tue Jan 19 12:37:35 2010 +0000 Fix return registers for mips eabi git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93875 91177308-0d34-0410-b5e6-96231b3b80d8 commit dcb6f254d32e9c8dc2a44654d70177334896583d Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:41:24 2010 +0000 mcstreamer'ize the rest of EmitGlobalVariable that is used on darwin. The next big piece to get global variables streamerized is EmitGlobalConstant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93870 91177308-0d34-0410-b5e6-96231b3b80d8 commit eb8331e45b56034b1f29be2e90e7a980525d8e32 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:39:54 2010 +0000 don't let asm-verbose break the check-next lines in these tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93869 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8ee4950d6fd5bf796878193a8c7a6e2b80ae71e4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:25:51 2010 +0000 stop using the .lcomm pseudoop on darwin, instead, directly use the .zerofill directive. Streamerize its generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93868 91177308-0d34-0410-b5e6-96231b3b80d8 commit fc7b1053d54d819adea030bea5445aa685ed2c1c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:22:22 2010 +0000 fix parsing .comm directives on systems which do not represent alignments as a power of 2. This fixes MC/AsmParser/directive_comm.s git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93867 91177308-0d34-0410-b5e6-96231b3b80d8 commit 30301d70964c8da1d1c1686b2c42ae70f51f752b Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:21:23 2010 +0000 only darwin has zerofill git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93866 91177308-0d34-0410-b5e6-96231b3b80d8 commit c412fbf41da6e79306dda0cf5a2f445f841389bd Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 19 06:19:05 2010 +0000 MDNodes are not expected to disappear or replaced by another MDNode, so there is no need to pay the cost of WeakVH and ValueMaps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93865 91177308-0d34-0410-b5e6-96231b3b80d8 commit be5475c17deca20f05263e9d6e33c700a835bc4e Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 19 06:09:04 2010 +0000 Avoid including DebugInfo.h in AsmPrinter.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93864 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c87acb187e34b2bcd4db357de44d321417b1147 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:08:15 2010 +0000 zap the ARM version of PrintGlobalVariable, which I missed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93863 91177308-0d34-0410-b5e6-96231b3b80d8 commit 370ee59d0a37bc4cb159dead5c391fe79e85628c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 06:01:04 2010 +0000 mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93860 91177308-0d34-0410-b5e6-96231b3b80d8 commit a9934f0312e4caa9a7366d70b7f9dcf624101ff7 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 05:51:42 2010 +0000 factor this code better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93859 91177308-0d34-0410-b5e6-96231b3b80d8 commit 42a203b73bbc908258a8c2cee070559c300f3bfe Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 05:38:33 2010 +0000 Now that we have everything nicely factored (e.g. asmprinter is not doing global variable classification anymore) and hookized, sink almost all target targets global variable emission code into AsmPrinter and out of each target. Some notes: 1. PIC16 does completely custom and crazy stuff, so it is not changed. 2. XCore has some custom handling for extra directives. I'll look at it next. 3. This switches linux/ppc to use .globl instead of .global. If .globl is actually wrong, let me know and I'll fix it. 4. This makes linux/ppc get a lot of random cases right which were obviously wrong before, it is probably now a bit healthier. 5. Blackfin will probably start getting .comm and other things that it didn't before. If this is undesirable, it should explicitly opt out of these things by clearing the relevant fields of MCAsmInfo. This leads to a nice diffstat: 14 files changed, 127 insertions(+), 830 deletions(-) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93858 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9408d24e1a589d705bda5a8ced414809ac0a27b6 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 05:25:38 2010 +0000 use %object like other elf targets, gas accepts either. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93857 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7c7b3b869fb6912f28ebbf3e939cf1fa6f6e6da0 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 05:23:59 2010 +0000 simplify the mips target to print .size and .type for c strings just like all other elf targets. Bruno, if this isn't right, please let me know + why :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93856 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6359ed28f836123afe82d7d276a4a173bb638587 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 05:08:13 2010 +0000 hookize the cygwin ".linkonce" directive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93855 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7fe06165d0b7b91b466ef0faced7bd91a03ad44f Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:59:55 2010 +0000 more cleanups. Emit the .local directive even on cygwin/mingw. I'm not sure that this is correct, but it causes no test failures, and just emitting a .comm without protecting its linkage somehow is surely not right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93854 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5a5510cf167f6288af982a43eb172af46e93e48c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:53:18 2010 +0000 some cleanups git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93853 91177308-0d34-0410-b5e6-96231b3b80d8 commit c9b123031148e07082e9ad2393b5657bf3ba2483 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:48:20 2010 +0000 add a bool for whether .lcomm takes an alignment instead of basing this on "isdarwin". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93852 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a21601ea57eb29fe58399ca68e90d7710f08292 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:39:15 2010 +0000 hoist handling of external globals and special globals up to common code. This makes a similar code dead in all the other targets, I'll clean it up in a bit. This also moves handling of lcomm up before acquisition of a section, since lcomm never needs a section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93851 91177308-0d34-0410-b5e6-96231b3b80d8 commit 874fdbc7755aa6634c126e3f8027dabc6617f0f3 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:34:02 2010 +0000 move production of .reference directives for static ctor/dtor list on darwin into common code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93849 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf679f8f253409980d143ffe3f8dac1b541f12aa Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Jan 19 04:32:48 2010 +0000 Fix a crash in scalarrepl for memcpy/memmove where the source and destination are the same. I had already fixed a similar problem where the source and destination were different bitcasts derived from the same alloca, but the previous fix still did not handle the case where both operands are exactly the same value. Radar 7552893. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93848 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7337615ab96c5bce72b08012ebd4dbe95f316811 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:21:20 2010 +0000 use BSSLocal classifier to identify 'lcomm' data instead of duplicating the logic (differently) in lots of different targets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93847 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1ef66c3db822b58d683ec34f1d460838fb3edec Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 04:15:51 2010 +0000 make TLOF subclassify BSS based on linkage type into private, external and everything else (weak). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93846 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1eef2e76c6a89407e6f6aa92986019cd86824ea9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 03:13:44 2010 +0000 now that elf weak bss symbols are handled correctly, simplify a bunch of code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93845 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3a717abc755b03e1b910512fb956784f56df853e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 03:06:01 2010 +0000 fix a significant difference between llvm and gcc on ELF systems: GCC would put weak zero initialized mutable data in the .bss section, we would put it into a crasy '.gnu.linkonce.b.test,"aw",@nobits' section. Fixing this will allow simplifications next up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93844 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7ca96cb1376934774c5f69e6a25affbc8d45261e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 02:48:26 2010 +0000 introduce a section kind for common linkage. Use this to slightly simplify and commonize some of the asmprinter logic for globals. This also avoids printing the MCSection for .zerofill, which broke the llvm-gcc build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93843 91177308-0d34-0410-b5e6-96231b3b80d8 commit 174cddac3e5998c65b10a56e41fef76b51b2bb6a Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 02:46:56 2010 +0000 there is no need to emit a .section above .comm on linux. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93842 91177308-0d34-0410-b5e6-96231b3b80d8 commit b604cae660fe5b0750188a59e27b93d79d0d5d76 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Jan 19 02:44:01 2010 +0000 Even more explanation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93841 91177308-0d34-0410-b5e6-96231b3b80d8 commit dcebc08f0cb3ca07bceeeba153c403600cb6c32c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 02:13:06 2010 +0000 change an accessor to a predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93839 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0b3f8751bf270cc0e292aea4a8bc1343964d8312 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 02:09:44 2010 +0000 Cleanup handling of .zerofill on darwin: 1. TargetLoweringObjectFileMachO should decide if something goes in zerofill instead of having every target do it. 2. TargetLoweringObjectFileMachO should assign said symbols to the right MCSection, the asmprinters should just emit to the right section. 3. Since all zerofill stuff goes through mcstreamer anymore, MAI can have a bool "haszerofill" instead of having the textual directive to emit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93838 91177308-0d34-0410-b5e6-96231b3b80d8 commit ab150043d7947faa967d367679f2738d64708167 Author: Nate Begeman <natebegeman@mac.com> Date: Tue Jan 19 01:32:44 2010 +0000 Remove this fixme, looking at the linker source, all targets pad to 4 bytes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93835 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5d0f0887e332f44c7f7341fbe473b0ed3bb0537b Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 19 01:28:09 2010 +0000 remove extraneous ; git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93833 91177308-0d34-0410-b5e6-96231b3b80d8 commit 13026cf2cbaddc405f8b34ce847cdb2f24f2a7ca Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 19 01:26:02 2010 +0000 Revert accident check-in from r93165. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93832 91177308-0d34-0410-b5e6-96231b3b80d8 commit 288d2eeab618759992858e9a72a8b90cbd3745f8 Author: Eric Christopher <echristo@apple.com> Date: Tue Jan 19 01:20:15 2010 +0000 Fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93831 91177308-0d34-0410-b5e6-96231b3b80d8 commit 410c2a5c12cdaaa9686da1db9a64d0b7aeff924d Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 19 00:44:15 2010 +0000 Fix r93758. Use isel patterns instead of c++ selection code to select rbit and make sure we pick different instructions for ARM vs. Thumb2. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93829 91177308-0d34-0410-b5e6-96231b3b80d8 commit 94a1c602a2b12485a851ad283ec7c14375334320 Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 19 00:35:20 2010 +0000 Test case for r93758. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93824 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9fa890d694455ec4718633a1fa732953b946fca6 Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 19 00:12:05 2010 +0000 Reverting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93819 91177308-0d34-0410-b5e6-96231b3b80d8 commit d03ad18a7004198ff00b6b33b618cf3493851a11 Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 19 00:10:52 2010 +0000 Revert 93811 per request. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93818 91177308-0d34-0410-b5e6-96231b3b80d8 commit f482719e48ad43d7b2cdb395111f5677caaef940 Author: Dale Johannesen <dalej@apple.com> Date: Mon Jan 18 23:34:55 2010 +0000 Enable code to emit dbg.declare as DEBUG_VALUE comments (fast isel, X86). This doesn't seem to break any functionality, but will introduce cases where -g affects the generated code. I'll be fixing that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93811 91177308-0d34-0410-b5e6-96231b3b80d8 commit 041fb126b6b299d7b595d7261528503ecc1ffa31 Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 18 22:55:08 2010 +0000 Add comment that MDNode::getFunction() is not to be used by performance-critical code (currently only used by AsmWriter) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93802 91177308-0d34-0410-b5e6-96231b3b80d8 commit 14f91a3da3c835ef8b57b25c0936e405a19b0217 Author: Eli Friedman <eli.friedman@gmail.com> Date: Mon Jan 18 22:38:31 2010 +0000 Make opt -O3 act more like clang -O3 etc., by making the inlining thresholds match. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93798 91177308-0d34-0410-b5e6-96231b3b80d8 commit 81718ed416e1564ede7a5d65d299aaf25ea59ef8 Author: Eli Friedman <eli.friedman@gmail.com> Date: Mon Jan 18 22:36:59 2010 +0000 Add some potentially interesting transformations to README. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93797 91177308-0d34-0410-b5e6-96231b3b80d8 commit 326cb3536de8fc6c3c3ad19d73d6e4e80e2f6bae Author: Bill Wendling <isanbard@gmail.com> Date: Mon Jan 18 22:36:35 2010 +0000 - Add getLSDAEncoding to the PowerPC backend. - Greatly improve the comments to the getLSDAEncoding method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93796 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5cd1ffa32f2cb6ce51447804807d6e086e607a49 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 22:27:43 2010 +0000 make llvm-config more portable to windows versions of perl, patch by Michael Beck! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93793 91177308-0d34-0410-b5e6-96231b3b80d8 commit dd16da9a692dee7befbfb1699abe85f9cf7ac161 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 22:19:16 2010 +0000 my instcombine transformations to make extension elimination more aggressive changed the canonical form from sext(trunc(x)) to ashr(lshr(x)), make sure to transform a couple more things into that canonical form, and catch a case where we missed turning zext/shl/ashr into a single sext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93787 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8b9c5f1875684043ecb65a5bf711ece3699e7897 Author: Sean Callanan <scallanan@apple.com> Date: Mon Jan 18 22:16:54 2010 +0000 Added a newline at the end of SMLoc.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93784 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9b93f747cf6e8b097776619dbd35b238b9473645 Author: Sean Callanan <scallanan@apple.com> Date: Mon Jan 18 22:11:34 2010 +0000 Changed the comment in the file header for SMLoc to something more accurate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93782 91177308-0d34-0410-b5e6-96231b3b80d8 commit 02aceb027bc0da9bce100366e45df046c0aa826d Author: Eric Christopher <echristo@apple.com> Date: Mon Jan 18 22:11:29 2010 +0000 Have FastISel handle llvm.trap(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93781 91177308-0d34-0410-b5e6-96231b3b80d8 commit 52ab36d3758b279fe12cb3010a70a05100fa2b87 Author: Sean Callanan <scallanan@apple.com> Date: Mon Jan 18 22:07:51 2010 +0000 Split SMLoc out in its own header so that it can be used independently of SourceMgr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93780 91177308-0d34-0410-b5e6-96231b3b80d8 commit 53b47a5d360d1664c9325cff112c44d37e17fc56 Author: Jim Grosbach <grosbach@apple.com> Date: Mon Jan 18 22:01:39 2010 +0000 Minor cleanup for jump table printing. Need a reference, not a pointer, for printing via <<. Otherwise we just print the pointer value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93777 91177308-0d34-0410-b5e6-96231b3b80d8 commit bb7347bbd893104b53eeebbd0c45c85b350ea9f3 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 22:00:46 2010 +0000 filecheckize this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93776 91177308-0d34-0410-b5e6-96231b3b80d8 commit e40f06f8a11c74df8868132c920cb77ceb97996a Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 21:58:32 2010 +0000 filecheckize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93775 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7352e5fcb6e842db329423cb9556710877692fbf Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 21:55:43 2010 +0000 remove a redundant test, filecheckize another. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93774 91177308-0d34-0410-b5e6-96231b3b80d8 commit e4027dfeed6f42ef5e66b236d45a1a2e60bdeb56 Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 18 21:38:44 2010 +0000 Canonicalize -1 - x to ~x. Instcombine does this but apparently there are situations where this pattern will escape the optimizer and / or created by isel. Here is a case that's seen in JavaScriptCore: %t1 = sub i32 0, %a %t2 = add i32 %t1, -1 The dag combiner pattern: ((c1-A)+c2) -> (c1+c2)-A will fold it to -1 - %a. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93773 91177308-0d34-0410-b5e6-96231b3b80d8 commit e07f7e6e5dce1bf367720c0b5bad1c724257e643 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 21:09:05 2010 +0000 update mkpatch, patch by Garrison Venn! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93771 91177308-0d34-0410-b5e6-96231b3b80d8 commit b754fd33c09170de2231747307dcff08d0780a02 Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 18 20:42:09 2010 +0000 Make findDbgDeclare/findDbgGlobalDeclare local static functions; avoid Elts array git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93764 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7b452d36b62d8e683d725a509d1205fd28266587 Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 18 20:36:54 2010 +0000 Simplify MDNode::getFunction() and assertLocalFunction() by avoiding extra Function* variable and smallptrset since function-local metadata cannot be cyclic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93762 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8c2481288f3038e03b91cb9c2bef53781c9b2985 Author: Johnny Chen <johnny.chen@apple.com> Date: Mon Jan 18 20:15:56 2010 +0000 The most significant encoding bit of GPR:$src or GPR:$dst was over-specified in the various MOV (register) instructions (16-bit Thumb), including tBRIND (the indirect branch). Instead of '1', it should be specified as '?', because GPR only specifies the register class, which includes both hi-and-lo registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93759 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5c57dc1513859a02b984b60e63765104a131ff40 Author: Jim Grosbach <grosbach@apple.com> Date: Mon Jan 18 19:58:49 2010 +0000 Patch by David Conrad: "On ARMv6T2 this turns cttz into rbit, clz instead of the 4 instruction sequence it is now." git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93758 91177308-0d34-0410-b5e6-96231b3b80d8 commit f9112229d2d7340819bd23f3d7bdde067b480543 Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 18 19:52:14 2010 +0000 While mapping llvm.dbg.declare intrinsic manually map its operand, if possible, because it points to an alloca instruction through metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93757 91177308-0d34-0410-b5e6-96231b3b80d8 commit dfca7fe1f42122ff72218a20955aaba6e3d50e5e Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 19:50:32 2010 +0000 reject some invalid IR. We already assert and reject this from the .ll parser, but PR6070 wants it in the verifier too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93756 91177308-0d34-0410-b5e6-96231b3b80d8 commit fbc40f52875a6b326f93a2e6814734dd83960cf4 Author: Bill Wendling <isanbard@gmail.com> Date: Mon Jan 18 19:47:53 2010 +0000 Add FIXME comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93755 91177308-0d34-0410-b5e6-96231b3b80d8 commit 85e7c4f09ab94c69ccd95cd5b17005ed0abce032 Author: Bill Wendling <isanbard@gmail.com> Date: Mon Jan 18 19:36:27 2010 +0000 - Add a comment to the callback indicating that it's *extremely* not a good idea, but unfortunately necessary. - Default to using 4-bytes for the LSDA pointer encoding to agree with the encoded value in the CIE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93753 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f7713f9134c3a3834e6498bbf790d5e764a332c Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 18 19:15:57 2010 +0000 Make printing of metadata more robust when function is not found (which is the normal situation for non function-local metadata) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93748 91177308-0d34-0410-b5e6-96231b3b80d8 commit 27574da04679e7cb0b4b03a83335da52b4e20a31 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Jan 18 17:52:28 2010 +0000 Don't try to build compiler-rt if it happens to be checked out into projects/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93729 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ab3a8fcae6df8adad5e2682fc270969419a6297 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 18 14:39:20 2010 +0000 Unnamed symbol index should be >= 1. This was lost during the mangler refactoring. Fixes PR6067. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93724 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8f6642009ebcd484a34d92293dbf6db29e679f78 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 18 12:40:05 2010 +0000 Fix refacto reported by Nicolas Geoffray. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93723 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87fa2352aeb07f8e0b269871a80d52355fca4307 Author: Bob Wilson <bob.wilson@apple.com> Date: Mon Jan 18 01:24:43 2010 +0000 Emit spaces after commas in Neon register lists. This is more consistent with the rest of the assembly output, is easier to read, and matches the expected output for gcc's Neon tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93703 91177308-0d34-0410-b5e6-96231b3b80d8 commit aba316e220817acfe6fa8c8a044eb24eb50c28b1 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 01:21:08 2010 +0000 switch x86 zerofill emission over to use MCStreamer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93702 91177308-0d34-0410-b5e6-96231b3b80d8 commit 202c058004e33a3b67fdb29b5cc9ec943a13e5c0 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 00:59:24 2010 +0000 Change CurrentFnSym to be a non-const pointer since asmprinter mutates it as it emits code. Switch .globl directives to use OutStreamer instead of doing it textually (in x86) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93700 91177308-0d34-0410-b5e6-96231b3b80d8 commit f875d80e50d72653003c0ddcaeab1d22fb8c3f8e Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 00:37:40 2010 +0000 remove the MAI argument to MCExpr::print and switch overthing to use << when printing them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93699 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6fef0d73ffadeadf64f07c1eec37def910672263 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 18 00:21:06 2010 +0000 unbreak x86 jump tables with my previous patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93698 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9e6929cecb2b335ecfa2a8a03b1999f8b42ba399 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 21:43:43 2010 +0000 now that MCSymbol::print doesn't use it's MAI argument, we can remove it and change all the code that prints MCSymbols to use << instead, which is much simpler and cleaner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93695 91177308-0d34-0410-b5e6-96231b3b80d8 commit d5b47594306373fc8575f085c249b78ce1612fcc Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 20:11:03 2010 +0000 rename NameNeedsEscaping -> NameNeedsQuoting, eliminate the check for first character which is a digit, mangler would have taken care of this already. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93694 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3ef5bbe350ce2d891504f48f890e479b44ef200b Author: Owen Anderson <resistor@mac.com> Date: Sun Jan 17 19:33:27 2010 +0000 Convert some of the dynamic opcode lookups into static ones. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93693 91177308-0d34-0410-b5e6-96231b3b80d8 commit 41ecf0789b084646955350b929159850d8c523c0 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 19:32:29 2010 +0000 stop the CBE from using Mangler::appendMangledName, which is a private function, it is mangling types, which don't matter how they are done. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93692 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6d9f5425542ddc1bff3f938072aee616ad5df600 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 19:24:35 2010 +0000 fix uninit member, thanks to Benjamin Kramer for identifying the bug. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93691 91177308-0d34-0410-b5e6-96231b3b80d8 commit e3f46600b6888bbd00b2c8474d3ab655dcd4fa3d Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 19:23:46 2010 +0000 Get MCSymbol out of the mangling business, and move all the logic to Mangler. Now MCSymbol just decides whether to slap quotes around a symbol when printing it. This also fixes some weirdness where two MCSymbols could be created for the same symbol, if one needed to be mangled and got mangled to the other one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93690 91177308-0d34-0410-b5e6-96231b3b80d8 commit 142aab7ce398a5c22a49b20e98480afb296a0920 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Sun Jan 17 19:20:45 2010 +0000 Really fix this. I checked that on ARM I get PASS: LLVM::FrontendC/pr5406.c (3463 of 5030) and on X86 I get XFAIL: LLVM::FrontendC/pr5406.c (3465 of 5030 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93689 91177308-0d34-0410-b5e6-96231b3b80d8 commit 12c01c63b773d0c42c9c1c437ff0bc7febe64bc4 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 19:09:12 2010 +0000 reduce this test and convert to filecheck, hopefully the linux buildbot will tell me something more useful. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93688 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf219686faea97a3f9ea0b7dbc7553f510e697cf Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 18:52:16 2010 +0000 factor this code better how that the string version of getNameWithPrefix takes a twine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93687 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0bde2eb86ff04d5825d1fa8b09e16f40f34b7af3 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 17 18:22:35 2010 +0000 now that mangler is in libtarget, it can use MCAsmInfo instead of clients having to pass various fields from it in. Simplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93686 91177308-0d34-0410-b5e6-96231b3b80d8 commit a8d62f79e5837e02170076058dcc9e449bf9ecf0 Author: Dan Gohman <gohman@apple.com> Date: Sun Jan 17 17:47:24 2010 +0000 Don't create a (empty) output file, and don't warn about bitcode output to a console, when --analyze is used. Similarly, avoid creating an empty output file when --disable-output is used. Print a warning when the -o option appears with either --analyze or --disable-output, to indicate that the option is being ignored. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93685 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac84db634a2bafc0c428590b48a64d1b0f7dad7e Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Sun Jan 17 07:46:39 2010 +0000 Switch some functions to take Twines, eliminate uses of StringExtras.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93680 91177308-0d34-0410-b5e6-96231b3b80d8 commit 51f9d45e973650ed6a167b86eda894a38f4d0690 Author: Owen Anderson <resistor@mac.com> Date: Sun Jan 17 06:49:03 2010 +0000 Fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93679 91177308-0d34-0410-b5e6-96231b3b80d8 commit 898b3166e1145f6fe74105640198dce98e4e7aa6 Author: Bob Wilson <bob.wilson@apple.com> Date: Sun Jan 17 06:35:17 2010 +0000 The Neon "vtst" instruction takes a suffix that is the element size alone -- adding an "i" to the suffix, indicating that the elements are integers, is accepted but not part of the standard syntax. This helps us pass a few more of the Neon tests from gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93677 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8babff07481f87f567cecd364bc4577de76e4890 Author: Bob Wilson <bob.wilson@apple.com> Date: Sun Jan 17 05:58:23 2010 +0000 Fix an off-by-one error that caused the chain operand to be dropped from Neon vector load-lane and store-lane instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93673 91177308-0d34-0410-b5e6-96231b3b80d8 commit 918de29db68a1d8d21ea0a34aa1c93ff83b78a19 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Sun Jan 17 05:40:41 2010 +0000 Looks like XFAIL has to list every unsupported arch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93672 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4945cd19c8aabfe0a634f2e78c01144bdcacabe8 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Sun Jan 17 04:44:55 2010 +0000 Add test for pr5406 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93671 91177308-0d34-0410-b5e6-96231b3b80d8 commit b7956b93ffdb4b8d827ec25ad0b1d9e18a4e8e1d Author: Nate Begeman <natebegeman@mac.com> Date: Sun Jan 17 03:49:01 2010 +0000 Add a note for the macho streamer and remove a used of the mangler from the soon to be defunct machowriter pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93670 91177308-0d34-0410-b5e6-96231b3b80d8 commit ca4aeb4525609adb322854c713e84848b756d489 Author: Bill Wendling <isanbard@gmail.com> Date: Sun Jan 17 00:21:21 2010 +0000 Reduce fsub-fadd.ll and merge it into fsub-fsub.ll. Rename fsub-fsub.ll to fsub.ll and FileCheckify it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93669 91177308-0d34-0410-b5e6-96231b3b80d8 commit a59a888da6ed949c0c7a6d871ad1d9cf50ebcc79 Author: Kenneth Uildriks <kennethuil@gmail.com> Date: Sat Jan 16 23:37:33 2010 +0000 When checking for sret-demotion, it needs to use legal types. When using the return value of an sret-demoted call, it needs to use possibly illegal types that match the declared Type of the callee. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93667 91177308-0d34-0410-b5e6-96231b3b80d8 commit b003b846f9d4c265f61d046f491e3d16702a9c32 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Sat Jan 16 22:23:09 2010 +0000 Update CMake files for Mangler move. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93665 91177308-0d34-0410-b5e6-96231b3b80d8 commit a60a217b035888c38661434340b3f5fd4c66767c Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:57:06 2010 +0000 move the mangler into libtarget from vmcore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93664 91177308-0d34-0410-b5e6-96231b3b80d8 commit b8847fb8c52aaa40198c601873266891b0e3f8bb Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:55:24 2010 +0000 fix a warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93663 91177308-0d34-0410-b5e6-96231b3b80d8 commit 33959a9e7f61d7249be8fb360bdf0da288cf264b Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:35:09 2010 +0000 this doesn't need to suck in Mangler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93662 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3a0efac16a896559cb18570b0a7b2eae0b6d907d Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:34:51 2010 +0000 remove obsolete comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93661 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7748a284c5abb09dc68621444926a455eef1a83 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:34:01 2010 +0000 bugpoint doesn't need the mangler at all. DisambiguateGlobalSymbols dates to a time when two different LLVM values could have the same name but different types. Simplify it to just assign names to unnamed things and let the core symtab resolve duplicates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93660 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8439bce99a19536d04df9260e331a52f15f32491 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:25:13 2010 +0000 add a thing to investigate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93659 91177308-0d34-0410-b5e6-96231b3b80d8 commit 55e28ccff810d226c0c6091f4ae016f6366c4f8e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:20:34 2010 +0000 remove calls to dead methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93657 91177308-0d34-0410-b5e6-96231b3b80d8 commit 96a9c1abb4d233ee069596d6760d26b10b6005c9 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 21:08:46 2010 +0000 reapply the mangler gutting patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93656 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5bf5bf2e7d107419a6fad2a12f40e17c1edee0f3 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 20:56:05 2010 +0000 remove use of getMangledName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93655 91177308-0d34-0410-b5e6-96231b3b80d8 commit c92c100404e8038a18c2c826b218dc429c54da83 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 20:53:11 2010 +0000 unbreak the build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93654 91177308-0d34-0410-b5e6-96231b3b80d8 commit aacc26910ff6cf037d2348cf87e398c74f2c9996 Author: Rafael Espindola <rafael.espindola@gmail.com> Date: Sat Jan 16 20:27:59 2010 +0000 Revert 93648. Mangler::getMangledName is used from lto Mangler::setUseQuotes is used in the AsmPrinter Mangler::setSymbolsCanStartWithDigit is used in the AsmPrinter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93652 91177308-0d34-0410-b5e6-96231b3b80d8 commit 348719fcca5acf13888ff1ebc6f39616d53709d4 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 19:08:51 2010 +0000 Mangler::getMangledName is now dead, remove it and all the other stuff in Mangler that is now transitively dead. woo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93648 91177308-0d34-0410-b5e6-96231b3b80d8 commit b8ae1059885f503e204afa822e572924c5b6ca76 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 18:50:28 2010 +0000 Change DIEObjectLabel to take an MCSymbol instead of std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93647 91177308-0d34-0410-b5e6-96231b3b80d8 commit d7fb57b07101bd18ed21e66a697f2318cc9276f4 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 18:37:32 2010 +0000 rename GetPrivateGlobalValueSymbolStub -> GetSymbolWithGlobalValueBase, and add an explicit ForcePrivate argument. Switch FunctionEHFrameInfo to be MCSymbol based instead of string based. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93646 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6bf71129a8dcba34ee552a62c32afc60b777cf4c Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 18:17:26 2010 +0000 eliminate uses of getMangledName from AsmPrinter.cpp, last up is dwarf emission which is going to be more invasive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93645 91177308-0d34-0410-b5e6-96231b3b80d8 commit deb6480e8c0f9957776cd85776697d698b77294b Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 18:12:14 2010 +0000 switch liblto to use the new getNameWithPrefix() method instead of getMangledName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93643 91177308-0d34-0410-b5e6-96231b3b80d8 commit da1fd911d9c7f93fafbcdf0aea3a0ca224dc8338 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 18:06:34 2010 +0000 add an inefficient version of getNameWithPrefix that returns an std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93641 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1680ba80e18f456f4383480e243be9c711b6eae Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Sat Jan 16 16:14:55 2010 +0000 Revive dead assert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93638 91177308-0d34-0410-b5e6-96231b3b80d8 commit 271432c7b8cbaf1468f5baa4bda5c49efdec58db Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Sat Jan 16 14:06:58 2010 +0000 Provide magic define on mingw to not generate inline variants of ctyper functions. Otherwise we'll end with random cyclic deps between libraries due to this. Proposed by Gianluigi Tiesi! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93635 91177308-0d34-0410-b5e6-96231b3b80d8 commit 827d0a70e1e7981294e37e7cf0478c61bd12916c Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Sat Jan 16 13:38:07 2010 +0000 Fix PR6047 Nodes that had children outside of the post dominator tree (infinite loops) where removed from the post dominator tree. This seems to be wrong. Leave them in the tree. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93633 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7b20c1082305927ea567088e0b401021e0fa4133 Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Sat Jan 16 10:56:41 2010 +0000 Create Generic DOTGraphTraits Printer/Viewer Move the DOTGraphTraits dotty printer/viewer templates, that were developed for the dominance tree into their own header file. This will allow reuse in future passes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93632 91177308-0d34-0410-b5e6-96231b3b80d8 commit cdd64b676c2c2344e2af4ce8f98aeff067a64b59 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 16 06:17:40 2010 +0000 No need to use WeakVH here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93631 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3b6871fa24c288179594ea68723a5177d71005ea Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 16 06:09:35 2010 +0000 Replace DebugLocTuple with DILocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93630 91177308-0d34-0410-b5e6-96231b3b80d8 commit 203807de50ff570e432a3c7ceb7a3927020b6dc3 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 03:38:27 2010 +0000 fix build failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93628 91177308-0d34-0410-b5e6-96231b3b80d8 commit ae29e280b4cd3d6a58753fc1aee48d2050200c31 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 02:16:09 2010 +0000 remove a couple of actively incorrect uses of getMangledName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93627 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2fb92f38e45ee2f3a094bea7fea390c074601113 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 02:15:38 2010 +0000 this doesn't need the mangler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93626 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4e11fda49973e3a35989637c14c541d0bd9ccccf Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 02:09:06 2010 +0000 more string -> sym, getMangledName is now gone from this file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93624 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e090cd388e0a7bf61d4edd8005a16da7b9968bd Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 02:00:23 2010 +0000 use symbols instead of strings, eliminating a bunch of getMangledName calls. Add FIXMEs about a bunch of nondeterminism in stub output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93621 91177308-0d34-0410-b5e6-96231b3b80d8 commit b1f1746269d0dd70323ea937cdb8f4b9ba1d7c73 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:45:47 2010 +0000 simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93619 91177308-0d34-0410-b5e6-96231b3b80d8 commit c0dfaadaf26e4e12ed13518e00ce5b9cb8833a2e Author: Bill Wendling <isanbard@gmail.com> Date: Sat Jan 16 01:40:55 2010 +0000 Retrying r91337: The CIE says that the LSDA point in the FDE section is an "sdata4". That's fine, but we need it to actually be 4-bytes in the FDE for some platforms. Allow individual platforms to decide for themselves. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93616 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7436757d1b33ca7d98cf6033c9a1fe2a69ec9d6a Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:40:07 2010 +0000 eliminate uses of mangler and simplify code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93615 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0749eb83aa0bc6dd1dcf8254ec9092ecc1d02a45 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:37:14 2010 +0000 fix inverted conditional git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93614 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7638c073a6855e6f2dfb741d38400722343a1e0b Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:24:10 2010 +0000 CurrentFnName is now dead, remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93612 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2522de6c3522d9fcb675a6e475627d77fb571370 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:21:04 2010 +0000 get pic16 off CurrentFnName git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93610 91177308-0d34-0410-b5e6-96231b3b80d8 commit 446261c29a0546ca6cdc24888c57be4b89dc7dc4 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:17:26 2010 +0000 remove the string form of printVisibility. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93609 91177308-0d34-0410-b5e6-96231b3b80d8 commit 59f9b8d65347a5879da41ea085ee5e25d0148926 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:12:01 2010 +0000 switch more stuff onto MCSymbols git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93608 91177308-0d34-0410-b5e6-96231b3b80d8 commit 89ea3fae1f8c21940ddc558ee3ce452bdbc27800 Author: Bill Wendling <isanbard@gmail.com> Date: Sat Jan 16 01:06:58 2010 +0000 Temporarily revert r93581. It was causing failures in the ExecutionEngine tests on the build bots. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93606 91177308-0d34-0410-b5e6-96231b3b80d8 commit 531f41f143edacea65cb9e180ac4eb7ffd229aaf Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 01:00:27 2010 +0000 eliminate uses of deprecated mangler apis git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93605 91177308-0d34-0410-b5e6-96231b3b80d8 commit d3ae4b3e28a02444d7427dd9ed48bf5ef1a13ce2 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 00:53:22 2010 +0000 this teestcase takes a long time to crash, remove it. If someone cares about this, they should file a bug, it's not doing any good as an xfail. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93604 91177308-0d34-0410-b5e6-96231b3b80d8 commit 953d13e493e91783ddb2a67d612304b5f2913f0e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 00:51:39 2010 +0000 switch X86 target off CurFunctionName and MCIze more. Note that the code wasn't calling DecorateCygMingName when emitting the ".ascii -export" stuff at the end of file for DLLExported functions. I don't know if it should or not, but I'm preserving behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93603 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5d1a921e3dce79d2fa285a0e6c47bececcae1047 Author: Bob Wilson <bob.wilson@apple.com> Date: Sat Jan 16 00:42:25 2010 +0000 Treat indirect branches specially only during pre-regalloc tail duplication, not during the later post-alloc tail duplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93600 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0f12db74fae87be9a712ad05de76f82ea2d227f1 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 00:32:38 2010 +0000 MCize tis, and make it keep CurrentFnSym up to date with CurrentFnName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93598 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7ba5f6184e332f0c879b766a13189f65ea6fa95 Author: Bob Wilson <bob.wilson@apple.com> Date: Sat Jan 16 00:29:50 2010 +0000 Run the pre-register allocation tail duplication pass by default. Remove the -pre-regalloc-taildup command-line option, and add a new -disable-early-taildup option. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93597 91177308-0d34-0410-b5e6-96231b3b80d8 commit a00eeba57fc2405aebcb5f60edc85d0a9db5078c Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 00:24:20 2010 +0000 revert the x86 part of my last patch, cygwin is mutating CurrentFnName! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93595 91177308-0d34-0410-b5e6-96231b3b80d8 commit fe6bade0cfbaed4767874df3563cfafa203e24bc Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 16 00:21:18 2010 +0000 MCize a bunch more stuff, eliminating a lot of uses of the mangler and CurrentFnName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93594 91177308-0d34-0410-b5e6-96231b3b80d8 commit d861a34eda1609250704c75bb0e609eae608d0e0 Author: Daniel Dunbar <daniel@zuster.org> Date: Sat Jan 16 00:00:20 2010 +0000 Fix llvm_supports_binding for lit, problem noticed by Bob! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93591 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1f6e93c08eb967c4737e83b616a821556396deec Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:56:03 2010 +0000 remove two write-only sets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93590 91177308-0d34-0410-b5e6-96231b3b80d8 commit f6ff5b0eae10c12935517046ac22a19199faf8c1 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:55:16 2010 +0000 supplement CurrentFnName with CurrentFnSym, which will eventually replace it. Upgrade Alpha, Blackfin, and part of CellSPU to not use mangler anymore. CellSPU needs more invasive surgery. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93589 91177308-0d34-0410-b5e6-96231b3b80d8 commit ef4314798ee96814fdba9ebd4b21a148926b9738 Author: Erick Tryzelaar <idadesub@users.sourceforge.net> Date: Fri Jan 15 23:49:16 2010 +0000 Fix bug 5992: O'Caml's llvm_create_module was treating the context as a string. Thanks Andy Ray for catching this! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93588 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a07ff98622eb583b245a917d77210c7f8781619 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:38:51 2010 +0000 add a version of AsmPrinter::printVisibility that takes an MCSymbol. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93587 91177308-0d34-0410-b5e6-96231b3b80d8 commit d373d64307ac024599597ef23045df735ae65d59 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:31:55 2010 +0000 use MCSymbol instead of getMangledName() in all cases except one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93582 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9eee1f8280772968a4dc5e8404ef86ffddb15a97 Author: Ted Kremenek <kremenek@apple.com> Date: Fri Jan 15 23:29:34 2010 +0000 BumpPtrAllocator: Have the DefaultSlabAllocator created at runtime, not initialization time. This removes one of the 'init_constructors' reported in <rdar://problem/7545356>. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93581 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8e995e6e8a88e5242a31a8af2438b2a36388ec87 Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 23:29:29 2010 +0000 Adjust some comments per review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93580 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1bfba6b89965c5603cc45276f26e58fd1653fd1f Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 23:28:49 2010 +0000 Remove unneeded argument per review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93579 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f28673e879a011f5215d6a28b40d6367b4ac9e2 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:26:49 2010 +0000 mc'ize a bunch of symbol stuff, eliminating std::strings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93578 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9a14ba5c574a8b04b53c7b1a7986c5d10cbca3a7 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:25:11 2010 +0000 add another helper git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93577 91177308-0d34-0410-b5e6-96231b3b80d8 commit d16ad064033e18d0d47c241f3f01b3795209016a Author: David Greene <greened@obbligato.org> Date: Fri Jan 15 23:23:41 2010 +0000 Fix PR6019. A load has more than one use if it feeds a bitconvert that has more than one use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93576 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8eb8c2f4e596a1ab722718266a5b6f0717b70c3 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 23:18:17 2010 +0000 add a AsmPrinter::GetGlobalValueSymbol and GetExternalSymbolSymbol helper method, use it to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93575 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f6532ddb9565c661380bd1527325ad33e6079c7 Author: Ted Kremenek <kremenek@apple.com> Date: Fri Jan 15 22:59:46 2010 +0000 Update CMake build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93571 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8fe97053fc985508b8d629993aa9191807a13841 Author: Ted Kremenek <kremenek@apple.com> Date: Fri Jan 15 22:59:11 2010 +0000 Update CMake build. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93570 91177308-0d34-0410-b5e6-96231b3b80d8 commit d90b88b011686d6c1b131d0c0ceef3df4642be04 Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 22:27:37 2010 +0000 add testcase for r93564 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93567 91177308-0d34-0410-b5e6-96231b3b80d8 commit c447e6125b58ac553dd9a2d6f6c598026d2af437 Author: Dan Gohman <gohman@apple.com> Date: Fri Jan 15 22:22:58 2010 +0000 Add comments to the dump() and dumpr() routines. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93566 91177308-0d34-0410-b5e6-96231b3b80d8 commit bfdeaf45c4d93fc17429c215e5505208473dc8bc Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 22:22:35 2010 +0000 DEBUG_VALUE is now variable sized, as it has a target-dependent memory address representation in it. Restore X86 printing of DEBUG_VALUE; lowering is done in X86RegisterInfo using the normal algorithm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93565 91177308-0d34-0410-b5e6-96231b3b80d8 commit 453ab0706b3198193d3acfef13c34c66ce74d255 Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 22:21:03 2010 +0000 Update Thumb1 storeRegToStackSlot() and loadRegFromStackSlot() to properly handle physical registers R0-R7 when described as having a non-tGPR register class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93564 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4168808fe01dfc527475693ffd0c726e980d0250 Author: Dan Gohman <gohman@apple.com> Date: Fri Jan 15 22:18:15 2010 +0000 Fix a typo that Anton noticed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93563 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0ba3d00b5879ceb182da72896f29153a00fbe979 Author: Devang Patel <dpatel@apple.com> Date: Fri Jan 15 22:08:16 2010 +0000 Add FIXME. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93562 91177308-0d34-0410-b5e6-96231b3b80d8 commit 71beb8feb0b2e3c377c5d3b936069d2b199ac769 Author: Bob Wilson <bob.wilson@apple.com> Date: Fri Jan 15 21:55:02 2010 +0000 Fix a comment typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93560 91177308-0d34-0410-b5e6-96231b3b80d8 commit 73fd9c83e00f7d2bf07e7f75313b681bd3f4d618 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 21:50:19 2010 +0000 move "Metadata Nodes and Metadata Strings" section to the right place in the document and edit it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93559 91177308-0d34-0410-b5e6-96231b3b80d8 commit bbc90a5a01951497d5dc2507c1775d9ff7acbca2 Author: Eric Christopher <echristo@apple.com> Date: Fri Jan 15 21:36:30 2010 +0000 Remove the InlineHint attribute. There are no current or planned users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93558 91177308-0d34-0410-b5e6-96231b3b80d8 commit e15db684275e0506cd64dfc38c985cb6ba8ae9d6 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:19:43 2010 +0000 zext / truncate is free on msp430. Inform codegen about this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93556 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4cc89fdd65c6f81bdfbc6ec96b35c4f6790ccaa8 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:19:26 2010 +0000 Reenable tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93555 91177308-0d34-0410-b5e6-96231b3b80d8 commit ca2c00780023f4cd7b54ab2a07d9fc5002a22c8a Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:19:05 2010 +0000 Add branch relaxation pass (shamelessly stolen from PPC). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93554 91177308-0d34-0410-b5e6-96231b3b80d8 commit 30a211f4c265bab1c39b2c1a8a9c270daee3023b Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:18:39 2010 +0000 Provide instruction sizes & encoding. No opcodes yet (but not needed so far). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93553 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8b2004f244c39f94b246a79986371dd065b9332a Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:18:18 2010 +0000 Enable bit tests and setcc stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93552 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8eb9e38a4cce4233cdffea05aac2d36228fd2190 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:18:02 2010 +0000 Add micro-optimization which allows us to fold imm into cmp. This allows us to save 1 word (sometimes) and reduce register pressure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93551 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd786d76b3d1b57877add6c201a7867509eb6758 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 21:17:13 2010 +0000 Add instruction formats & support stuff git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93550 91177308-0d34-0410-b5e6-96231b3b80d8 commit a2b456eaa5f994c054d917816b26a28299da091a Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Fri Jan 15 20:00:12 2010 +0000 Don't make changes to the MBB in MachineBasicBlock::canFallThrough(). This fixes the regression for -pre-regalloc-taildup in MultiSource/Applications/lambda-0.1.3. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93541 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad56f482f17812b99b2e77f54515f8200352a405 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Fri Jan 15 19:59:57 2010 +0000 Simplify logic. Any functional change is unintended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93540 91177308-0d34-0410-b5e6-96231b3b80d8 commit 693b9b9302abeff91f1aceef1306ae86cbbf0bdf Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 19:51:05 2010 +0000 unbreak the build, grr symlinks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93539 91177308-0d34-0410-b5e6-96231b3b80d8 commit 629df86d513070bd13703907edd1c69b72ae8af4 Author: David Greene <greened@obbligato.org> Date: Fri Jan 15 19:43:23 2010 +0000 Add some debug routines to SelectionDAG to dump full DAGs. print/dumpWithDepth allows one to dump a DAG up to N levels deep. dump/printWithFullDepth prints the whole DAG, subject to a depth limit on 100 in the default case (to prevent infinite recursion). Have CannotYetSelect to a dumpWithFullDepth so it is clearer exactly what the non-matching DAG looks like. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93538 91177308-0d34-0410-b5e6-96231b3b80d8 commit ee7d12b25df77d42d1bcffd7046332b5dd97a5b5 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 19:39:23 2010 +0000 fix a bug in range information for $42, eliminate an unneeded argument from ParseExpression. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93536 91177308-0d34-0410-b5e6-96231b3b80d8 commit 36d2c22a8e1432fd06128d200ba6ccb49e51681b Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 19:33:43 2010 +0000 add range information for mem X86Operand's, now all X86Operand's have range info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93535 91177308-0d34-0410-b5e6-96231b3b80d8 commit 717b29aac15677bb6a4c036d2f9a9bf5940f75b3 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 19:28:38 2010 +0000 extend MCAsmParser::ParseExpression and ParseParenExpression to return range information for subexpressions. Use this to provide range info for several new X86Operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93534 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6294228b30eb581423436a809c82918b969294bf Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 19:06:59 2010 +0000 give X86Operand a ctor and start passing SMLoc's into it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93532 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7707ba938b7fd1fe21dcf1d3b0ac3037f4705c25 Author: Victor Hernandez <vhernandez@apple.com> Date: Fri Jan 15 19:04:09 2010 +0000 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast). This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8f898ca2753736c7e11c484e42d88d7961419137 Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 18:58:14 2010 +0000 Revert 93499. After discussion with Chris we agreed FrameIndexes should be lowered, but the same way as everything else (target dependent) rather than in a special hacked way. The lowering needs to be done for eventual purposes of Dwarf generation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93530 91177308-0d34-0410-b5e6-96231b3b80d8 commit 27bb05ccb043c00e540ea029c489c1ce9f904100 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 18:51:29 2010 +0000 add range location info for registers, change X86Operand::Create* implementations to avoid copy ctor use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93528 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9b46007e33ac6a48c13d3fe68f248aec89f821ee Author: Nate Begeman <natebegeman@mac.com> Date: Fri Jan 15 18:51:18 2010 +0000 Hook up llc's -filetype=obj to use MCStreamer if an MCCodeEmitter is available. Remove most of old Mach-O Writer support, it has been replaced by MCMachOStreamer Further refactoring to completely remove MachOWriter and drive the object file writer with the AsmPrinter MCInst/MCSection logic is forthcoming. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93527 91177308-0d34-0410-b5e6-96231b3b80d8 commit f5e9cd74949a5925c5add6c321e92bc7f22adb29 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 18:44:13 2010 +0000 clean up the memory management of the operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93526 91177308-0d34-0410-b5e6-96231b3b80d8 commit d5983540ba915aece4a3ff729a1c732f3e331e04 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 18:27:19 2010 +0000 refactor ParseRegister to avoid using X86Operand as a temporary datastructure when parsing a mem operand. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93521 91177308-0d34-0410-b5e6-96231b3b80d8 commit e89193d2cb6afa5faa0e765e9921f2e5f58cce23 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 15 18:08:37 2010 +0000 mention that unwind isn't to be trusted, patch by Dustin Laurence git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93518 91177308-0d34-0410-b5e6-96231b3b80d8 commit ec9c454e07862c7e231a64160742d0d3b920f35d Author: Victor Hernandez <vhernandez@apple.com> Date: Fri Jan 15 17:36:47 2010 +0000 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1485c4468ade4217247b73687cc0ff87571a6301 Author: Jay Foad <jay.foad@gmail.com> Date: Fri Jan 15 11:29:26 2010 +0000 Test case for http://llvm.org/PR6028. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93511 91177308-0d34-0410-b5e6-96231b3b80d8 commit b88a798d8d5c36a2f5fac2bccb1fef2a748d43be Author: Jay Foad <jay.foad@gmail.com> Date: Fri Jan 15 08:32:58 2010 +0000 Fix http://llvm.org/PR6028, an assertion failure when an UndefValue of integer type is used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93509 91177308-0d34-0410-b5e6-96231b3b80d8 commit 46373fd75a2f39a1cb4541496be4606bb7bc8ac1 Author: Bob Wilson <bob.wilson@apple.com> Date: Fri Jan 15 06:29:17 2010 +0000 Change pre-regalloc tail duplication to only duplicate indirect branch blocks. The pre-regalloc pass caused some regressions in both compile time and performance of the generated code, and it did not improve performance, except for indirect branches. I also moved the check for single-block loops to speed up the common case when running the taildup pass before reg allocation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93505 91177308-0d34-0410-b5e6-96231b3b80d8 commit cf85d133908c0e8f5e792bbf09092055f71eed8b Author: Victor Hernandez <vhernandez@apple.com> Date: Fri Jan 15 03:37:48 2010 +0000 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast). This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c33762fcb92d4a2c4c87a7f166505dfda5cbbeb Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 02:09:27 2010 +0000 Temporary disable tests git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93501 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5be890ef254c10c5871deb84651e5b2f90e1dc00 Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 01:54:55 2010 +0000 Lower FrameIndex operand of DEBUG_VALUE (specially) and print it as a comment on X86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93499 91177308-0d34-0410-b5e6-96231b3b80d8 commit 425b0c803d727037201f52e9d7fdf223736bd5a6 Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 15 01:50:44 2010 +0000 Remove DEBUG_DECLARE, looks like we don't need it. Also, DEBUG_VALUE has side effects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93498 91177308-0d34-0410-b5e6-96231b3b80d8 commit d00ca94481e1c38a2a5884c87a8da208912c873f Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Fri Jan 15 01:29:49 2010 +0000 Fix cmp emission on msp430: we definitely should turn stuff like "icmp lhs, rhs" into "cmp rhs, lhs". This should fix PR5979. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93496 91177308-0d34-0410-b5e6-96231b3b80d8 commit 91d4f32da253072020f37da01eb947fb8bd4321e Author: Devang Patel <dpatel@apple.com> Date: Fri Jan 15 01:12:22 2010 +0000 Do not use AT_specification die for static variables. It confuses gdb. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93494 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0825dec9f18e44ff96408276170622a0e6b242f4 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Fri Jan 15 00:41:53 2010 +0000 Make sure include/llvm/MC/MCParsedAsmOperand.h can be compiled alone. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93492 91177308-0d34-0410-b5e6-96231b3b80d8 commit 03d20786894c4ab368f97af77e4828dc564fd99b Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 00:36:15 2010 +0000 fix 80-column violations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93487 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6372016c7b349b213b895d740e5b7bc0b40fa617 Author: Devang Patel <dpatel@apple.com> Date: Fri Jan 15 00:34:26 2010 +0000 new test case for r93485. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93486 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8ac0913ba36a147c8acb2c1aed76950c3b8d4e7 Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 00:32:47 2010 +0000 Fix 80 column violations and clean up whitespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93484 91177308-0d34-0410-b5e6-96231b3b80d8 commit acec84b4922b79d3acf92d223df92ed503dca857 Author: Devang Patel <dpatel@apple.com> Date: Fri Jan 15 00:26:31 2010 +0000 Do not emit multiple AT_container_type attributes. We need to find a better way to emit this info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93481 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1989192870be588160bb734d82925a9179ed097f Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 00:22:18 2010 +0000 Name change for consistency. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93480 91177308-0d34-0410-b5e6-96231b3b80d8 commit 10ba8daf837c1f7fb7cafb4afed4ad114d37936c Author: Jim Grosbach <grosbach@apple.com> Date: Fri Jan 15 00:18:34 2010 +0000 EmitAtomicCmpSwap() custome inserter needs to delete the MI passed in. EmitAtomicBinary() already does this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93479 91177308-0d34-0410-b5e6-96231b3b80d8 commit 58ccfc49fcce74bc3f2cd74fdc84094e74c119d7 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Thu Jan 14 23:15:26 2010 +0000 Teach PPC how to replaceMachineCodeForFunction correctly. (Fixes JITTest.FunctionIsRecompiledAndRelinked.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93475 91177308-0d34-0410-b5e6-96231b3b80d8 commit a95384dff87b4fe65ae259a9a53910241ef69c67 Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 14 23:00:10 2010 +0000 Pad my commit stats by reducing indentation in this now separate commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93473 91177308-0d34-0410-b5e6-96231b3b80d8 commit f408b41c261983d08bf9141af11291fd915ee0a4 Author: Johnny Chen <johnny.chen@apple.com> Date: Thu Jan 14 22:42:17 2010 +0000 Added 16-bit Thumb Load/Store immediate instructions with encoding bits so that the disassembler can properly decode Load/Store register/immediate instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93471 91177308-0d34-0410-b5e6-96231b3b80d8 commit fc694ce682d80a8149e088e6b8ee0a7ba0587e70 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 14 22:29:57 2010 +0000 add virtual methods to get the start/end of a MCParsedAsmOperand, the default implementation returns "unknown". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93470 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7a3316c3b862ad5cbd09dec363be38823e831fd Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 14 22:21:20 2010 +0000 Split the TargetAsmParser "ParseInstruction" interface in half: the new ParseInstruction method just parses and returns a list of target operands. A new MatchInstruction interface is used to turn the operand list into an MCInst. This requires new/deleting all the operands, but it also gives targets the ability to use polymorphic operands if they want to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93469 91177308-0d34-0410-b5e6-96231b3b80d8 commit c999433f9c9e584dfbc2df0e7dc5272b43748fdf Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Jan 14 22:09:38 2010 +0000 Add variable-width shifts for MSP430 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93468 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3efae6ff7ba5a267b0b36edd33b95628da762665 Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Jan 14 22:09:11 2010 +0000 Remove pseudo-MI in custom inserter. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93467 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a459b4479c77af81ba823280341fe062c88d60f Author: Dale Johannesen <dalej@apple.com> Date: Thu Jan 14 21:50:17 2010 +0000 Fix a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93463 91177308-0d34-0410-b5e6-96231b3b80d8 commit cd9185b6346e881c9d2635d5249c4a597433831a Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 14 21:48:00 2010 +0000 Few minor changes that were requested. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93462 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1421e8d59a8d0728fe2fee64c4af58d0010c4d76 Author: Jim Grosbach <grosbach@apple.com> Date: Thu Jan 14 21:38:31 2010 +0000 Add comment explaining the necessity of r93456 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93459 91177308-0d34-0410-b5e6-96231b3b80d8 commit 76eeaa86c9e230c1b703a40e56d6befdb7d3fd06 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 14 21:32:45 2010 +0000 prune #includes in TargetAsmParser.h Pass in SMLoc of instr opcode into ParseInstruction. Make AsmToken be a class, not a struct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93457 91177308-0d34-0410-b5e6-96231b3b80d8 commit e6bb82e68dccb6fac93d38b546780c139ee42fa4 Author: Jim Grosbach <grosbach@apple.com> Date: Thu Jan 14 21:22:16 2010 +0000 Dwarf EH prepare needs to be run after SjLj prepare. Otherwise, catch info can get misplaced when a selector ends up more than one block removed from the parent invoke(s). This could happen when a landing pad is shared by multiple invokes and is also a target of a normal edge from elsewhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93456 91177308-0d34-0410-b5e6-96231b3b80d8 commit d4fb247eac24e7a5171d800a978be992a65b7a32 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 14 21:21:40 2010 +0000 introduce MCParsedAsmOperand git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93455 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9ca6088b0692b85eea2b216ccdf121d805fe8e55 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 14 21:20:55 2010 +0000 introduce the MCParsedAsmOperand class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93454 91177308-0d34-0410-b5e6-96231b3b80d8 commit 10b2777d3dce6d1a4fa87bf43a920495f3a06836 Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 14 21:04:31 2010 +0000 Small tweak to inline cost computation. Ext of i/fcmp results are mostly optimized away in codegen. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93453 91177308-0d34-0410-b5e6-96231b3b80d8 commit 10e7e9adfddaa1acbcbf173570e5eb40005143eb Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Thu Jan 14 20:19:51 2010 +0000 Remove spurious semicolon. Patch by Diego Iastrubni! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93450 91177308-0d34-0410-b5e6-96231b3b80d8 commit f9b54563dd72aa7b5a2050f1a70806397f0b1005 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 20:12:34 2010 +0000 In debug builds, assert that function-local metadata has only 1 parent function git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93449 91177308-0d34-0410-b5e6-96231b3b80d8 commit 73e6912a5aba875961ab45d88cbefd4d46543104 Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 14 20:12:34 2010 +0000 Reduce the inlining cost of functions that contain calls to easily, and frequently optimized functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93448 91177308-0d34-0410-b5e6-96231b3b80d8 commit 48d78e65301407f8d89fafb3b5a10c1ddeb735ca Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 19:54:11 2010 +0000 Simplify code that chooses when to enumerate function-local metadata operands git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93446 91177308-0d34-0410-b5e6-96231b3b80d8 commit b16eb0065a1e5617bc5a107a6bccb4b09b3be232 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 19:38:44 2010 +0000 Avoid modifying ValueEnumerator's MD ValueList by choosing which function-local MD to write based on the function currently being written git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93441 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1dbcea51a7abb6d7a55fda3d0ba5c63b54e97b4a Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Thu Jan 14 18:19:56 2010 +0000 ARM "l" constraint for inline asm means R0-R7, also for Thumb2. This is consistent with llvm-gcc's arm/constraints.md. Certain instructions (e.g. CBZ, CBNZ) require a low register, even in Thumb2 mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93436 91177308-0d34-0410-b5e6-96231b3b80d8 commit dee49e3d45b73fc22613f633c38440b3767202d6 Author: Bill Wendling <isanbard@gmail.com> Date: Thu Jan 14 10:19:55 2010 +0000 Use ENABLE_ASSERTIONS throughout. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93423 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8da116c6cd70b3661dac3c6d885cb1f657600eef Author: Dan Gohman <gohman@apple.com> Date: Thu Jan 14 03:08:49 2010 +0000 Fix a codegen abort seen in 483.xalancbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93417 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7f496b825a85d619a45776c8c46cbb6886a6b5c1 Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 14 02:24:50 2010 +0000 Test for r93409. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93410 91177308-0d34-0410-b5e6-96231b3b80d8 commit c6e1d7a4611e9fe3d69cda8a738f890c40538ca9 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 02:12:41 2010 +0000 Extend testcase to also test llvm.dbg.value intrinsic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93408 91177308-0d34-0410-b5e6-96231b3b80d8 commit 95592437ed8b3c8d1a14f3490073cebb3f344f3f Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 01:51:28 2010 +0000 Now that LLParser, AsmWriter, BitcodeReader, and BitcodeWriter all correctly support function-local metadata, test it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93406 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa582d67a059ab1999517d1f14474ff25c5bd211 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 01:50:08 2010 +0000 In WriteFunction(), write function-local metadata before we write the instructions, so instruction's references to metadata are fully resolved by the time they get written. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93403 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5412ca3a3a686cb06c984865e3118b941db04079 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 01:47:37 2010 +0000 Fix printing of function-local metadata in AsmWriter git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93402 91177308-0d34-0410-b5e6-96231b3b80d8 commit a330aab51d6044064e5201c3c1ab16d4be658833 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 01:46:02 2010 +0000 Clean up unnecessary return and brackets git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93401 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87d3a90383b71868031d97fe264fddd1e2ed9c47 Author: Victor Hernandez <vhernandez@apple.com> Date: Thu Jan 14 01:45:14 2010 +0000 Add MDNode::getFunction(), which figures out the metadata's function, if it has function that it is local to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93400 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2879e52c70ed1285c567a64cf38bd8f477b2ebad Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Thu Jan 14 00:54:10 2010 +0000 Don't fold insufficiently aligned ldr/str into ldm/stm instructions. An unaligned ldr causes a trap, and is then emulated by the kernel with awesome performance. The darwin kernel does not emulate unaligned ldm/stm Thumb2 instructions, so don't generate them. This fixes the miscompilation of Multisource/Applications/JM/lencod for Thumb2. Generating unaligned ldr/str pairs from a 16-bit aligned memcpy is probably also a bad idea, but that is beyond the scope of this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93393 91177308-0d34-0410-b5e6-96231b3b80d8 commit bb8f25926bb5b8b7f2379aef21146bac3be71867 Author: Stuart Hastings <stuart@apple.com> Date: Thu Jan 14 00:34:53 2010 +0000 Erm, previous patch was wrong; Thanks Bill\! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93381 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea40d109ac1753ddea6cf3b082e9ab6e1a1d4965 Author: Stuart Hastings <stuart@apple.com> Date: Thu Jan 14 00:22:05 2010 +0000 Enable assertions by default for Apple-style builds. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93380 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a07383e0c6355c9edb54978310024b33fe25fa7 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 23:29:11 2010 +0000 this is an SSE-specific issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93373 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0479e24dab45053317f2586ce4cb8c213e3416dd Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 23:28:40 2010 +0000 X86 if conversion + tail merging issues from PR6032. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93372 91177308-0d34-0410-b5e6-96231b3b80d8 commit dee74d4ab14c941d0003b8d95fa5e60b582e4ba9 Author: Bill Wendling <isanbard@gmail.com> Date: Wed Jan 13 23:23:17 2010 +0000 When the visitSub method was split into visitSub and visitFSub, this xform was added to the FSub version. However, the original version of this xform guarded against doing this for floating point (!Op0->getType()->isFPOrFPVector()). This is causing LLVM to perform incorrect xforms for code like: void func(double *rhi, double *rlo, double xh, double xl, double yh, double yl){ double mh, ml; double c = 134217729.0; double up, u1, u2, vp, v1, v2; up = xh*c; u1 = (xh - up) + up; u2 = xh - u1; vp = yh*c; v1 = (yh - vp) + vp; v2 = yh - v1; mh = xh*yh; ml = (((u1*v1 - mh) + (u1*v2)) + (u2*v1)) + (u2*v2); ml += xh*yl + xl*yh; *rhi = mh + ml; *rlo = (mh - (*rhi)) + ml; } The last line was optimized away, but rl is intended to be the difference between the infinitely precise result of mh + ml and after it has been rounded to double precision. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93369 91177308-0d34-0410-b5e6-96231b3b80d8 commit 960771588082bb9fe697624096580e165f9276de Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Wed Jan 13 22:21:43 2010 +0000 Add getSource() to SuccIterator Get the source BB of an iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93364 91177308-0d34-0410-b5e6-96231b3b80d8 commit 616dea8327f0370ea69a54cc79e2803e417c4a2b Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Wed Jan 13 22:21:28 2010 +0000 Extend SuccIterator Implement most of the missing methods to make SuccIterator random access. operator[] is still missing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93363 91177308-0d34-0410-b5e6-96231b3b80d8 commit 965db796f1201b52df303ff41221a659d39cdb0d Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:51:41 2010 +0000 this test requires SSE, thanks to jyasskin for pointing this out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93360 91177308-0d34-0410-b5e6-96231b3b80d8 commit 09d94b4acb609bce0d15b8beafe23f52a0b858d6 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:31:39 2010 +0000 makeNameProper is now private! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93357 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7900c7f84b4e297c330ed9a26e2d473fcc7b3d56 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:29:21 2010 +0000 fix ELF section mangling stuff for weak symbols to not use obsolete Mangler interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93356 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8793d14fbb27b193921c73ffe63dde055fa16e1 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 13 21:25:04 2010 +0000 Fix comment typo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93355 91177308-0d34-0410-b5e6-96231b3b80d8 commit d6f55a432675b2f52facfd8939c1d26f88e78670 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:21:29 2010 +0000 tidy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93352 91177308-0d34-0410-b5e6-96231b3b80d8 commit df0b6d7e5ed6cb65554035f8fbea434cff3b575f Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:12:34 2010 +0000 reduce duplicate mangling logic by using MCSymbol::printMangledName. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93351 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c94fcbaaa65cf3d1087415c3d60a46aa0da6e4b Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 21:09:59 2010 +0000 expose a static function as a static method on the MCSymbol class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93350 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9c1d0b9323b2bff46ddc11699f57baec614551f2 Author: Johnny Chen <johnny.chen@apple.com> Date: Wed Jan 13 21:00:26 2010 +0000 Fixed a couple of places for Thumb MOV where encoding bits are underspecified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93349 91177308-0d34-0410-b5e6-96231b3b80d8 commit 19fe4af382d6bb8a31838e342784cd0cc44a4d34 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 13 19:54:39 2010 +0000 Fix pasto git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93342 91177308-0d34-0410-b5e6-96231b3b80d8 commit 54758997a3ac305e2c51585da42f863e53a2393d Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 19:54:07 2010 +0000 stop the CBE from using deprecated Mangler stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93341 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ed7889c515877e2f8cb8e9f596d7d4d6fc2ba28 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 13 19:37:33 2010 +0000 Write function-local metadata as a metadata subblock of a funciton block git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93339 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0340dc0ec231c7535d724c6c01e3f44f73c1e7b3 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 13 19:36:16 2010 +0000 Enumerate function-local metadata (and its types and operands) only during function-incorporation, global metadata continues to be enumerated during creation of ValueEnumerator git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93338 91177308-0d34-0410-b5e6-96231b3b80d8 commit f59e8a1ea5029df0c2d4eea293eaa577431e841e Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 13 19:34:08 2010 +0000 Parse function-local metadata inside function blocks git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93337 91177308-0d34-0410-b5e6-96231b3b80d8 commit fb7b3cd5adabbf4c902197b01f72ccc82d98ae79 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 19:19:17 2010 +0000 Use the GV version of getNameWithPrefix in TargetLoweringObjectFileCOFF:: SelectSectionForGlobal, unbreaking weak globals with no-name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93336 91177308-0d34-0410-b5e6-96231b3b80d8 commit 90a30f6b36e071aa921d37a1a4149f6b1ae5a01f Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 19:16:39 2010 +0000 Commit some changes I had managed to lose last night while refactoring the code. Avoid change use of PHI instructions because it's not legal to insert any instructions before them. This fixes PR6027. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93335 91177308-0d34-0410-b5e6-96231b3b80d8 commit d419147ec0d4c5d2a3d96eba1c78311f8aec5870 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 19:13:16 2010 +0000 just finish MCizing FnStubInfo which cleans it up and simplifies it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93334 91177308-0d34-0410-b5e6-96231b3b80d8 commit bde11f050c25642786a63d3d3f05e6692424a9f2 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 19:05:36 2010 +0000 don't call getNameWithPrefix repeatedly and unnecesarily. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93333 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3ec2e4720c7de4b562c0d519f1c33c2119b9d89 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 19:00:57 2010 +0000 properly use MCSymbol to print the strings aquired from getNameWithPrefix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93332 91177308-0d34-0410-b5e6-96231b3b80d8 commit ddae339112715bdd2ab047c1e2538148de0ba811 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Wed Jan 13 12:45:23 2010 +0000 Introduce Twine::toStringRef, a variant of toVector which avoids the copy if the twine can be represented as a single StringRef. Use the new methode to simplify some twine users. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93317 91177308-0d34-0410-b5e6-96231b3b80d8 commit 304c727f425ee8a09635749ec34b35e02bef7e10 Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 08:45:40 2010 +0000 Re-enable extension optimization pass. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93313 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2c897bdd8b75aec10543f120426ffea9c1b7572d Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 08:08:33 2010 +0000 upgrade and MC'ize a few uses of makeNameProper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93310 91177308-0d34-0410-b5e6-96231b3b80d8 commit 966e4ef2a684bb3ee93a487cc0e6cc2e9eb386e3 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 08:04:24 2010 +0000 MC'ize this a bit and upgrade APIs git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93309 91177308-0d34-0410-b5e6-96231b3b80d8 commit 74183db4e9e8a85836d586ccf72019195b612fea Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 08:02:14 2010 +0000 add a fixme, ELF MCSection isn't quite right and weak unnamed globals are broken on linux (even though they are pointless, they shouldn't ICE). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93308 91177308-0d34-0410-b5e6-96231b3b80d8 commit 05cda846ddf16a2dbcac2f09327db9e106fae9ec Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 08:01:32 2010 +0000 For now, avoid issuing extract_subreg to reuse lower 8-bit, it's not safe in 32-bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93307 91177308-0d34-0410-b5e6-96231b3b80d8 commit c5f8fa4ca174f7fa976d59e20f24bf9f193495e0 Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 07:59:13 2010 +0000 Add comment; refactor; avoid pulling in DT if it's not used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93306 91177308-0d34-0410-b5e6-96231b3b80d8 commit ccf845edcf88afbb660deaf9c20e00b3ee4ad0a1 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:56:59 2010 +0000 eliminate some uses of Mangler::makeNameProper. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93305 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8fb18e8cc79cb0355b8fee837b6f51d96231bf7 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:50:21 2010 +0000 don't add the \1 to the name. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93304 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5fd08dfd9703ea1fc0c9bc2782cd98e85cdee1cc Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:30:49 2010 +0000 remove uses of deprecated functions, this generates slightly different BlockAddress labels, but nothing semantically important. Add a FIXME that BlockAddress codegen is broken if the LLVM BB has an empty name (e.g. strip was run). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93303 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1aeb82bda71e77b46708f462b14d6648e4004ab8 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:16:53 2010 +0000 use the new form of getNameWithPrefix, not makeNameProper. Among other things, this would do very weird things if the basic block name had (e.g.) a space in it on darwin: makeNameProper would add quotes, then the mcsymbol would escape the quotes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93302 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8554c4b4eb14c6f8839e1e9da505ede3ceaa3094 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:12:06 2010 +0000 add new isSingleStringRef()/getSingleStringRef() methods to twine, and use them to avoid a copy of a string in getNameWithPrefix in the common case. It seems like Value::setName and other places should use this as well? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93301 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ef48d37c161d181c193cd3dc86fab223b8be87b Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 07:01:09 2010 +0000 ugh, my last patch just sped up a method and changed all the clients that I want to completely eliminate. Add fixme's so I remember this in the future, and add the missing helper that they should be upgraded to use instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93300 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8555d56b331b441c9cfb278e652d40c0102c94c3 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 06:38:18 2010 +0000 change Mangler::makeNameProper to return its result in a SmallVector instead of returning it in an std::string. Based on this change: 1. Change TargetLoweringObjectFileCOFF::getCOFFSection to take a StringRef 2. Change a bunch of targets to call makeNameProper with a smallstring, making several of them *much* more efficient. 3. Rewrite Mangler::makeNameProper to not build names and then prepend prefixes, not use temporary std::strings, and to avoid other crimes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93298 91177308-0d34-0410-b5e6-96231b3b80d8 commit 49467cf4256adab9782dd05759777ca75148a200 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 05:02:57 2010 +0000 my mistake, Mangler::makeNameProper wants to take a twine, not a stringref! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93296 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16d05834c00d11735341953f6accdd32d3eac548 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:55:33 2010 +0000 change makeNameProper to take a stringref instead of std::string. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93295 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf7a9fffad13ee0fb75cebb98d2d8312ff5383fa Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:50:20 2010 +0000 give StringRef a const_iterator member. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93294 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4d62af3950127427e5f904b8004919ef381072ce Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:39:46 2010 +0000 fix assert in AsmPrinter::EmitGlobalConstantLargeInt to match reality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93293 91177308-0d34-0410-b5e6-96231b3b80d8 commit b3765504574b67a8c3e89e0c056423fb8334222e Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:38:16 2010 +0000 reduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93292 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2c570dbcdbe8bfe5ff078ef06d0ee7c12fa32bb8 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:34:19 2010 +0000 reduce indentation and add a fast-path to EmitGlobalConstant for 8-byte integers on 64-bit systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93291 91177308-0d34-0410-b5e6-96231b3b80d8 commit cd5ef537f3658f4734185c70b9435acdae531cb0 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 13 04:29:19 2010 +0000 reduce indentation and use early exits in AsmPrinter::EmitConstantValueOnly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93290 91177308-0d34-0410-b5e6-96231b3b80d8 commit 95282170f6843740044a41dcc30d042cc7e47e40 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 13 03:18:30 2010 +0000 Revert 93270 pending investigation of how stray non-constant values end up in ValueEnumerator's ValueList during WriteConstants() git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93289 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa2c7c9f33ed984d5af005078e1c30678db84faf Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 01:51:43 2010 +0000 Disable opt-ext pass to unbreak the build for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93286 91177308-0d34-0410-b5e6-96231b3b80d8 commit 25940625d845c474210d9940397b146f683f4f0f Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 01:43:20 2010 +0000 Remove debug option I accidentally left in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93285 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1e91681a48a184f596f8c643818256e91ebd34fb Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 13 01:39:38 2010 +0000 Fix a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93284 91177308-0d34-0410-b5e6-96231b3b80d8 commit a4db937f5a15424e4dc9911c07c58fa966da6269 Author: Ted Kremenek <kremenek@apple.com> Date: Wed Jan 13 01:02:47 2010 +0000 Update CMake file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93283 91177308-0d34-0410-b5e6-96231b3b80d8 commit 046133233074e04a758692bfd1e875798ac01a95 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 13 00:43:06 2010 +0000 Remove the JustSP single-register regclass. It was only being used by instructions with the t_addrmode_sp addressing mode, and that is pattern matched in a way that guarantees SP is used. There is never any register allocation done from this class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93280 91177308-0d34-0410-b5e6-96231b3b80d8 commit 778dd2177f8b89fd437800f07c6145872d692227 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Wed Jan 13 00:31:43 2010 +0000 Try to fix the ARM and PPC buildbots. The -mattr=vector-unaligned-mem flag doesn't exist there, and this is an x86 test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93279 91177308-0d34-0410-b5e6-96231b3b80d8 commit e08fff54a2915f5331f7e75b5f4804dd3f2eb368 Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 13 00:30:23 2010 +0000 Add a quick pass to optimize sign / zero extension instructions. For targets where the pre-extension values are available in the subreg of the result of the extension, replace the uses of the pre-extension value with the result + extract_subreg. For now, this pass is fairly conservative. It only perform the replacement when both the pre- and post- extension values are used in the block. It will miss cases where the post-extension values are live, but not used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93278 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1241c35b04181da7531854b368c578376a742ddb Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 13 00:00:24 2010 +0000 Further progration of metadata operands. The dumper doesn't really do what I want yet, but at least it doesn't crash now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93272 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1495b487162ff38614701d9bee37ce73bee627fd Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 12 23:37:59 2010 +0000 Make WriteConstants() more robust against stray values in ValueEnumerator's ValueList git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93270 91177308-0d34-0410-b5e6-96231b3b80d8 commit 38e538d376a4e74d2ada0a9903e6af61dca22fd0 Author: Bob Wilson <bob.wilson@apple.com> Date: Tue Jan 12 22:18:56 2010 +0000 Fix a comment typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93261 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0d8d00330d45e9557c704f7fe4a936d3609e0f9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 12 22:00:04 2010 +0000 use consistent tag kinds for ilist_traits git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93259 91177308-0d34-0410-b5e6-96231b3b80d8 commit 49767c9b7438184bd5f7493c7df8e75b5e144068 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 12 20:41:47 2010 +0000 1) Use the new SimplifyInstructionsInBlock routine instead of the copy in JT. 2) When cloning blocks for PHI or xor conditions, use instsimplify to simplify the code as we go. This allows us to squish common cases early in JT which opens up opportunities for subsequent iterations, and allows it to completely simplify the testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93253 91177308-0d34-0410-b5e6-96231b3b80d8 commit f6b96ec9866167982b456a7db765d527f1e0a873 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 12 19:40:54 2010 +0000 add a helper function. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93251 91177308-0d34-0410-b5e6-96231b3b80d8 commit d6c1d2cb7af59f5c697b1b91910950ec29f78373 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 12 18:57:56 2010 +0000 Use Twine, instead of StringRef, for consistency. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93249 91177308-0d34-0410-b5e6-96231b3b80d8 commit 21870c5a2e9c2e2eaeca86d12e4c275149756b13 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 12 18:34:06 2010 +0000 Use ilist_tratis to autoinsert and remove NamedMDNode from MDSymbolTable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93247 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e224cf3893ddc20b5e7019f5047f83eebdf7c4b Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 12 18:31:19 2010 +0000 Eliminate or_not_add and just use AddedComplexity so isel tries or_is_add patterns first. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93245 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3bec0cfa089896fc7e07ab5abb845ee532cea393 Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 12 18:29:23 2010 +0000 Add nounwind. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93244 91177308-0d34-0410-b5e6-96231b3b80d8 commit be355f34e0729dc040a599a40f008359749ef014 Author: Duncan Sands <baldrick@free.fr> Date: Tue Jan 12 17:46:16 2010 +0000 Revert commit 93204, since it causes the assembler to barf on x86-64 linux with messages like this: Error: Incorrect register `%r14' used with `l' suffix git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93242 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6cd9f36b7f3d97c1193d072def590065923cd469 Author: Duncan Sands <baldrick@free.fr> Date: Tue Jan 12 08:30:46 2010 +0000 Fix typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93235 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f4f4fffdf4e5f4ad319059e9357fe7ad84d17ca Author: Duncan Sands <baldrick@free.fr> Date: Tue Jan 12 08:21:07 2010 +0000 Tweak commit 91745, which changed target data for both Mingw and Cygwin, to not touch Cygwin: the change caused llvm-gcc build failures due to long double getting the wrong size. Patch by Aaron Gray. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93234 91177308-0d34-0410-b5e6-96231b3b80d8 commit 997d1728fd33bca27402a6e5cf0cd0534797b172 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 12 04:52:47 2010 +0000 Make several tests less fragile. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93230 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1a59eb84ed47f553845393e105eb0196d2d6253e Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 12 04:42:54 2010 +0000 Reapply the MOV64r0 patch, with a fix: MOV64r0 clobbers EFLAGS. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93229 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9712cf3a0da6e93f9db5a918b921ddbabbb86753 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 12 04:32:35 2010 +0000 Update a partially obsolete comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93228 91177308-0d34-0410-b5e6-96231b3b80d8 commit 07e7dea947431ede055a7748fe215f8d7e988653 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 12 04:30:26 2010 +0000 Fix a typo in a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93227 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a62df736986d233c475d9c2c7ea0a8fb84e5d6d Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 12 02:07:50 2010 +0000 tidy up git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93222 91177308-0d34-0410-b5e6-96231b3b80d8 commit b015ab7e76239fd9b863085d68efa91aca28619c Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 12 02:07:17 2010 +0000 Teach jump threading to duplicate small blocks when the branch condition is a xor with a phi node. This eliminates nonsense like this from 176.gcc in several places: LBB166_84: testl %eax, %eax - setne %al - xorb %cl, %al - notb %al - testb $1, %al - je LBB166_85 + je LBB166_69 + jmp LBB166_85 This is rdar://7391699 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93221 91177308-0d34-0410-b5e6-96231b3b80d8 commit dac07fb1458578df9b6c67b46c47d84c71f899b3 Author: Dale Johannesen <dalej@apple.com> Date: Tue Jan 12 02:01:53 2010 +0000 Add MO_Metadata as an operand kind. Not used yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93220 91177308-0d34-0410-b5e6-96231b3b80d8 commit 31b41036ecde0388929108c70d9b7eb6e4083065 Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 12 00:09:37 2010 +0000 Add TargetInstrInfo::isCoalescableInstr. It returns true if the specified instruction is copy like where the source and destination registers can overlap. This is to be used by the coalescable to coalesce the source and destination registers of instructions like X86::MOVSX64rr32. Apparently some crazy people believe the coalescer is too simple. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93210 91177308-0d34-0410-b5e6-96231b3b80d8 commit c69888cabe7acaa6519450d14d298dec25183978 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 23:41:09 2010 +0000 some cleanup, and make it obvious that ProcessJumpOnPHI only works on branches by renaming it and checking for a branch at the call site. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93208 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1adfa777684a24ff3df8e6696a817bef91b448ef Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 23:18:33 2010 +0000 disable this testcase, PR5997 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93206 91177308-0d34-0410-b5e6-96231b3b80d8 commit 05622b857d032f6f89ad793571f63d342c7d5eae Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 11 22:59:27 2010 +0000 Add manual ISD::OR fastisel selection routines. TableGen is no longer autogen them after 93152 and 93191. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93204 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3881d24e33e918b8e1d54f218eae0ca91027055e Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 11 22:53:48 2010 +0000 Add documentation for llvm.dbg.value intrinsic git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93203 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3f974093444a869ceef2dd3b387c79865509991d Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 22:49:40 2010 +0000 reenable the piece that turns trunc(zext(x)) -> x even if zext has multiple uses, codegen has no apparent problem with the trunc version of this, because it turns into a simple subreg idiom git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93202 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6250d378fe142679dfa3e5a4a7b1b323105cef17 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 22:45:25 2010 +0000 Disable folding sext(trunc(x)) -> x (and other similar cast/cast cases) when the trunc has multiple uses. Codegen is not able to coalesce the subreg case correctly and so this leads to higher register pressure and spilling (see PR5997). This speeds up 256.bzip2 from 8.60 -> 8.04s on my machine, ~7%. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93200 91177308-0d34-0410-b5e6-96231b3b80d8 commit 20c0ca95d363b027d9bedc913ec7d81ff5fa5c6f Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 11 22:31:58 2010 +0000 Consolidate ConvertGlobalValIDToValue, ConvertGlobalOrMetadataValIDToValue, and ConvertValIDToValue into a more powerful ConvertValIDToValue() that does all three's work git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93197 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8941ccfa492c94bf8062817a47a415619b8a497 Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Mon Jan 11 22:22:46 2010 +0000 Remove trailing white spaces in post dominators header file git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93195 91177308-0d34-0410-b5e6-96231b3b80d8 commit e9098bd84df3595bfd9632d9c9e55949e9de34b5 Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Mon Jan 11 22:22:32 2010 +0000 Add getNode() to post dominators. Implement the same interface as already available for dominators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93194 91177308-0d34-0410-b5e6-96231b3b80d8 commit 49e359621c5491296d272ec35279fa7ef4e5a20a Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 11 22:03:29 2010 +0000 Extend r93152 to work on OR r, r. If the source set bits are known not to overlap, then select as an ADD instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93191 91177308-0d34-0410-b5e6-96231b3b80d8 commit 068a9320de8dd78f523946fa8d4119942e224ef5 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 21:58:19 2010 +0000 reduce this to a sensible testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93189 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0c408a4063856e29326c2c6bc099ff439b560e4 Author: David Greene <greened@obbligato.org> Date: Mon Jan 11 21:50:35 2010 +0000 Shorten up this testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93187 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa59ffe04ff0e87196a592b9b241b994e5460de7 Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 11 21:13:41 2010 +0000 Revert 93158. It's breaking quite a few x86_64 tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93185 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4a7e7902eae583ed525562bc68dd6ae0fde4d3ac Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Mon Jan 11 21:02:33 2010 +0000 Avoid adding PHI arguments for a predecessor that has gone away when a BRCOND was constant folded. This fixes PR5980. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93184 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1d6e1b5be983dd6f7fc72e2556189cabb0a6de67 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 11 20:33:12 2010 +0000 Remove unused string functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93183 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7aaefe2f92f0cec4ea74fd407e0a43428d2abc2 Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 11 20:18:04 2010 +0000 Do not turn 8-bit OR to ADD since ADD8ri is not 3-addressfiable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93182 91177308-0d34-0410-b5e6-96231b3b80d8 commit 351d0bd7097d298a5fb32601cb4fd7e6dd57f7f5 Author: Mon P Wang <wangmp@apple.com> Date: Mon Jan 11 20:12:49 2010 +0000 Disable transformation of select of two loads to a select of address and then a load if the loads are not in the default address space because the transformation discards src value info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93180 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0f786eaf08109f7350f52d027c60572ffa5308e9 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 11 19:45:18 2010 +0000 Add StrInStrNoCase, a StringRef version of CStrInCStrNoCase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93174 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9a1969a435ea1079bb763f40c2f7e7eba343774c Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 11 19:35:55 2010 +0000 Add top level section for named metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93172 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ce22094023895d13ca93858e56e45011876ab99 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Mon Jan 11 19:19:26 2010 +0000 Improve unclear bits and inaccuracies in structure and insertvalue documentation. Patch by Dustin Laurence! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93170 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5f02c5eaf2e18b7ac09cd8b27c0b0e3b7083612f Author: Jeffrey Yasskin <jyasskin@google.com> Date: Mon Jan 11 18:53:47 2010 +0000 Update the -tailcallopt description to match djg's improvements to the calling convention. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93167 91177308-0d34-0410-b5e6-96231b3b80d8 commit 78104868cacedaabbdd6fd942414bf7b77a6011e Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 11 18:52:33 2010 +0000 s/NextValueNo/NextMDValueNo while processing metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93165 91177308-0d34-0410-b5e6-96231b3b80d8 commit ca226531ab9fc85000221a7b160b55b10dcdce1b Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 11 18:44:35 2010 +0000 Turns out llvm-gcc still uses SplitString with a vector. Add it back until I have a fix. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93163 91177308-0d34-0410-b5e6-96231b3b80d8 commit 086ac78ea4d4ea944a75869c5fd357edba4eaedb Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Mon Jan 11 18:03:24 2010 +0000 Reimplement getToken and SplitString as "StringRef helper functions" - getToken is modeled after StringRef::split but it can split on multiple separator chars and skips leading seperators. - SplitString is a StringRef::split variant for more than 2 elements with the same behaviour as getToken. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93161 91177308-0d34-0410-b5e6-96231b3b80d8 commit d379d96918d8063d25a36c522868d72e29b5ed86 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:58:34 2010 +0000 Use a 32-bit and with implicit zero-extension instead of a 64-bit and if it has an immediate with at least 32 bits of leading zeros, to avoid needing to materialize that immediate in a register first. FileCheckize, tidy, and extend a testcase to cover this case. This fixes rdar://7527390. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93160 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6fb7a5024fb9a98ff181c5d2a9c77c7953e0d084 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:37:57 2010 +0000 Re-instate MOV64r0 and MOV16r0, with adjustments to work with the new AsmPrinter. This is perhaps less elegant than describing them in terms of MOV32r0 and subreg operations, but it allows the current register to rematerialize them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93158 91177308-0d34-0410-b5e6-96231b3b80d8 commit d21da3e6e415e725824e03262520efbb8149a58a Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:24:27 2010 +0000 Generalize this check to avoid depending on a specific register assignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93157 91177308-0d34-0410-b5e6-96231b3b80d8 commit 543461a93129eb01a82e917940c0d951af32c7b3 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:23:56 2010 +0000 Make this test less trivial, to avoid spurious failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93156 91177308-0d34-0410-b5e6-96231b3b80d8 commit e15b21f014ffe1186cd8b9884802b6bea7e2888e Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:21:05 2010 +0000 Pattern top-level operators don't need to be restricted to a single user. The _su forms are intended for non-top-level nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93155 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6d79e4f053a8cbebdc1476544d883afaf2a5902e Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 11 17:14:46 2010 +0000 Reword this comment to reference a more fundamental issue. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93154 91177308-0d34-0410-b5e6-96231b3b80d8 commit 06603838de13691e164ec2bfa1f56da2e10ecc3f Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 11 17:03:47 2010 +0000 Select an OR with immediate as an ADD if the input bits are known zero. This allow the instruction to be 3address-fied if needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93152 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8b55fc02bb4b4c844cd50f489f700f2e8c8ee2e0 Author: David Greene <greened@obbligato.org> Date: Mon Jan 11 16:29:42 2010 +0000 Implement a feature (-vector-unaligned-mem) to allow targets to ignore alignment requirements for SIMD memory operands. This is useful on architectures like the AMD 10h that do not trap on unaligned references if a status bit is twiddled at startup time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93151 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6425510605b8e664e589fc31eb3d15f042d9e02c Author: Victor Hernandez <vhernandez@apple.com> Date: Mon Jan 11 07:45:19 2010 +0000 Respond to Chris' review: Make InsertDbgValueIntrinsic() and get Offset take and recieve a uint64_t. Get constness correct for getVariable() and getValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93149 91177308-0d34-0410-b5e6-96231b3b80d8 commit 390fcc5ffcc455ce1afc7d6ca153b65876b634d0 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 06:55:24 2010 +0000 add one more bitfield optimization, allowing clang to generate good code on PR4216: _test_bitfield: ## @test_bitfield orl $32962, %edi movl $4294941946, %eax andq %rdi, %rax ret instead of: _test_bitfield: movl $4294941696, %ecx movl %edi, %eax orl $194, %edi orl $32768, %eax andq $250, %rdi andq %rax, %rcx movq %rdi, %rax orq %rcx, %rax ret Evan is looking into the remaining andq+imm -> andl optimization. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93147 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4c6ee8169dfcedb5bcb680ab4d212e204f7073c3 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 04:05:13 2010 +0000 Extend CanEvaluateZExtd to handle and/or/xor more aggressively in the BitsToClear case. This allows it to promote expressions which have an and/or/xor after the lshr, promoting cases like test2 (from PR4216) and test3 (random extample extracted from a spec benchmark). clang now compiles the code in PR4216 into: _test_bitfield: ## @test_bitfield movl %edi, %eax orl $194, %eax movl $4294902010, %ecx andq %rax, %rcx orl $32768, %edi andq $39936, %rdi movq %rdi, %rax orq %rcx, %rax ret instead of: _test_bitfield: ## @test_bitfield movl %edi, %eax orl $194, %eax movl $4294902010, %ecx andq %rax, %rcx shrl $8, %edi orl $128, %edi shlq $8, %rdi andq $39936, %rdi movq %rdi, %rax orq %rcx, %rax ret which is still not great, but is progress. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93145 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5e08c3a19a6e45bd15e41c3df04b8ba3c7d84dcb Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 03:32:00 2010 +0000 Remove the dead TD argument to CanEvaluateZExtd, and add a new BitsToClear result which allows us to start promoting expressions that end with a lshr-by-constant. This is conservatively correct and better than what we had before (see testcases) but still needs to be extended further. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93144 91177308-0d34-0410-b5e6-96231b3b80d8 commit 41314c1f6da6dcfa806218e750a7ccd8442269ed Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 11 02:43:35 2010 +0000 improve comments, remove dead TD argument to CanEvaluateSExtd. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93143 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa031d29fcb36598ad0e7524eeba7b968775f15c Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 20:30:41 2010 +0000 teach sext optimization to handle truncs from types that are not the dest of the sext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93128 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ee51f8654f7a3765441c34af43c81032ecce836 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 20:25:54 2010 +0000 teach zext optimization how to deal with truncs that don't come from the zext dest type. This allows us to handle test52/53 in cast.ll, and allows llvm-gcc to generate much better code for PR4216 in -m64 mode: _test_bitfield: ## @test_bitfield orl $32962, %edi movl %edi, %eax andl $-25350, %eax ret This also fixes a bug handling vector extends, ensuring that the mask produced is a vector constant, not an integer constant. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93127 91177308-0d34-0410-b5e6-96231b3b80d8 commit f3d8a44a4116b338dc5e1760c4fc8c0b435c9afe Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 20:21:42 2010 +0000 fix a buggy assertion, CreateIntegerCast should allow integer vectors as well as just integers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93126 91177308-0d34-0410-b5e6-96231b3b80d8 commit df77d76913bc96239d8c630f52a28fff8cf7b1a7 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Sun Jan 10 18:48:49 2010 +0000 Suppress a warning on gcc 4.4. warning: suggest parentheses around ‘&&’ within ‘||’. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93121 91177308-0d34-0410-b5e6-96231b3b80d8 commit 178ec6095c2522d6da1e7a66a2cc5f3ecab775e0 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 07:57:20 2010 +0000 simplify CanEvaluateSExtd to return a bool now that we have a simpler profitability predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93111 91177308-0d34-0410-b5e6-96231b3b80d8 commit d26a9010287c3b76b4328c0a6bb9de4e847d475b Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 07:42:21 2010 +0000 the NumCastsRemoved argument to CanEvaluateSExtd is dead, remove it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93110 91177308-0d34-0410-b5e6-96231b3b80d8 commit cef643a7cffcf37249fa8908c048d290b7bce03f Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 07:40:50 2010 +0000 now that the cost model has changed, we can always consider elimination of a sign extend to be a win, which simplifies the client of CanEvaluateSExtd, and allows us to eliminate more casts (examples taken from real code). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93109 91177308-0d34-0410-b5e6-96231b3b80d8 commit 86de4ca0f1cc0d95d6c1def0b5f96c4e50ce9ddd Author: Victor Hernandez <vhernandez@apple.com> Date: Sun Jan 10 07:14:18 2010 +0000 Compute isFunctionLocal in MDNode ctor or via argument in new function getWhenValsUnresolved(). Document PFS argument to ParseValID() and ConvertGlobalOrMetadataValIDToValue(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93108 91177308-0d34-0410-b5e6-96231b3b80d8 commit 771e466242edb92436d5ae93b42307dcbaad1044 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 07:08:30 2010 +0000 change the preferred canonical form for a sign extension to be lshr+ashr instead of trunc+sext. We want to avoid type conversions whenever possible, it is easier to codegen expressions without truncates and extensions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93107 91177308-0d34-0410-b5e6-96231b3b80d8 commit b814f837bf9ca083a1a702e14010d84326d556b6 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 06:59:55 2010 +0000 fix indentation of switch statements, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93106 91177308-0d34-0410-b5e6-96231b3b80d8 commit 79046fd0ead7d80018ab7732414c4a0c21b41b15 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 06:50:04 2010 +0000 fix pasto that broke bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93105 91177308-0d34-0410-b5e6-96231b3b80d8 commit 812e446a719dc38e01d58493701c62a46e537e2b Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 02:50:04 2010 +0000 simplify CanEvaluateZExtd now that we don't care about the number of bits known clear in the result and don't care about the # casts eliminated. TD is also dead but keeping it for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93098 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2d9228e406d76b4e18d98d03047a834651c4114f Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 02:39:31 2010 +0000 two changes: 1) don't try to optimize a sext or zext that is only used by a trunc, let the trunc get optimized first. This avoids some pointless effort in some common cases since instcombine scans down a block in the first pass. 2) Change the cost model for zext elimination to consider an 'and' cheaper than a zext. This allows us to do it more aggressively, and for the next patch to simplify the code quite a bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93097 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0ac8ce223227de5de5ba9e3d7d8b0d676a4a578b Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 02:22:12 2010 +0000 enhance CanEvaluateZExtd to handle shift left and sext, allowing more expressions to be promoted and casts eliminated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93096 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3d7c306da4bc3477bb10bfd43f61ba0f235f04e Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 01:35:55 2010 +0000 remove an xform subsumed by EvaluateInDifferentType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93095 91177308-0d34-0410-b5e6-96231b3b80d8 commit a44d31b166a84c4e0ff14905c04db781f381a7e9 Author: Julien Lerouge <jlerouge@apple.com> Date: Sun Jan 10 01:07:22 2010 +0000 Fix nondeterministic behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93093 91177308-0d34-0410-b5e6-96231b3b80d8 commit b66b27420b31735c5cf7e7b035689ed6170f27fc Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 01:04:31 2010 +0000 clean up this xform by using m_Trunc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93092 91177308-0d34-0410-b5e6-96231b3b80d8 commit dc13154dc85bd26c17815527804c78aa708a1809 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 01:00:46 2010 +0000 inline and remove the rest of commonIntCastTransforms. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93091 91177308-0d34-0410-b5e6-96231b3b80d8 commit e20f3dd45a603f728d13dde43873750c96cefdae Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 10 00:58:42 2010 +0000 Inline the expression type promotion/demotion stuff out of commonIntCastTransforms into the callers, eliminating a switch, and allowing the static predicate methods to be moved down to live next to the corresponding function. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93089 91177308-0d34-0410-b5e6-96231b3b80d8 commit 440048c27b6462450387d9dc744064cd3e90d6dc Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 23:25:21 2010 +0000 hopefully unbreak the ocaml bindings. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93082 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1192d8ccdbf231d0f3eda9f9397bfc3e5f022e25 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 22:30:40 2010 +0000 add 3 passes which have been added but aren't used afaik. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93080 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8b943dd8ffc9684e48e30a306565ae6467c57c17 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 22:27:07 2010 +0000 "In order to ease automatic bindings generation, it would be helpful if boolean values were distinguishable from integers. The attached patch introduces "typedef int LLVMBool;", and uses LLVMBool instead of int throughout the C API, wherever a boolean value is called for." Patch by James Y Knight! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93079 91177308-0d34-0410-b5e6-96231b3b80d8 commit d009f94244e0583126a9a9ca23bdf231b3090119 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Sat Jan 9 19:44:16 2010 +0000 Clarify the requirements for a "tail call" to actually be optimized into a jump. People clearly weren't finding the extra requirements in CodeGenerator.html. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93070 91177308-0d34-0410-b5e6-96231b3b80d8 commit c70bab79d5cb10d92c18942db5f5424f72797dae Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 19:24:49 2010 +0000 fix bogus test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93069 91177308-0d34-0410-b5e6-96231b3b80d8 commit dba1e402d851dcba8d48285c9306febe0d2bd59d Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 19:24:18 2010 +0000 fix bogus test git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93068 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7fbedd2bbeb4a01472d40d9766c16bc01d357c86 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 19:20:07 2010 +0000 fix PR5983, reject function bodies with no blocks per the grammar. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93067 91177308-0d34-0410-b5e6-96231b3b80d8 commit 12b4c9732917701a648e626fcbd39c86156c15dc Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 19:15:14 2010 +0000 improve documentation for linkonce to be less confusing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93066 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7375479e2bd1a4037b5848e6ee117f417d0002b3 Author: Jeffrey Yasskin <jyasskin@google.com> Date: Sat Jan 9 18:56:43 2010 +0000 Fix http://llvm.org/PR5729: x86-64 tail calls were putting their targets into R11, and then asserting that the target was in R9. Since R9 isn't reserved for the target anymore, and is used as an argument, this patch changes the assertion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93065 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8175c3426e34da1fbe54723f5b2bd4ef370ca951 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 18:40:31 2010 +0000 2010 is upon us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93062 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2f2b306981280b43b98cdff2e00baebadbb8a36c Author: Dan Gohman <gohman@apple.com> Date: Sat Jan 9 18:17:45 2010 +0000 Use WriteAsOperand instead of getName() to print loop header names, so that unnamed blocks are handled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93059 91177308-0d34-0410-b5e6-96231b3b80d8 commit 305ce175ae439b529189564849a59d6789cd5ac2 Author: Dan Gohman <gohman@apple.com> Date: Sat Jan 9 17:22:48 2010 +0000 Tighten up the vim LLVM IR syntax highlighting regex for labels, and add a highlighting rule for identifiers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93056 91177308-0d34-0410-b5e6-96231b3b80d8 commit f235cf58d7574682e14df6827d92ddf2506e1d82 Author: Dan Gohman <gohman@apple.com> Date: Sat Jan 9 17:15:21 2010 +0000 Set the vim auto-indent setting for open braces after case statements to follow LLVM source convention. Before: case X: { stuff; } After: case X: { stuff; } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93055 91177308-0d34-0410-b5e6-96231b3b80d8 commit d5f58e5c06081e60b4a8ba938799d9e1dc97da95 Author: David Chisnall <csdavec@swan.ac.uk> Date: Sat Jan 9 16:27:31 2010 +0000 Fixed linking of modules containing aliases to constant bitcasts. Existing behaviour first tried to replace the aliases with the global that they aliased (rather than the bitcast), causing a crash on an assert because the types didn't match. When this was fixed, it then did the same thing creating the new alias (creating an alias with a different type to its aliasee). Linking modules containing aliases to GEPs is still not quite right. GEPs that are equivalent to bitcasts will be replaced by bitcasts, GEPs that are not will just break. Aliases to GEPs that are not equivalent to bitcasts are horribly broken anyway (it might be worth adding an assert when creating the alias to prevent these being created; they just cause problems later). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93052 91177308-0d34-0410-b5e6-96231b3b80d8 commit b2f154bef2486073b253f93bfb96ec95c408af49 Author: Duncan Sands <baldrick@free.fr> Date: Sat Jan 9 08:30:33 2010 +0000 Suppress use of uninitialized variable warning. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93046 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9c42e1823c0491834a21f08f60b31b21e781594f Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 06:01:36 2010 +0000 only factor from expressions whose uses are empty and whose base is the right expression type. This fixes PR5981. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93045 91177308-0d34-0410-b5e6-96231b3b80d8 commit c807a81409786d58f6a73a018da26fd66aec0790 Author: Dan Gohman <gohman@apple.com> Date: Sat Jan 9 02:13:55 2010 +0000 Revert an earlier change to SIGN_EXTEND_INREG for vectors. The VTSDNode really does need to be a vector type, because TargetLowering::getOperationAction for SIGN_EXTEND_INREG uses that type, and it needs to be able to distinguish between vectors and scalars. Also, fix some more issues with legalization of vector casts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93043 91177308-0d34-0410-b5e6-96231b3b80d8 commit 43bc13b68b86c2136326ff0a245fa065dac9ee7c Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 9 02:02:37 2010 +0000 clean up this code, add a fixme. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93042 91177308-0d34-0410-b5e6-96231b3b80d8 commit 041890c13119d3b398ff4df9644e95bf517a94d3 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 9 01:44:59 2010 +0000 Delete NamedMDSymTable while destrucing Module. Disable copy ctor and operator= for NamedMDSymTable. Hide typedef that should be public. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93041 91177308-0d34-0410-b5e6-96231b3b80d8 commit 976e43dbca87ed25b2e078948978ea737db514b7 Author: Dale Johannesen <dalej@apple.com> Date: Sat Jan 9 01:24:25 2010 +0000 Add DEBUG_DECLARE. Not used yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93040 91177308-0d34-0410-b5e6-96231b3b80d8 commit 459c5a1e2e8f64e3519858e3d5309c9fb3073ec1 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 9 01:24:03 2010 +0000 NamedMDNode is never used so there is no need to enumerate it here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93039 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0a18fe82407938da5ec62ce497217fb044b55918 Author: Julien Lerouge <jlerouge@apple.com> Date: Sat Jan 9 01:06:49 2010 +0000 Fix nondeterministic behavior. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93038 91177308-0d34-0410-b5e6-96231b3b80d8 commit f36c6867337e26f5f6168442255605b12cafbd35 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 9 01:02:22 2010 +0000 NamedMDNode element is either null or MDNode. Otherwise this is a malformed NamedMDNode record. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93037 91177308-0d34-0410-b5e6-96231b3b80d8 commit 580749d7f096d447d30de5706d7b38d0d587f131 Author: Devang Patel <dpatel@apple.com> Date: Sat Jan 9 00:30:14 2010 +0000 Derive NamedMDNode from Value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93032 91177308-0d34-0410-b5e6-96231b3b80d8 commit 53d17bd41e372d6302b8a283f646be7fa17420dc Author: Evan Cheng <evan.cheng@apple.com> Date: Sat Jan 9 00:21:08 2010 +0000 Dan pointed out checking whether a node is dead by comparing its opcode to ISD::DELETED_NODE is not safe. Use a DAGUpdateListener to remove dead nodes from work list instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93031 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0b8c4f4b010dc5abc8748141f5de17cb0bc74d6b Author: Dale Johannesen <dalej@apple.com> Date: Fri Jan 8 23:51:25 2010 +0000 Add DEBUG_VALUE. Not used yet. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93030 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2c8f4c8af62d1e45c1a24e7d217e796edfe5e9fe Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 8 23:41:50 2010 +0000 Fix a critical bug in 64-bit atomic operation lowering for 32-bit. The results of the cmpxchg8b instructions are being thrown away when it branches back to the top of the checking loop. This means the loop always compares against the old value and this can result in a dead lock. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93028 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ee164a6e66a3c0f9495567836990aa210876a0f Author: Eric Christopher <echristo@apple.com> Date: Fri Jan 8 21:42:39 2010 +0000 Grammar thinko. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93027 91177308-0d34-0410-b5e6-96231b3b80d8 commit e169d8bfd07d97c608156c4696e9a418f738fb6c Author: Eric Christopher <echristo@apple.com> Date: Fri Jan 8 21:37:11 2010 +0000 Remove unnecessary dyn_cast and add a comment. Part of a WIP. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93026 91177308-0d34-0410-b5e6-96231b3b80d8 commit 632002f4605f3f0e39f15710cf441f556c2b9b03 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 8 19:28:47 2010 +0000 mplement a theoretical fixme. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93024 91177308-0d34-0410-b5e6-96231b3b80d8 commit 91cf1207b83e466dfb7381aa324e5c01189e0ed8 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 8 19:19:23 2010 +0000 rename CanEvaluateInDifferentType -> CanEvaluateTruncated and simplify it now that it is only used for truncates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93021 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3ec49f0e24bbdf5053c68b534df66206b866871f Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 8 19:14:57 2010 +0000 Fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93020 91177308-0d34-0410-b5e6-96231b3b80d8 commit e19af54f0e8886ceb55f47b97acc4eefe682a5ea Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 8 19:04:21 2010 +0000 teach instcombine to delete sign extending shift pairs (sra(shl X, C), C) when the input is already sign extended. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93019 91177308-0d34-0410-b5e6-96231b3b80d8 commit b57b7a0c6f3feb355f11f581b34d49250397a6a4 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 8 19:02:23 2010 +0000 fix PR5978 by peeling the loop so that we avoid shifting the result int by 8 for the first byte. While normally harmless, if the result is smaller than a byte, this shift is invalid. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93018 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c1e23389ba5f7a3ca69a1720ea2db76f3e37984 Author: Duncan Sands <baldrick@free.fr> Date: Fri Jan 8 17:51:48 2010 +0000 Suppress an unused variable warning when assertions are off; remove some trailing whitespace while there. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93008 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8e9676ce83ade2878871f01328687e024ced157c Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 8 17:48:19 2010 +0000 tidy up some stuff duncan pointed out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93007 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8c04e69b9f0bfba83df8f3fe13af454e10bc2bf3 Author: Johnny Chen <johnny.chen@apple.com> Date: Fri Jan 8 17:41:33 2010 +0000 Minor change, change the order of two "let Inst{...}" stmts within multiclass T2I_bin_ii12rs definition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93006 91177308-0d34-0410-b5e6-96231b3b80d8 commit 312d366163543c423e407d7bd5051a89d4431ff3 Author: Eric Christopher <echristo@apple.com> Date: Fri Jan 8 08:24:49 2010 +0000 After further thought revert the patch to make fast-isel avoid putting relocations into the constant pool - this isn't needed for correctness and in the rare occasion it happens would pull us out of fast isel for the block. If fast-isel application startup time ever becomes an issue we can add better support for these addresses instead of bailing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92995 91177308-0d34-0410-b5e6-96231b3b80d8 commit 23432d0d8762223b47e8f109ba2bdf8b75e77160 Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 8 02:36:12 2010 +0000 ReplaceAllUsesOfValueWith may delete other nodes that the one being replaced. Do not delete dead nodes again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92988 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3d6fff46b5a1832301135850c601a13a0b5c6ac Author: Evan Cheng <evan.cheng@apple.com> Date: Fri Jan 8 01:29:19 2010 +0000 Fix what looks to me obvious instruction definition bugs. 1. CMPXCHG8B and CMPXCHG16B did not specify implicit physical register defs and uses. 2. LCMPXCHG8B is loading 64 bit memory, not 32 bit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92985 91177308-0d34-0410-b5e6-96231b3b80d8 commit 134dcfa3d569587348308e8cd8d995e1597752d1 Author: Eric Christopher <echristo@apple.com> Date: Fri Jan 8 00:05:33 2010 +0000 Remove extraneous include. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92972 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0c4eb989ed9e2cf7e6724b63bcd1cc6f2ef944a0 Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Thu Jan 7 23:50:41 2010 +0000 Add assert to check dominance dfs numbers. Compare the dominance information calculated using a dominance tree walk to the information calculated based on DFS numbers, if XDEBUG is enabled. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92969 91177308-0d34-0410-b5e6-96231b3b80d8 commit 689b8144d6689b1c08c163d883185f3bdbb1c0bf Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Thu Jan 7 23:50:25 2010 +0000 Remove workaround in PostDominators Remove a FIXME and unify code that was necessary to work around broken updateDFSNumbers(). Before updateDFSNumbers() did not work correctly for post dominators. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92968 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1bdcc0cf6f202d4c83a7bd3233a46c5d84e9752f Author: Tobias Grosser <grosser@fim.uni-passau.de> Date: Thu Jan 7 23:50:06 2010 +0000 Fix DFS number calculation for postdominators The DFS number calculation for postdominators was broken. In the case of multiple exits that form the post dominator root nodes, do not iterate over all exits, but start from the virtual root node. Otherwise bbs, that are not post dominated by any exit but by the virtual root node, will never be assigned a DFS number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92967 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3d9ecce309b7d133b6fe6a841dd52980ffb5c273 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 23:44:37 2010 +0000 teach ComputeNumSignBits to look through PHI nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92964 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6adf1ba76c4533dbe08142585838b5d72506f0be Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 23:42:23 2010 +0000 filecheckize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92963 91177308-0d34-0410-b5e6-96231b3b80d8 commit ce802c07d5d10744bff2b16fd88c46e25a5cf948 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 23:41:00 2010 +0000 Enhance instcombine to reason more strongly about promoting computation that feeds into a zext, similar to the patch I did yesterday for sext. There is a lot of room for extension beyond this patch. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92962 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c106b561b6d796f1f0e4ef28deb5c677f367857 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 21:59:23 2010 +0000 Fix rdar://7517201, a regression introduced by r92849. When folding a and(any_ext(load)) both the any_ext and the load have to have only a single use. This removes the anyext-uses.ll testcase which started failing because it is unreduced and unclear what it is testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92950 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2b32b5663d77046c560d61f05468b0dc87b4bb8c Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 21:53:27 2010 +0000 factor this code better and reduce nesting at the same time, no functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92948 91177308-0d34-0410-b5e6-96231b3b80d8 commit b8c38fb2275c52c1a7b206e34a5f6d1b8b096d9e Author: David Greene <greened@obbligato.org> Date: Thu Jan 7 21:43:58 2010 +0000 Revert r92939. These intrinsics get matched to LLVM instructions, so removing at Chris' request. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92947 91177308-0d34-0410-b5e6-96231b3b80d8 commit 656988c1575af7f102ecda3b5c5c8322c405a596 Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 7 20:58:44 2010 +0000 APInt'fy TargetLowering::SimplifySetCC to fix PR5963. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92943 91177308-0d34-0410-b5e6-96231b3b80d8 commit 41caa6c9b6fb1312853324bc3bfc34559ad2c63c Author: David Greene <greened@obbligato.org> Date: Thu Jan 7 19:47:43 2010 +0000 Add some "missing" instrinsics to make the SSE intrinsic set a bit more orthogonal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92939 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8352338331930938b73930737b4fd543e42b35a8 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 7 19:46:15 2010 +0000 Simplify code. No intended functionality/performance change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92938 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5382bfd8db0236ef99b2b960216afb73befa2db1 Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 7 19:45:14 2010 +0000 If the data requires a relocation then don't attempt to add it to the constant pool for fast-isel. We already don't add it for the normal case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92934 91177308-0d34-0410-b5e6-96231b3b80d8 commit dd05649bf260ba98f9c3e3ae7bc0c8ad0e5af0af Author: Eric Christopher <echristo@apple.com> Date: Thu Jan 7 19:44:05 2010 +0000 We need to put any kind of data with a relocation into a not-readonly segment on darwin. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92933 91177308-0d34-0410-b5e6-96231b3b80d8 commit cb5497752b116baa3397e336a16ab2e9111ba941 Author: Devang Patel <dpatel@apple.com> Date: Thu Jan 7 19:39:36 2010 +0000 Use separate namespace for named metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92931 91177308-0d34-0410-b5e6-96231b3b80d8 commit f106d055dbf1a26a4067c6110a3b8e41534f2bbc Author: Kovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com> Date: Thu Jan 7 18:46:52 2010 +0000 Fix occurrence typo git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92926 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5b725deb1d7ed94eb583d92e6acf5d92e641dedf Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 17:53:10 2010 +0000 constant materialization could be improved. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92921 91177308-0d34-0410-b5e6-96231b3b80d8 commit a4eae42f0c15257ff2cbed2c57b062b6d715c2c7 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 7 17:50:57 2010 +0000 Kill dead store. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92920 91177308-0d34-0410-b5e6-96231b3b80d8 commit 405091faf70c7f5cecdf4b76e28cc877adacac53 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 7 17:29:08 2010 +0000 Remove dead variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92919 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8426b4a20e9aea0aae90eaa3ef55564e12d57257 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 7 17:27:56 2010 +0000 Use pop_back_val instead of back()+pop_back. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92918 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3b7277cf7bfcda19691eebb85c8d20f9e1ccaa9 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Jan 7 13:50:07 2010 +0000 Use a do-while loop instead of while + boolean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92912 91177308-0d34-0410-b5e6-96231b3b80d8 commit 378d545652e3c580e7743c3dc8fa468441150c9d Author: Duncan Sands <baldrick@free.fr> Date: Thu Jan 7 09:05:26 2010 +0000 Correct spelling. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92910 91177308-0d34-0410-b5e6-96231b3b80d8 commit ba1c49f15360dd69858b7ea2c6b3c58aace4f0a9 Author: Duncan Sands <baldrick@free.fr> Date: Thu Jan 7 05:48:42 2010 +0000 Be less stingy as to how many selects and phi nodes we are prepared to look through. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92898 91177308-0d34-0410-b5e6-96231b3b80d8 commit 76476aaaaab38d36caccf3bccf553f5ee459f6f9 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Thu Jan 7 02:24:06 2010 +0000 More trivial optimizations to a function well outside the critical path git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92896 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4c106cdb8573b5701646dff97629fb99d59540d7 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 01:20:20 2010 +0000 handle ConstantVector while I'm in here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f9fe1268eb4f437cf4de50dfc7e06e8cd7a30a0 Author: Chris Lattner <sabre@nondot.org> Date: Thu Jan 7 01:16:21 2010 +0000 fix a globalopt crash on 'bullet' (handling evaluation of a store to an element of a vector in a static ctor) which occurs with an unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically does exactly the same stuff as InsertElement constant folding, but it now handles vectors, and you can't insertelement into a vector. It would be 'really nice' if GEP into a vector were not legal. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92889 91177308-0d34-0410-b5e6-96231b3b80d8 commit f26b80901d602701715d3e3fbe37e0feb797b636 Author: Evan Cheng <evan.cheng@apple.com> Date: Thu Jan 7 00:54:06 2010 +0000 Fix a minor regression from my dag combiner changes. One more place which needs to look pass truncates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92885 91177308-0d34-0410-b5e6-96231b3b80d8 commit eacfcd677a4dc1df383eb9ff45fde0c40ab8f98b Author: Douglas Gregor <doug.gregor@gmail.com> Date: Thu Jan 7 00:51:54 2010 +0000 Switch StringRef::edit_distance over to using raw pointers, since both std::vector and llvm::SmallVector have annoying performance tradeoffs. No, I don't expect this to matter, and now it won't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92884 91177308-0d34-0410-b5e6-96231b3b80d8 commit ccaafd35c2650453cf54d46edc6dedc8d2d70bff Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Thu Jan 7 00:51:04 2010 +0000 Add comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92883 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7cdaa0ff91a8386fbef22a48c85d624391b8cd4 Author: Jim Grosbach <grosbach@apple.com> Date: Wed Jan 6 23:54:42 2010 +0000 80 column violations git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92876 91177308-0d34-0410-b5e6-96231b3b80d8 commit e9366a47925207e0030d12df091d6e1cbc5edbf9 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 6 23:52:46 2010 +0000 Allow double defs after tail duplication. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92874 91177308-0d34-0410-b5e6-96231b3b80d8 commit aaf7d07332307f7c820f78f2a6ea877b99fa2d98 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 6 23:47:07 2010 +0000 Add Target hook to duplicate machine instructions. Some instructions refer to unique labels, and so cannot be trivially cloned with CloneMachineInstr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92873 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd8159b018f0d5ac327caefee632f2be39b3b8d1 Author: Jim Grosbach <grosbach@apple.com> Date: Wed Jan 6 23:45:18 2010 +0000 Addressing mode 6 (load/store) instructions can't encode an immediate offset for stack references. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92871 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7a3afef91f77182a51be83fa01730000bf358d9 Author: Jim Grosbach <grosbach@apple.com> Date: Wed Jan 6 22:21:25 2010 +0000 Anti-dependency breaking needs to be careful regarding instructions with multiple register definitions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92864 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1f156c4013526c48cb06ed664925b6a7084e9c05 Author: Eric Christopher <echristo@apple.com> Date: Wed Jan 6 20:04:44 2010 +0000 Move the object size intrinsic optimization to inst-combine and make it work for any integer size return type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92853 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0bf0c4cd67b385c7290306ae40562c2f84908e60 Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 6 19:43:21 2010 +0000 Comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92850 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8d5cbef24ef9b259a6d57d972bc98b1bda631540 Author: Evan Cheng <evan.cheng@apple.com> Date: Wed Jan 6 19:38:29 2010 +0000 Teach dag combine to fold the following transformation more aggressively: (OP (trunc x), (trunc y)) -> (trunc (OP x, y)) Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel. This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92849 91177308-0d34-0410-b5e6-96231b3b80d8 commit deeae7a6f0c289aaaac133ccd0d22ca0a4fddbe0 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Wed Jan 6 17:16:00 2010 +0000 Fix struct/class mismatch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92841 91177308-0d34-0410-b5e6-96231b3b80d8 commit eedb188d34d1a46dd69672f4c6415a373fab9118 Author: Victor Hernandez <vhernandez@apple.com> Date: Wed Jan 6 17:00:21 2010 +0000 When parsing function-local metadata, create a function-local MDNode git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92838 91177308-0d34-0410-b5e6-96231b3b80d8 commit a11e87a37e60a5a4c20b8ffc3de0b4675b2510cd Author: Jim Grosbach <grosbach@apple.com> Date: Wed Jan 6 16:48:02 2010 +0000 80 column and whitespace cleanup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92837 91177308-0d34-0410-b5e6-96231b3b80d8 commit 39e48e077790523cb83189dcc6880e043968b75c Author: Duncan Sands <baldrick@free.fr> Date: Wed Jan 6 15:37:47 2010 +0000 Fix a README item: have functionattrs look through selects and phi nodes when deciding which pointers point to local memory. I actually checked long ago how useful this is, and it isn't very: it hardly ever fires in the testsuite, but since Chris wants it here it is! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92836 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ba4ba754705f4a8261f5cc206b7550da264b82e Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Wed Jan 6 09:20:39 2010 +0000 Formatting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92831 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad48c6101e1a05463a319d633b5c792cdcefc8dd Author: Lang Hames <lhames@gmail.com> Date: Wed Jan 6 08:53:34 2010 +0000 Fixed malformed -*- lines in PBQP headers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92830 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4a124104bd575702d3cf747362f2f7aed4e24d5c Author: Duncan Sands <baldrick@free.fr> Date: Wed Jan 6 08:45:52 2010 +0000 Partially address a README by having functionattrs consider calls to memcpy, memset and other intrinsics that only access their arguments to be readnone if the intrinsic's arguments all point to local memory. This improves the testcase in the README to readonly, but it could in theory be made readnone, however this would involve more sophisticated analysis that looks through the memcpy. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8 commit 40520aaab0accf660fb90961ebb571ae4a53bc5b Author: Duncan Sands <baldrick@free.fr> Date: Wed Jan 6 05:49:26 2010 +0000 This is testing a darwin specific feature, so only turn it on for darwin (it fails on linux). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92826 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0e50c434a117c15a8fa1207c0d771a4d7c30149 Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 6 05:32:15 2010 +0000 tweaks suggested by Duncan git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92824 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5ad00c5540f2395f1f1f818fdc8472c94d4ec5b3 Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 6 02:21:00 2010 +0000 Reenable debug info on PPC. Works well enough to bootstrap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92818 91177308-0d34-0410-b5e6-96231b3b80d8 commit f1650604edab7e4dfa06acf9d3d443d10e55020b Author: Dale Johannesen <dalej@apple.com> Date: Wed Jan 6 02:20:18 2010 +0000 Make sure debug info hook gets called when emitting synonyms for PPC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92817 91177308-0d34-0410-b5e6-96231b3b80d8 commit c936035986b63efc9b4939a00f8c7b6c89a4ee7c Author: Chris Lattner <sabre@nondot.org> Date: Wed Jan 6 01:56:21 2010 +0000 Teach instcombine's sext elimination logic to be more aggressive. Previously, instcombine would only promote an expression tree to the larger type if doing so eliminated two casts. This is because a need to manually do the sign extend after the promoted expression tree with two shifts. Now, we keep track of whether the result of the computation is going to be properly sign extended already. If so, we can unconditionally promote the expression, which allows us to zap more sext's. This implements rdar://6598839 (aka gcc pr38751) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92815 91177308-0d34-0410-b5e6-96231b3b80d8 commit e3949409ec0f7daae0bb00b1de69c8e7d4aa6ef8 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Wed Jan 6 00:29:28 2010 +0000 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills. An instruction like this: %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0 Must be replaced with this when substituting physical registers: %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92812 91177308-0d34-0410-b5e6-96231b3b80d8 commit a92950a1d89495ff71eeb810afe8a97b91f5d26d Author: Bill Wendling <isanbard@gmail.com> Date: Wed Jan 6 00:23:35 2010 +0000 The previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92810 91177308-0d34-0410-b5e6-96231b3b80d8 commit 395df6e62a71cfe78544c48bb31428913130eb2a Author: Bill Wendling <isanbard@gmail.com> Date: Wed Jan 6 00:09:23 2010 +0000 Only check the ordering if there is an ordering for each nodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92807 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8a6edbd5f2a4ab57f4a7a1599bcdd6fc0656910a Author: Bill Wendling <isanbard@gmail.com> Date: Tue Jan 5 23:48:12 2010 +0000 Add a semi-primitive form of scheduling via the "SDNode ordering" to the bottom-up scheduler. We prefer the lower order number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92806 91177308-0d34-0410-b5e6-96231b3b80d8 commit e890c0582d64784ef5f46687633b771490d09e17 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 23:00:30 2010 +0000 simplify this code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92800 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2e69f124da5e693c022f26f386cf379aaa8ddbf0 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 22:52:54 2010 +0000 Move this test from test/Transforms/IndVarSimplify to test/CodeGen/X86, as doesn't use -indvars, and it does use llc -march=x86-64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92799 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5c782402abd47ff98c20462f0b4323ee21b3e961 Author: Bill Wendling <isanbard@gmail.com> Date: Tue Jan 5 22:39:10 2010 +0000 Don't assign the shift the same type as the variable being shifted. This could result in illegal types for the SHL operator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92797 91177308-0d34-0410-b5e6-96231b3b80d8 commit 577421fcce5123c07142cf8b566f5018104ed7b8 Author: Johnny Chen <johnny.chen@apple.com> Date: Tue Jan 5 22:37:28 2010 +0000 Undo r92785, it caused test failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92796 91177308-0d34-0410-b5e6-96231b3b80d8 commit c7812806be7e9d35a22891f10db8c0141fc1913b Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 22:30:42 2010 +0000 make this a static function instead of a method. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92795 91177308-0d34-0410-b5e6-96231b3b80d8 commit f76867ade835085ac472ee8c2f1bd642f241bc85 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 22:26:32 2010 +0000 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen uses several kinds of opcode values which are not declared within that enum. This fixes PR5946. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92794 91177308-0d34-0410-b5e6-96231b3b80d8 commit e1caa0958db19c416203c167b9dc71c9ef518200 Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 5 22:22:14 2010 +0000 Re-add parsing of function-local metadata; this time with testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92793 91177308-0d34-0410-b5e6-96231b3b80d8 commit 45056b1b3b40428cdd2bc868b3e22b08ed7661da Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 22:21:18 2010 +0000 more rearrangement and cleanup, fix my test failure. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92792 91177308-0d34-0410-b5e6-96231b3b80d8 commit 71713e4d7e08616092cf0c5b5c125cd007137b39 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 22:07:33 2010 +0000 cleanup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92790 91177308-0d34-0410-b5e6-96231b3b80d8 commit 22c5d59dbbc02e05a9820f8e47677dccae7bc3e9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 22:01:41 2010 +0000 remove two trunc xforms that are subsumed by EvaluateInDifferentType. The only difference is that EvaluateInDifferentType checks to ensure they are profitable before doing them :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92788 91177308-0d34-0410-b5e6-96231b3b80d8 commit f907f09e3beff5f5cdbf73f03f1176b10a192ade Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:54:09 2010 +0000 merge some tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92786 91177308-0d34-0410-b5e6-96231b3b80d8 commit ca9de8db30b09ed84437d208bcce979a4ca54e28 Author: Johnny Chen <johnny.chen@apple.com> Date: Tue Jan 5 21:51:46 2010 +0000 Add Rt2 to the asm format string for 32-bit Thumb load/store register dual instructions. Thumb does not have the restriction that t2 = t+1. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92785 91177308-0d34-0410-b5e6-96231b3b80d8 commit 76efae2ec697bdfda9a990d8dcf7f4274618e2be Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:48:13 2010 +0000 merge cast2 into cast.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92784 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3e2aa9c6d05ae92967563d4f5ee67b820e49d679 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 21:47:32 2010 +0000 Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null} git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92783 91177308-0d34-0410-b5e6-96231b3b80d8 commit eb6543085aa2fd762d8b4f3d7e1e99b5f6076af9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:46:22 2010 +0000 remove useless test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92782 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ec43a964e0ede67b993f0d57d5bfb7e074e20c7 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:43:08 2010 +0000 another example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92781 91177308-0d34-0410-b5e6-96231b3b80d8 commit 97b05e1f2cdeb9cefbc7a384f84386929110307d Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Tue Jan 5 21:38:37 2010 +0000 Don't specify CR sub-registers as implicit defs of BL instructions. It is enough to give the super registers CR0, CR1, ..., and specifying the sub-registers as well causes confusion in the liveness computations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92778 91177308-0d34-0410-b5e6-96231b3b80d8 commit a861e464d1b2bc60b4af7e816c39c4caa71a38da Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:37:44 2010 +0000 remove a useless negative test, add a rdar # to an xfail that I'm working on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92777 91177308-0d34-0410-b5e6-96231b3b80d8 commit 51d53cad7db9e399c42021ee089a80e0a03ca846 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:32:59 2010 +0000 clean up tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92776 91177308-0d34-0410-b5e6-96231b3b80d8 commit cb055724810e5b4d84c0505ba305a5aecfb93513 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:16:30 2010 +0000 just remove this xform which is subsumed by others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92775 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5b1ab26cbc910289f76aa19ec6a510e4e6dab8cd Author: Victor Hernandez <vhernandez@apple.com> Date: Tue Jan 5 21:13:46 2010 +0000 Fix comment for CheckDebugInfoIntrinsics git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92774 91177308-0d34-0410-b5e6-96231b3b80d8 commit 606a958f8d5d8e3417b6b4f8e14c4c55e90d1a42 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:11:17 2010 +0000 move a trunc-specific transform out of commonIntCastTransforms into visitTrunc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92773 91177308-0d34-0410-b5e6-96231b3b80d8 commit 93ec5843d1fc59fa69c7e3161a7b06634a6cf78c Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 21:08:02 2010 +0000 Restore dump() methods to Loop and MachineLoop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92772 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad813fb581b9cff83a73b9880dcbd76979caf0d4 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 5 21:05:54 2010 +0000 Move remaining stuff to the isInteger predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8 commit 63da1cba0e6d07487bab072e7ee77908f6de5c5b Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 21:04:47 2010 +0000 move a zext specific xform out of commonIntCastTransforms into visitZExt and modernize it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92770 91177308-0d34-0410-b5e6-96231b3b80d8 commit f6a0623e233f3816bb29e604afa10eb584d6cda3 Author: Jakob Stoklund Olesen <stoklund@2pi.dk> Date: Tue Jan 5 20:59:36 2010 +0000 Remove livein checks from machine code verifier. A phi operand that is implicitly defined in a predecessor becomes an undefined register after phi elimination. This causes a lot of false positives when the verifier is checking if live-in registers are live-out from all predecessors. Removing the verifier checks seems like a better solution than insisting on IMPLICIT_DEF instructions in predecessor blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92769 91177308-0d34-0410-b5e6-96231b3b80d8 commit b422edb4b823f29dd8858b7f737da4a06fda5696 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 20:57:30 2010 +0000 move a trunc-specific xform out of commonIntCastTransforms into visitTrunc git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92768 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16d493af3fff031e1a79708744aa7379b1373b61 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 20:56:24 2010 +0000 reduce indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92766 91177308-0d34-0410-b5e6-96231b3b80d8 commit 479ee3c9e53cb0c4ace0963cf7541c5a85c58f3f Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Tue Jan 5 20:45:43 2010 +0000 Regenerate git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92763 91177308-0d34-0410-b5e6-96231b3b80d8 commit 59dfe2ddb5972ceff4ead29fa4a9e489b3e1f01d Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Tue Jan 5 20:45:13 2010 +0000 Proper deduce z/System LLVM target from target triple when --enable-targets=host is specified. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92762 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6aa6bf8f7f435c02ff239cd88e1c2f95b19b9708 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 20:41:31 2010 +0000 NamedMDNode is a collection MDNodes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92761 91177308-0d34-0410-b5e6-96231b3b80d8 commit ee780ee28aeb83c8fb2138865ff5f9cf824d43d0 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 5 20:07:06 2010 +0000 Convert a ton of simple integer type equality tests to the new predicate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92760 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2b915ae131104fa253c8e31aa4bb675f267deed3 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 5 20:04:48 2010 +0000 Add a new predicate for integer type equality tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92759 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c7426eee32d132c4a02177f159ac66ea9a0f331 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 19:11:42 2010 +0000 Add an !eq() operator to TableGen. It operates on strings only. Use !cast<string>() to compare other types of objects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92754 91177308-0d34-0410-b5e6-96231b3b80d8 commit 29773ea81f20037e51adf9e56bd24cb274047534 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 18:24:00 2010 +0000 Add an entry on SmallBitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92747 91177308-0d34-0410-b5e6-96231b3b80d8 commit eb9dcdd909be81b7e6e7a609e23c9009316a1353 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 18:09:56 2010 +0000 optimize comparisons against cttz/ctlz/ctpop, patch by Alastair Lynn! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92745 91177308-0d34-0410-b5e6-96231b3b80d8 commit c8ddc0968cd2bba6da3ef3138036e036d84217cd Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 17:55:26 2010 +0000 Delete useless trailing semicolons. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92740 91177308-0d34-0410-b5e6-96231b3b80d8 commit 28bdf411d6ec32297ce6739980ef866a52530312 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 17:50:58 2010 +0000 Nick Lewycky pointed out that this code makes changes unconditionally. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92739 91177308-0d34-0410-b5e6-96231b3b80d8 commit b9640cd0439ef4ba5c00ea37abe90703e0acf842 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 17:47:41 2010 +0000 Have TableGen emit code that uses dbgs() rather than errs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92738 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3a3811590dfe3fd6170d52f93058069df8e2caa3 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 16:59:17 2010 +0000 If a scope has only one instruction then first instruction is also the last instruction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92736 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6fbfa9687086a4012cede8a5a2783359368a3098 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 16:31:45 2010 +0000 Set Changed properly after calling DeleteDeadPHIs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92735 91177308-0d34-0410-b5e6-96231b3b80d8 commit f67674f4d2952ba521a50341d53f7c3eadd1e43b Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 16:27:25 2010 +0000 Use do+while instead of while for loops which obviously have a non-zero trip count. Use SmallVector's pop_back_val(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92734 91177308-0d34-0410-b5e6-96231b3b80d8 commit e287750464c4fd8cec6c4f69b1a6e92579e4300b Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 16:20:55 2010 +0000 Fix indentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92733 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1457eefb50e703a2714db72d294650b972e5aaae Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 15:45:31 2010 +0000 Make RecursivelyDeleteTriviallyDeadInstructions, RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag indicating whether they made any changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92732 91177308-0d34-0410-b5e6-96231b3b80d8 commit c5827eb7c9743b407e423ecebe7e0d5600e835d9 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 15:28:21 2010 +0000 Some versions of GCC don't like non-static data members in sizeof in this context. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92731 91177308-0d34-0410-b5e6-96231b3b80d8 commit b564a5e38a3d697a2dcdc0fd3c67b5fee589eee5 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 15:04:49 2010 +0000 Add a SmallBitVector class, which mimics BitVector but uses only a single pointer (PointerIntPair) member. In "small" mode, the pointer field is reinterpreted as a set of bits. In "large" mode, the pointer points to a heap-allocated object. Also, give BitVector empty and swap functions. And, add some simple unittests for BitVector and SmallBitVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92730 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7dc6d30881a65dc537c0c3a5c1c005e1449c2133 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 5 13:32:48 2010 +0000 Add newline at EOF. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92727 91177308-0d34-0410-b5e6-96231b3b80d8 commit 858baacd9c8cfae680149e4d72dab591a5fd637c Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Jan 5 13:12:22 2010 +0000 Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7e464881096a6ef718ee688d080abd7e701371b0 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:54:43 2010 +0000 prune some #includes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92712 91177308-0d34-0410-b5e6-96231b3b80d8 commit bb72cf3929ba8042b0b230763cee02cdd0c88288 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:50:36 2010 +0000 split and/or/xor out into one overly-large (2000LOC) file. However, I think it does make sense to keep them together, at least for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92711 91177308-0d34-0410-b5e6-96231b3b80d8 commit ae482825f6ac21f924a210234a2e4b6c6a4fa82d Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:45:02 2010 +0000 missed file with previous commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92710 91177308-0d34-0410-b5e6-96231b3b80d8 commit d351cbf681772a64c07daeec87855c801bf9d74d Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:44:46 2010 +0000 split instcombine of shifts out to its own file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92709 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1af5dfe4f0862350ab2a35a629d5b63fac6576a6 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:42:10 2010 +0000 eliminate getBitCastOperand and simplify some over-complex inbounds stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92708 91177308-0d34-0410-b5e6-96231b3b80d8 commit d2297ce9d1815478d31dac279a7ad3a669f5d7ba Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:32:13 2010 +0000 split call handling out to InstCombineCalls.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92707 91177308-0d34-0410-b5e6-96231b3b80d8 commit d5d0e61248bfc0b9cfb4983065e565c210b07791 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:23:56 2010 +0000 optimize cttz and ctlz when we can prove something about the leading/trailing bits. Patch by Alastair Lynn! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92706 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5d84c24f92b885713398c90b2dcee259f25403f5 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:20:54 2010 +0000 this inline function moved to addsub git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92705 91177308-0d34-0410-b5e6-96231b3b80d8 commit d703eac299f29f6268be2618668e57901083542a Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:18:46 2010 +0000 split add/sub out to its own file. Eliminate use of dyn_castNotVal in the X+~X transform. dyn_castNotVal is dramatic overkill for what the xform needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92704 91177308-0d34-0410-b5e6-96231b3b80d8 commit 42fae658f2d2901ec44ce0517ce3daf5d71b0895 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:04:23 2010 +0000 all the places we use hasOneUse() we know are instructions, so inline and simplify. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92700 91177308-0d34-0410-b5e6-96231b3b80d8 commit 814855971448ccc6e772c0303d6f042a0cda674e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 07:01:16 2010 +0000 eliminate AssociativeOpt and its last uses. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92697 91177308-0d34-0410-b5e6-96231b3b80d8 commit b93a1fd7e5455a00306a7a09fc46c669dd7021d9 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:59:49 2010 +0000 inline the FoldICmpLogical functor. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92695 91177308-0d34-0410-b5e6-96231b3b80d8 commit 026ba2cf2249ae64bebe4eaab7d5aef1403d010a Author: Evan Cheng <evan.cheng@apple.com> Date: Tue Jan 5 06:52:31 2010 +0000 Code refactoring. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92694 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7ba5f27addb99d481ae5f685d05ffb42cb211871 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:29:13 2010 +0000 inline the 'AddRHS' transformation, simplifying things significantly. Eliminate the 'AddMaskingAnd' transformation, it is redundant with this more general code right below it: // A+B --> A|B iff A and B have no bits set in common. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92693 91177308-0d34-0410-b5e6-96231b3b80d8 commit 96a816542b98c6dd14b4667aab400745a7b0d5a7 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:24:06 2010 +0000 remove massive over-genality manifested as a big template that got instantiated. There is no reason for instcombine to try this hard for simple associative optimizations. Next up, eliminate the template completely. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92692 91177308-0d34-0410-b5e6-96231b3b80d8 commit a2b8ec3e8c5a05a4bd69a22927c489089c21b421 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:09:35 2010 +0000 split mul/div/rem instructions out to their own file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92689 91177308-0d34-0410-b5e6-96231b3b80d8 commit eae8d32eaa2fb3119af67221c7bafd3bb8d5857d Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:05:07 2010 +0000 clean up header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92688 91177308-0d34-0410-b5e6-96231b3b80d8 commit 79604e01bb64b3bee0d1d0351840057de0617702 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 06:03:12 2010 +0000 split select out to its own file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92687 91177308-0d34-0410-b5e6-96231b3b80d8 commit c025853866d3e56dc2f627a6dda97a9333575256 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 05:57:49 2010 +0000 split out load/store/alloca. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92685 91177308-0d34-0410-b5e6-96231b3b80d8 commit f61c5394db9842cefb9e44f9f9fda7c19e698a2e Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 05:42:08 2010 +0000 reduce indentation git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92684 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0dad9c196c6bae7a062746c7868a2b75e297f4d8 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 05:36:20 2010 +0000 split vector stuff out to InstCombineVectorOps.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92683 91177308-0d34-0410-b5e6-96231b3b80d8 commit 05b3d10412bbe139175225e2cf949e34c80fe2a4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 05:31:55 2010 +0000 split PHI node stuff out to InstCombinePHI.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92682 91177308-0d34-0410-b5e6-96231b3b80d8 commit 766096ee360c85c4fcc6b3b98d2086a661c9c5ea Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 05:21:26 2010 +0000 convert various IntrinsicInst's to use class instead of struct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92681 91177308-0d34-0410-b5e6-96231b3b80d8 commit a0a35fed9af18017f2961af9428a1547298db3c4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Jan 5 04:55:35 2010 +0000 fix an infinite loop in reassociate building emacs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92679 91177308-0d34-0410-b5e6-96231b3b80d8 commit 41698a6dfd9977a8ed968c2bc89d8250ea4d9328 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:55:22 2010 +0000 Change this back to errs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92674 91177308-0d34-0410-b5e6-96231b3b80d8 commit 99c71a3dee39e19a3edbd470803924eeb3f9add4 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:53:59 2010 +0000 These should probably be errs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92673 91177308-0d34-0410-b5e6-96231b3b80d8 commit 43c60b5c700d72299f9d1885fa1a6b1920027ae0 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 01:47:06 2010 +0000 Delete renaming use of dead dbg intrinsics. Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92672 91177308-0d34-0410-b5e6-96231b3b80d8 commit 531076d281fa2d7f6f21af87a04250d3e8ba913d Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 01:46:14 2010 +0000 Use StringRef.startswith(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92671 91177308-0d34-0410-b5e6-96231b3b80d8 commit f851739c54a45d6643904d97c5100325bb85d3d0 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:36:30 2010 +0000 Fix a build error by adding a missing commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92670 91177308-0d34-0410-b5e6-96231b3b80d8 commit 95303c43a6cb6fc0aebea1dbd6e86c0382cb7e92 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:34:26 2010 +0000 Fix a build error and change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92669 91177308-0d34-0410-b5e6-96231b3b80d8 commit ff668bd0afa5c8aaf510fc78048e80d7b378ab26 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 01:31:15 2010 +0000 Remove an unneeded svn:ignore property. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92668 91177308-0d34-0410-b5e6-96231b3b80d8 commit d48b9d36ce2411d9fb784811fa3479b434ec528a Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:32 2010 +0000 Enable debug buffering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92667 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6f48e8a93bed1a5d72096a27d7dc1561b47c3205 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:21 2010 +0000 Enable debug buffering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92666 91177308-0d34-0410-b5e6-96231b3b80d8 commit 215fdbe5e0022bbfcafad1db0a2e1e5e039279f7 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:18 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92665 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6da905440f801558cb0d8c02b8006e09557c3c07 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:14 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92664 91177308-0d34-0410-b5e6-96231b3b80d8 commit 382d2a453480a0e7f6538e11b2d50c69e1a6e8f1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:09 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92663 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0529d6db651b0a96d48cca38021e7bfaf5b2a43 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:06 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92662 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9b306fece97e14dcdc4de5aea270666b25435532 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:04 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92661 91177308-0d34-0410-b5e6-96231b3b80d8 commit 529ac770e9009a1d9de97a61ff8d07822c121587 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:02 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92660 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0a29a72319f76ef7ed6a4f14a5bce833f077dc3 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:30:00 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92659 91177308-0d34-0410-b5e6-96231b3b80d8 commit faaddb09209ce9bb8f1a658f9cbb5f0d17e57e43 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:58 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92658 91177308-0d34-0410-b5e6-96231b3b80d8 commit f67089ae87e5f4296c88caa9bb019d26190efd2c Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:55 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92657 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6cce0b1be6f65dc8f24824de8eb148aa405e76b6 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:39 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92656 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4b37d570f100622830b7241a5eb243b9fff46184 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:36 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92655 91177308-0d34-0410-b5e6-96231b3b80d8 commit 15337a687640c9c72d8432c2afdb97cc39d26d24 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:34 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92654 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7c671aefc167ae8dbe46837005688c6c81327948 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:29 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92653 91177308-0d34-0410-b5e6-96231b3b80d8 commit 67301b17b8350759c64aa5547fbe83f1baa60f6e Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:26 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92652 91177308-0d34-0410-b5e6-96231b3b80d8 commit 852dc4d82b4582ed260b39d67f6572796c080c0b Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:23 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92651 91177308-0d34-0410-b5e6-96231b3b80d8 commit 835365cac97924398689e0d69a671ac7b418c055 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:19 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92650 91177308-0d34-0410-b5e6-96231b3b80d8 commit 56882e97c4e97a6e86d7d2a0d80d58777f87ab47 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:14 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92649 91177308-0d34-0410-b5e6-96231b3b80d8 commit 73c006972f9bc3832d232f61959b743a189121b4 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:13 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92648 91177308-0d34-0410-b5e6-96231b3b80d8 commit f1d5c5991760fc2994c124126fa74ab392c6d97a Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:08 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92647 91177308-0d34-0410-b5e6-96231b3b80d8 commit 59b924335b7c0b1c5b17d981b4bf3148be8dd628 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:29:03 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92646 91177308-0d34-0410-b5e6-96231b3b80d8 commit 52363b09d7378733ef5bd5590b756726800dbf4a Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:58 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92645 91177308-0d34-0410-b5e6-96231b3b80d8 commit f5bedcbea0e754ae0ba67a59b53e27b8dbfdd331 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:53 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92644 91177308-0d34-0410-b5e6-96231b3b80d8 commit 59a30016da3daa3f4695b20ab00488e7a9ae072d Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:52 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92643 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3efbfee970d7c1c6d2560c9b4be9c9de67b788a0 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:47 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92642 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ce5f8e7404a61aad3ac1bc59a56fb2a60ba5cbf Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:43 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92641 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8a83d59f3668d34acac46c08cc033307ab4618c5 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:40 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92640 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7ecd022a2e67c3c1794e8fe4ebc8f25c7d7f8da9 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:37 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92639 91177308-0d34-0410-b5e6-96231b3b80d8 commit bd26a7de77554c3e38d88661013a77efc635ed32 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:32 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92638 91177308-0d34-0410-b5e6-96231b3b80d8 commit 22c7c1119b22f529ef2b985877face5791b88829 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:29 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92637 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7d144c6fab0a60928503264f3baf4d17cfbdaa1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:29 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92636 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2583a55dd3aebdacbbfd99603c13996b4cd3d8d0 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:22 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92635 91177308-0d34-0410-b5e6-96231b3b80d8 commit 60bd5f7897b0d386d71a73844fd3883839821c5a Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:17 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92634 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4185b0fe17814035e6e28c5c0e93b182d23c9125 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:12 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92633 91177308-0d34-0410-b5e6-96231b3b80d8 commit f9a9a0690f376b5dfaecea0d6349cb59dd29c033 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:10 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92632 91177308-0d34-0410-b5e6-96231b3b80d8 commit adea762453eb41624f37e151d284fc20d3ea721c Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:07 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92631 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0ceab92772248e28c3964b7c9245b679c72b23ae Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:07 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92630 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9c9ab7a78ba28729d7c8098927c0bb7c8cc7fcd0 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:28:05 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92629 91177308-0d34-0410-b5e6-96231b3b80d8 commit 61317a6a3789541b9dcd6341916ff31d51cc738f Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:59 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92628 91177308-0d34-0410-b5e6-96231b3b80d8 commit a088f76653c57e8157e6743ae486485dc63a47a9 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:54 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92627 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4d91eb1ee673dc2eb83a82525475b2083efd81be Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:53 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92626 91177308-0d34-0410-b5e6-96231b3b80d8 commit d1bc08c7f8e3a9959c33ff114ec3ad30af55b0d5 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:51 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92625 91177308-0d34-0410-b5e6-96231b3b80d8 commit 64f3b3b649fefc065b7714c977d4360d459a4766 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:47 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92624 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0afa05d4487081749fd2f4a4ff2e16300a52d535 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:44 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92623 91177308-0d34-0410-b5e6-96231b3b80d8 commit 79aa2ea6f0e98b1d6c832eaf0f44abbb23c116d5 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:39 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92622 91177308-0d34-0410-b5e6-96231b3b80d8 commit ba58be830bb1c1b429cf85d401d8b92e66dc1329 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:39 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92621 91177308-0d34-0410-b5e6-96231b3b80d8 commit f25948108fbaecb985ab3a2fbbf7d9fa1916338e Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:33 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92620 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8892465cc5cfe8e6f279de9d6246430953e5d21a Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:30 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92619 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0011785b1d262783eda1dcdabac5a3581dc7c0f9 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:26 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92618 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9196a5558243d71d7ed72a838774896b43deff08 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:24 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92617 91177308-0d34-0410-b5e6-96231b3b80d8 commit 35d99dcce0486fca2656a5d8eaa1cf5cc923c530 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:23 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92616 91177308-0d34-0410-b5e6-96231b3b80d8 commit fd461df87ab202fcd702744b79511eaeaf66448b Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:21 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92615 91177308-0d34-0410-b5e6-96231b3b80d8 commit fac2751e262b8306477c6917daeb9ac789e49502 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:19 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92614 91177308-0d34-0410-b5e6-96231b3b80d8 commit 79a83e8d8a7d451171e547edf4a0db10bbaf5cf0 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:17 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92613 91177308-0d34-0410-b5e6-96231b3b80d8 commit bc227c754c5faa7c071e58f0d698e73eef797b28 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:15 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92612 91177308-0d34-0410-b5e6-96231b3b80d8 commit d21e9eeed93ebc545767c0376a7f1a175b4f4672 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:11 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92611 91177308-0d34-0410-b5e6-96231b3b80d8 commit d3c9cb59fdf2754f6ff8000d7a5e36c527c504a9 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:09 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92610 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c4e1a2a7ace4fee36c8ba69f4151b95a6548944 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:06 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92609 91177308-0d34-0410-b5e6-96231b3b80d8 commit dd7f741e59d004e03a265b2d7c8f712a62448c37 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:04 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92608 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3c7a47197bede65dccfa27ffa814326aba414d3 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:27:01 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92607 91177308-0d34-0410-b5e6-96231b3b80d8 commit c634876cea513c5a275b638287a51025be46a067 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:57 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92606 91177308-0d34-0410-b5e6-96231b3b80d8 commit e76939b714e55cb85990bcbc6b116374f41404fa Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:54 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92605 91177308-0d34-0410-b5e6-96231b3b80d8 commit 068c60489d7c516ea14920e63d19668c931868af Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:52 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92604 91177308-0d34-0410-b5e6-96231b3b80d8 commit 57ed64508e31f5cbe84a9cf9d647bcf2a1b3c3d7 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:49 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92603 91177308-0d34-0410-b5e6-96231b3b80d8 commit a37114727346745e667dc003990e9afbd3747f88 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:45 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92602 91177308-0d34-0410-b5e6-96231b3b80d8 commit d91e136d7029b08fda45b8787f5072a8a1299f47 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:44 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92601 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7564d1640d9e6392eea3411c4225d223754abe2e Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:41 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92600 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0da7f3da989122349e5f88adec40a0f6fa289886 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:39 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92599 91177308-0d34-0410-b5e6-96231b3b80d8 commit c2bbf04af3985f22c4c3a125c92944bc16c4f648 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 01:26:36 2010 +0000 Add an svn:ignore. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92598 91177308-0d34-0410-b5e6-96231b3b80d8 commit a3dd58c22213899ccb75a7c2ca8aa231862c07f9 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:11 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92597 91177308-0d34-0410-b5e6-96231b3b80d8 commit 776d497ebe1a2f564e6347c9868068da15268760 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:09 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92596 91177308-0d34-0410-b5e6-96231b3b80d8 commit b47bdc31a4d95334741afd2f641e1689ebbc6b77 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:05 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92595 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c5fe44145e826545583d327163bb85117b8fab1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:01 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92594 91177308-0d34-0410-b5e6-96231b3b80d8 commit b4470f146b54d320ec487817e4d5b5db462360ee Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:26:00 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92593 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4629465b6f1e87f2def1f26daafef9920a32c2c2 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:58 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92592 91177308-0d34-0410-b5e6-96231b3b80d8 commit 16fbd3d7b8f99053d375b33f3b59f6d0e0a62fef Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:55 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92591 91177308-0d34-0410-b5e6-96231b3b80d8 commit 63a27d7d439ca535de3bae6c706bb7504fe98b3b Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:52 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92590 91177308-0d34-0410-b5e6-96231b3b80d8 commit e745659a1bda8c67da88fe675dc04a8e27f1925d Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:50 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92589 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2d52f4500b8ff94b69c24667aab93162158443de Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:47 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92588 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3d85752a7d4c66ac62cf4f2ba094020ee70935bf Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:45 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92587 91177308-0d34-0410-b5e6-96231b3b80d8 commit aa4099eb1bf8ab16ba4a8036afd6f161e04ff9d1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:43 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92586 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6b268b9ca85f035ffabe5dc1ccbe38bba1a29148 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:41 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92585 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4cddd05371227ebd98311b3f3c0f626023d38aab Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:39 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92584 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5a0d2ab26242c7480217a853afed4028373dc137 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:20 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92583 91177308-0d34-0410-b5e6-96231b3b80d8 commit cea20bca449b5ea4a839ea4130fd121c300b9c92 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:15 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92582 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3f2c44e41b585b295ffdbd6d3a2d9e00b62775fc Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:11 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92581 91177308-0d34-0410-b5e6-96231b3b80d8 commit e3a4bf8ebe6d1dd90bb691a8d264bc202d662aa1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:09 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92580 91177308-0d34-0410-b5e6-96231b3b80d8 commit c104cbb8edc6b851833b551ab17602ac71eebe49 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:04 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92579 91177308-0d34-0410-b5e6-96231b3b80d8 commit fc886fd09a37b8afd503786f00f935a78f5913c8 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:25:00 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92578 91177308-0d34-0410-b5e6-96231b3b80d8 commit f622a561bec3cb20e445fd37689a92ecc2408e09 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:57 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92577 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1c5590fb1ca3540b9ed2e5017810ac51a6c893c6 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:54 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92576 91177308-0d34-0410-b5e6-96231b3b80d8 commit a2af6867e420ba87dc4dd29b01e69afab59bfd3c Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:53 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92575 91177308-0d34-0410-b5e6-96231b3b80d8 commit 943eb7e561156c187c8a8456aa5e0d08e20b8980 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:50 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92574 91177308-0d34-0410-b5e6-96231b3b80d8 commit b0d039ffd114fa91fd4df22cd42842370e03cb59 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:48 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92573 91177308-0d34-0410-b5e6-96231b3b80d8 commit bd5f499efa60f305850c1bad00b20404ca628aca Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:45 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92572 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3cfe335798a9942af1afab2dcda69cbebfde8994 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:43 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92571 91177308-0d34-0410-b5e6-96231b3b80d8 commit da0fe032fe1e3834cadb2731abf2c1065dd460d1 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:40 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92570 91177308-0d34-0410-b5e6-96231b3b80d8 commit 34f085e22d9996fffa66ee1caed4371e86795d49 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:36 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92569 91177308-0d34-0410-b5e6-96231b3b80d8 commit ac5c2b30d15893827c95c56698990b66e888edf6 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:34 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92568 91177308-0d34-0410-b5e6-96231b3b80d8 commit dc4e392f43d93118dc0d90b38eb533fced2e714d Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:28 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92567 91177308-0d34-0410-b5e6-96231b3b80d8 commit 95ce44444ab8457d0717ecc97cbc0e785f02094e Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:24 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92566 91177308-0d34-0410-b5e6-96231b3b80d8 commit a10627702f4fc7e0e503a8fbc23014da18fd91d8 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:21 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92565 91177308-0d34-0410-b5e6-96231b3b80d8 commit 39d140d93435c1d47305d0b1c3b8db7b222b6222 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 01:24:18 2010 +0000 Change SelectCode's argument from SDValue to SDNode *, to make it more clear what information these functions are actually using. This is also a micro-optimization, as passing a SDNode * around is simpler than passing a { SDNode *, int } by value or reference. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92564 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0596ab962e731ae23fa4c76b8597383ef6c55a01 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:24:08 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92563 91177308-0d34-0410-b5e6-96231b3b80d8 commit cc82e7278d2eff71b8a47a5b7c8db31ee12b02b5 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:23:38 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92562 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6c9fef71bd4164efec7f46046395b3395c8b3575 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:23:36 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92561 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4714553b53a495261b0ba92705b180368e141129 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 01:23:34 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92560 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6aa30a282356389719971dbc7cdef10b8d2896e3 Author: Devang Patel <dpatel@apple.com> Date: Tue Jan 5 01:10:40 2010 +0000 Remove dead debug info intrinsics. Intrinsic::dbg_stoppoint Intrinsic::dbg_region_start Intrinsic::dbg_region_end Intrinsic::dbg_func_start AutoUpgrade simply ignores these intrinsics now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92557 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9ac796828741a1b2c3e88fc075184a9db2bce949 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 00:44:20 2010 +0000 Remove the SDNPAssociative properties for the flags-producing operators. Eli pointed out that it's not obvious what that would mean. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92555 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7f4c5fc8893cd5ec147dcfaecaf617800ee863d Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 00:42:54 2010 +0000 Simplify this code; avoid duplicating the low-level implementation code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92554 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7b35a5f21112194c360dacc622e24916eb38844 Author: Dan Gohman <gohman@apple.com> Date: Tue Jan 5 00:30:22 2010 +0000 Fix a typo in a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92552 91177308-0d34-0410-b5e6-96231b3b80d8 commit f28809f180f22eb4192453cc4e0424f8cd41107d Author: Daniel Dunbar <daniel@zuster.org> Date: Tue Jan 5 00:15:58 2010 +0000 Fix some struct/class specifier mismatches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92550 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3af787f06e5e1666cb524108809b64a51519e821 Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 00:10:05 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92548 91177308-0d34-0410-b5e6-96231b3b80d8 commit b46fdc9d84af01acad41e371d1877bf45b1bdcdd Author: David Greene <greened@obbligato.org> Date: Tue Jan 5 00:03:48 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92547 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7740668041ab6fd7315ca049a0d967ee3c264dc8 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:48:20 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92545 91177308-0d34-0410-b5e6-96231b3b80d8 commit bd6aa515da7f9404f1fcc0c07b5c8ebd922639d2 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:39:17 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92544 91177308-0d34-0410-b5e6-96231b3b80d8 commit 64fcd6ae4e3e5838f8954d5853031f96fbeb2565 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:22:07 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92542 91177308-0d34-0410-b5e6-96231b3b80d8 commit 186652ea7b671784c6987b4eb0a2f4e663f40fb9 Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Jan 4 23:17:24 2010 +0000 Update CMake LibDeps git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92540 91177308-0d34-0410-b5e6-96231b3b80d8 commit 935e55d50f4cab2e2ca15efc9951a2fb2bb04bc0 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:14:46 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92539 91177308-0d34-0410-b5e6-96231b3b80d8 commit 58efec0df55ebc1ad60eb51aba2b2583cf3e55c8 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:06:47 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92535 91177308-0d34-0410-b5e6-96231b3b80d8 commit 76a36035fa6480cc945fea7b020758102ec05149 Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 4 23:04:36 2010 +0000 Fix debug_inlined section entries for routines whose names are changed through __asm() extension. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92533 91177308-0d34-0410-b5e6-96231b3b80d8 commit 84aab429d79955e5c13dfeaa210c7aaccaba44eb Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 23:02:10 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92532 91177308-0d34-0410-b5e6-96231b3b80d8 commit 652c5971b72c00ec4e753b1bdb56f80a95a8bbf5 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 22:49:02 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92529 91177308-0d34-0410-b5e6-96231b3b80d8 commit 70a291d70d6285c6f0392e9a94c5c89e3f89db20 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 22:41:43 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92528 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0bf334e685123790b89f8bd1d4628a98d1a63b7 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 22:33:16 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92524 91177308-0d34-0410-b5e6-96231b3b80d8 commit 55fa754fbdb50727509d61d3ef0ea39755eb40ca Author: Daniel Dunbar <daniel@zuster.org> Date: Mon Jan 4 22:03:51 2010 +0000 tblgen/OptParser: Use EmitSourceFileHeader. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92521 91177308-0d34-0410-b5e6-96231b3b80d8 commit c3d201c40d3cfd5f7c47db544d0163549b97cd73 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 22:02:01 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92520 91177308-0d34-0410-b5e6-96231b3b80d8 commit f398207f3eafa89375414ee8494a366040131cf9 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Mon Jan 4 21:58:55 2010 +0000 Fix CMake build for InstCombine changes git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92519 91177308-0d34-0410-b5e6-96231b3b80d8 commit 43d49789c42281da24317ac5fe35aa570a787ec0 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 21:48:34 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92518 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2c9becc2902dbbd23607546ffa8c3cfd10c7182e Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 21:35:15 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92516 91177308-0d34-0410-b5e6-96231b3b80d8 commit c7948031039206fc69c92a63459b2937ec6918b4 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 21:26:07 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92515 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7908cbcbfbc70072231d2a4d3634455f4c3765a0 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 21:23:34 2010 +0000 Make this test more portable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92514 91177308-0d34-0410-b5e6-96231b3b80d8 commit f94a1da1ad4ccfab06440a63d4af16e2368da537 Author: Evan Cheng <evan.cheng@apple.com> Date: Mon Jan 4 21:22:48 2010 +0000 Perform this folding as a target specific dag combine: (or (x << c) | (y >> (64 - c))) ==> (shld64 x, y, c) The isel patterns may not catch all the cases if general dag combine has reduced width of source operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92513 91177308-0d34-0410-b5e6-96231b3b80d8 commit ca20adc5b0ede83ed94670f38cab04ed314266dd Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 21:00:54 2010 +0000 Use a pointer type rather than MVT::Other for the ExternalSymbol node used in an inline asm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92512 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2ded4e05a5295cb0f30fc9706bb9ed5c96b60bb8 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:55:05 2010 +0000 Remove some README.txt entries which are now implemented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92511 91177308-0d34-0410-b5e6-96231b3b80d8 commit 211f193cef4d20bfdda069634ca015a9c16570a4 Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 4 20:54:06 2010 +0000 Remove oversimplified test case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92510 91177308-0d34-0410-b5e6-96231b3b80d8 commit 78591841b67f381ad822f76c4d5ce99891688d22 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:53:54 2010 +0000 Add some tests and update an existing test to reflect recent x86 isel peeps. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92509 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7e8173fa6f122ddc2680eb974f6618dfae1f3973 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:52:50 2010 +0000 A use by operand 1 or 2 of a SELECT is not a FLAGS use. This lets the test-elimination work in more conditional-move cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92508 91177308-0d34-0410-b5e6-96231b3b80d8 commit cfbbad61bac01130af80d78538d3753207debb29 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:51:50 2010 +0000 Flags-producing add, and, or, etc. have the same profibility rules as normal add, and, or, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92507 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2a3828c2f5f39d4cc8b911d98cb246ca2a9afeb2 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:51:05 2010 +0000 Add SDNPCommutative and SDNPAssociative to several X86 target nodes. This lets isel fold loads into them in more cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92506 91177308-0d34-0410-b5e6-96231b3b80d8 commit a48781ef9f52fa184b38ff497ae0912d13c24c4d Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 4 20:44:00 2010 +0000 Fix begin and end markers for nested scopes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92505 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2b792c95e6d4e3139a92e1153685946f1b11f845 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:36:57 2010 +0000 Replace some special-case code which probably was buggy with an assertion verifying that the special case does not occur. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92504 91177308-0d34-0410-b5e6-96231b3b80d8 commit cce9d29538cca89df73ca76b8bb7bbd065badf15 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 20:31:55 2010 +0000 Remove the CPAttrParentAsRoot code, which is unused, and inconvenient for a refactoring I'm working on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92503 91177308-0d34-0410-b5e6-96231b3b80d8 commit 262378f0fe604903e98b8b9c696f7aa896f054c6 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 19:57:26 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92502 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3c6ce780e77241207156775ca4e85489f5e5ff82 Author: Devang Patel <dpatel@apple.com> Date: Mon Jan 4 19:41:13 2010 +0000 The test, derived from optimzed IR, does not mention "bar" in debug info anywhere so the dwarf writer is not expected to emit any debug info for function "bar". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92499 91177308-0d34-0410-b5e6-96231b3b80d8 commit ae758424789f1d19e87bd3d110177ec79271f960 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 19:36:42 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92498 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4a28ffb27778158d230faa706ba627b3e41099f5 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 19:10:20 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92496 91177308-0d34-0410-b5e6-96231b3b80d8 commit c435b9e36e8ba86654d488d7c3de3caaaf6e0753 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 18:57:15 2010 +0000 Truncate GEP indexes larger than the pointer size down to pointer size when doing this transform if the GEP is not inbounds. No testcase because it is very difficult to trigger this: instcombine already canonicalizes GEP indices to pointer size, so it relies specific permutations of the instcombine worklist. Thanks to Duncan for pointing this possible problem out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92495 91177308-0d34-0410-b5e6-96231b3b80d8 commit a1bb07aa0d9650f11d99de47f1cf9da531b45cac Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 18:48:26 2010 +0000 silence a bogus 'might be used uninit' warning from GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92494 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6f3bf4c5544c4857eebf61b1055dd90ef37c58c7 Author: Dan Gohman <gohman@apple.com> Date: Mon Jan 4 18:38:39 2010 +0000 Add a comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92492 91177308-0d34-0410-b5e6-96231b3b80d8 commit 24f90acb9d46605228ee5448934c4c00f7f0b721 Author: David Greene <greened@obbligato.org> Date: Mon Jan 4 17:47:05 2010 +0000 Change errs() to dbgs(). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92490 91177308-0d34-0410-b5e6-96231b3b80d8 commit ee898135b401794d095886f24f04b4bb42d3f25e Author: Anton Korobeynikov <asl@math.spbu.ru> Date: Mon Jan 4 10:31:54 2010 +0000 Fix invalid chain folding for memory variant of sdiv / udiv git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92472 91177308-0d34-0410-b5e6-96231b3b80d8 commit e800b08fb8273246ede9495efb76f51df5104755 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:59:07 2010 +0000 move some more cast-related stuff git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92471 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3529dd1d9672a47ba64c17314fcff8373bda8b8b Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Mon Jan 4 07:55:25 2010 +0000 80-col violations, trailing whitespace. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92470 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0b2e6feb96d027ae57c4e2c16d44c81794be97fe Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:54:59 2010 +0000 move the [Can]EvaluateInDifferentType functions out to InstCombineCasts.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92469 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4bbb8a358a666d66fdbf6870abf3cc9b2ead186d Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:53:58 2010 +0000 split 943 lines of instcombine out to a new InstCombineCasts.cpp file. InstructionCombining.cpp is now down to a svelte 9300 lines :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92468 91177308-0d34-0410-b5e6-96231b3b80d8 commit 004eae9138c629055b1d8f0c6a083cc7f64f7585 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:37:31 2010 +0000 split instcombine of compares (visit[FI]Cmp) out to a new InstCombineCompares.cpp file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92467 91177308-0d34-0410-b5e6-96231b3b80d8 commit 078c8b595c346a58f13c995c56af11d61fdfd099 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:19:55 2010 +0000 update cmakefile git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92466 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ef9cadf1ac6f58ce9cfaff94783ecd41a888e79 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:17:19 2010 +0000 move the 'SimplifyDemandedFoo' methods out to their own file, cutting 1K lines out of instcombine.cpp git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92465 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0108c8c925828fa1020f0b87abe9a2de4a0d972 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Mon Jan 4 07:16:12 2010 +0000 Fix the Emacs mode string. Also trailing whitespace & 80-col violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92464 91177308-0d34-0410-b5e6-96231b3b80d8 commit c737bae32e523f6e848986187bdd2a60a0d99461 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:12:23 2010 +0000 split the instcombine class definition out to a header shared among the instcombine library. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92463 91177308-0d34-0410-b5e6-96231b3b80d8 commit 635eb0cb378a8abe8376fc4f6c75b6f9255d67ee Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 07:02:48 2010 +0000 remove a ton of unneeded LLVMContext stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92462 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3de1b03506fa746783da702a4b2791b8aac5e66d Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 06:30:00 2010 +0000 move InstCombineWorklist out to its own header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92461 91177308-0d34-0410-b5e6-96231b3b80d8 commit b43a92358666cb00a5dfa7ec95197ba9c13a65c4 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 06:28:20 2010 +0000 forgot to svn add these. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92460 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8d4c5c1d1462a330aac5a9067153a20c50c1eb84 Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 06:23:24 2010 +0000 move instcombine to its own library, it's past time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92459 91177308-0d34-0410-b5e6-96231b3b80d8 commit d1bad7405d2d9c24a1cfd27b0fa7938cd795b79b Author: Chris Lattner <sabre@nondot.org> Date: Mon Jan 4 06:03:59 2010 +0000 implement an instcombine xform needed by clang's codegen on the example in PR4216. This doesn't trigger in the testsuite, so I'd really appreciate someone scrutinizing the logic for correctness. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92458 91177308-0d34-0410-b5e6-96231b3b80d8 commit c3a3e6366fa8ad087d355e4e7508b3cd359dd7cf Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 18:33:18 2010 +0000 fix PR5930, allowing the asmprinter to emit difference between two labels as a truncate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92455 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a0e9c64aa48fb1137b36930e90d20b744c2e3ab Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 18:14:24 2010 +0000 it isn't safe to speculative load from a malloc, it might have returned null, and may not have been big enough in any case. Thanks to Jay Foad for pointing this out! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92452 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0a30434516d58591e41031fcbe5122231f2dd74c Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 18:10:58 2010 +0000 add PR# git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92451 91177308-0d34-0410-b5e6-96231b3b80d8 commit 32bf9d34a062d5039f8f14498ba0af061461b65b Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 18:09:40 2010 +0000 differences between two blockaddress's don't cause a global variable initializer to require relocations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92450 91177308-0d34-0410-b5e6-96231b3b80d8 commit 30000569c3e23cd39bcdb419d8416935ffdf7c08 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 06:58:48 2010 +0000 pull my debug hooks out, I'm done with this xform for now. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92446 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf48d8953d20dd801bd4eea038ea0b60e969e9a1 Author: Nick Lewycky <nicholas@mxc.ca> Date: Sun Jan 3 04:39:07 2010 +0000 Small cleanups, refactor some duplicated code into a single method. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92445 91177308-0d34-0410-b5e6-96231b3b80d8 commit 74136f9c91a8bc0f19e637e35a18d3f6487e5129 Author: Chris Lattner <sabre@nondot.org> Date: Sun Jan 3 03:03:27 2010 +0000 generalize the previous transformation to handle indexing into arrays of structs and other arrays, so long as all the subsequent indexes are constants. This triggers frequently for stuff like: @divisions = internal constant [29 x [2 x i32]] [[2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 1], [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 2], [2 x i32] zeroinitializer, [2 x i32] zeroinitializer, [2 x i32] zeroinitializer, [2 x i32] [i32 0, i32 2], [2 x i32] [i32 0, i32 1], [2 x i32] zeroinitializer, [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 0], [2 x i32] [i32 1, i32 1], [2 x i32] [i32 1, i32 2], [2 x i32] [i32 1, i32 2]], align 32 ; <[29 x [2 x i32]]*> [#uses=50] %623 = getelementptr inbounds [29 x [2 x i32]]* @divisions, i64 0, i64 %619, i64 0 ; <i32*> [#uses=1] %684 = icmp eq i32 %683, 999 also for the "my_defs" table in 'gs', etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92444 91177308-0d34-0410-b5e6-96231b3b80d8 commit cb77a9a904dea843a61ed8da02f44f6a91bb81cd Author: Nick Lewycky <nicholas@mxc.ca> Date: Sun Jan 3 00:55:31 2010 +0000 Cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92436 91177308-0d34-0410-b5e6-96231b3b80d8 commit cd10dc6d790610482dd8f95c28a19740df436244 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 22:08:28 2010 +0000 teach instcombine to optimize idioms like A[i]&42 == 0. This occurs in 403.gcc in mode_mask_array, in safe-ctype.c (which is copied in multiple apps) in _sch_istable, etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92427 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0fc16e3f995888e1452b115a14a23cc49025ac4 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 21:50:18 2010 +0000 Teach the table lookup optimization to generate range compares when a consequtive sequence of elements all satisfies the predicate. Like the double compare case, this generates better code than the magic constant case and generalizes to more than 32/64 element array lookups. Here are some examples where it triggers. From 403.gcc, most accesses to the rtx_class array are handled, e.g.: @rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=547] %142 = icmp eq i8 %141, 105 @rtx_class = constant [153 x i8] c"xxxxxmmmmmmmmxxxxxxxxxxxxmxxxxxxiiixxxxxxxxxxxxxxxxxxxooxooooooxxoooooox3x2c21c2222ccc122222ccccaaaaaa<<<<<<<<<<<<<<<<<<111111111111bbooxxxxxxxxxxcc2211x", align 32 ; <[153 x i8]*> [#uses=543] %165 = icmp eq i8 %164, 60 Also, most of the 59-element arrays (mode_class/rid_to_yy, etc) optimized before are actually range compares. This lets 32-bit machines optimize them. 400.perlbmk has stuff like this: 400.perlbmk: PL_regkind, even for 32-bit: @PL_regkind = constant [62 x i8] c"\00\00\02\02\02\06\06\06\06\09\09\0B\0B\0D\0E\0E\0E\11\12\12\14\14\16\16\18\18\1A\1A\1C\1C\1E\1F !!!$$&'((((,-.///88886789:;8$", align 32 ; <[62 x i8]*> [#uses=4] %811 = icmp ne i8 %810, 33 @PL_utf8skip = constant [256 x i8] c"\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\01\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\02\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\03\04\04\04\04\04\04\04\04\05\05\05\05\06\06\07\0D", align 32 ; <[256 x i8]*> [#uses=94] %12 = icmp ult i8 %10, 2 etc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92426 91177308-0d34-0410-b5e6-96231b3b80d8 commit 19e717578551af76c788b29bde533f88a918180e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 21:46:33 2010 +0000 theoretically the negate we find could be in a different function, check for this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92425 91177308-0d34-0410-b5e6-96231b3b80d8 commit f9a7a500993dfd7e3be5c44c7aef39b26ea338cc Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 20:20:33 2010 +0000 use enums for the over/underdefined markers for clarity. Switch to using -2/-3 instead of -1/-2 for a future xform. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92423 91177308-0d34-0410-b5e6-96231b3b80d8 commit a357b8d54b0c57f6988e66b8fd3a813881f2095b Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 20:07:03 2010 +0000 remove the random sampling framework, which is not maintained anymore. If there is interest, it can be resurrected from SVN. PR4912. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92422 91177308-0d34-0410-b5e6-96231b3b80d8 commit c325c5e72e737d4f1b5ab4595c378bf10358b8a7 Author: Nick Lewycky <nicholas@mxc.ca> Date: Sat Jan 2 16:14:56 2010 +0000 Fix logic error in previous commit. The != case needs to become an or, not an and. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92419 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9fd66d7d2bbf26689ad9dd66c6bea5e9f4ed7f1c Author: Nick Lewycky <nicholas@mxc.ca> Date: Sat Jan 2 15:25:44 2010 +0000 Optimize pointer comparison into the typesafe form, now that the backends will handle them efficiently. This is the opposite direction of the transformation we used to have here. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92418 91177308-0d34-0410-b5e6-96231b3b80d8 commit ea367cca5ae583d07c6df818167c6419fbabbc22 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 09:35:17 2010 +0000 Generalize the previous xform to handle cases where exactly two elements match or don't match with two comparisons. For example, the testcase compiles into: define i1 @test5(i32 %X) { %1 = icmp eq i32 %X, 2 ; <i1> [#uses=1] %2 = icmp eq i32 %X, 7 ; <i1> [#uses=1] %R = or i1 %1, %2 ; <i1> [#uses=1] ret i1 %R } This generalizes the previous xforms when the array is larger than 64 elements (and this case matches) and generates better code for cases where it overlaps with the magic bitshift case. This generalizes more cases than you might expect. For example, 400.perlbmk has: @PL_utf8skip = constant [256 x i8] c"\01\01\01\... %15 = icmp ult i8 %7, 7 403.gcc has: @rid_to_yy = internal constant [114 x i16] [i16 259, i16 260, ... %18 = icmp eq i16 %16, 295 and xalancbmk has a bunch of examples, such as _ZN11xercesc_2_5L15gCombiningCharsE and _ZN11xercesc_2_5L10gBaseCharsE. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92417 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9780c03743bc6320d89d12b31cb1c84fd146da4f Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 09:22:13 2010 +0000 fix a miscompilation I introduced of cdecl with a late change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92416 91177308-0d34-0410-b5e6-96231b3b80d8 commit 03b9facf565592cf62612707e7e3f2c74471527a Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 08:56:52 2010 +0000 enhance the compare/load/index optimization to work on *any* load from a global with 32/64 elements or less (depending on whether i64 is native on the target), generating a bitshift idiom to determine the result. For example, on test4 we produce: define i1 @test4(i32 %X) { %1 = lshr i32 933, %X ; <i32> [#uses=1] %2 = and i32 %1, 1 ; <i32> [#uses=1] %R = icmp ne i32 %2, 0 ; <i1> [#uses=1] ret i1 %R } This triggers in a number of interesting cases, for example, here's an fp case: @A.3255 = internal constant [4 x double] [double 4.100000e+00, double -3.900000e+00, double -1.000000e+00, double 1.000000e+00], align 32 ; <[4 x double]*> [#uses=7] ... %7 = fcmp olt double %3, 0.000000e+00 In this case we make the slen2_tab global dead, which is nice: @slen2_tab = internal constant [16 x i32] [i32 0, i32 1, i32 2, i32 3, i32 0, i32 1, i32 2, i32 3, i32 1, i32 2, i32 3, i32 1, i32 2, i32 3, i32 2, i32 3], align 32 ; <[16 x i32]*> [#uses=1] ... %204 = icmp eq i32 %46, 0 Perl has a bunch of these, also on the 'Perl_regkind' array: @Perl_yygindex = internal constant [51 x i16] [i16 0, i16 0, i16 0, i16 0, i16 374, i16 351, i16 0, i16 -12, i16 0, i16 946, i16 413, i16 -83, i16 0, i16 0, i16 0, i16 -311, i16 -13, i16 4007, i16 2893, i16 0, i16 0, i16 0, i16 0, i16 0, i16 372, i16 -8, i16 0, i16 0, i16 246, i16 -131, i16 43, i16 86, i16 208, i16 -45, i16 -169, i16 987, i16 0, i16 0, i16 0, i16 0, i16 308, i16 0, i16 -271, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0], align 32 ; <[51 x i16]*> [#uses=1] ... %1364 = icmp eq i16 %1361, 0 186.crafty really likes this on 64-bit machines, because it triggers on a bunch of globals like this: @white_outpost = internal constant [64 x i8] c"\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\02\02\00\00\00\00\00\04\05\05\04\00\00\00\00\03\06\06\03\00\00\00\00\00\01\01\00\00\00\00\00\00\00\00\00\00\00", align 32 ; <[64 x i8]*> [#uses=2] However the big winner is 403.gcc, which triggers hundreds of times, eliminating all the accesses to the 57-element arrays 'mode_class', mode_unit_size, mode_bitsize, regclass_map, etc. go 64-bit machines :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92415 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ebc5d61a24dc66f46dba1db0a6919fd6b21e581 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Sat Jan 2 08:27:23 2010 +0000 Forward -O0 to llvm-gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92414 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3f441ad8ebfa73fa4994319f5b6f7e367b865a7d Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Sat Jan 2 08:27:10 2010 +0000 Apparently, it is OK for -MT to be specified several times. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92413 91177308-0d34-0410-b5e6-96231b3b80d8 commit 94955a8b4771ae14ff26b9afbb45cb7b3d011141 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 08:20:51 2010 +0000 enhance the previous optimization to work with fcmp in addition to icmp. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92412 91177308-0d34-0410-b5e6-96231b3b80d8 commit b84aa98afd5a02d8a26e6f38a842dc0cc6507c9c Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 08:12:04 2010 +0000 Teach instcombine to fold compares of loads from constant arrays with variable indices into a comparison of the index with a constant. The most common occurrence of this that I see by far is stuff like: if ("foobar"[i] == '\0') ... which we compile into: if (i == 6), saving a load and materialization of the global address. This also exposes loop trip count information to later passes in many cases. This triggers hundreds of times in xalancbmk, which is where I first noticed it, but it also triggers in many other apps. Here are a few interesting ones from various apps: @must_be_connected_without = internal constant [8 x i8*] [i8* getelementptr inbounds ([3 x i8]* @.str64320, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str27283, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str71327, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8]* @.str72328, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str18274, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8]* @.str11267, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8]* @.str32288, i64 0, i64 0), i8* null], align 32 ; <[8 x i8*]*> [#uses=2] %scevgep.i = getelementptr [8 x i8*]* @must_be_connected_without, i64 0, i64 %indvar.i ; <i8**> [#uses=1] %17 = load ... %18 = icmp eq i8* %17, null ; <i1> [#uses=1] -> icmp eq i64 %indvar.i, 7 @yytable1095 = internal constant [84 x i8] c"\12\01(\05\06\07\08\09\0A\0B\0C\0D\0E1\0F\10\11266\1D: \10\11,-,0\03'\10\11B6\04\17&\18\1945\05\06\07\08\09\0A\0B\0C\0D\0E\1E\0F\10\11*\1A\1B\1C$3+>#%;<IJ=ADFEGH9KL\00\00\00C", align 32 ; <[84 x i8]*> [#uses=2] %57 = getelementptr inbounds [84 x i8]* @yytable1095, i64 0, i64 %56 ; <i8*> [#uses=1] %mode.0.in = getelementptr inbounds [9 x i32]* @mb_mode_table, i64 0, i64 %.pn ; <i32*> [#uses=1] load ... %64 = icmp eq i8 %58, 4 ; <i1> [#uses=1] -> icmp eq i64 %.pn, 35 ; <i1> [#uses=0] @gsm_DLB = internal constant [4 x i16] [i16 6554, i16 16384, i16 26214, i16 32767] %scevgep.i = getelementptr [4 x i16]* @gsm_DLB, i64 0, i64 %indvar.i ; <i16*> [#uses=1] %425 = load %scevgep.i %426 = icmp eq i16 %425, -32768 ; <i1> [#uses=0] -> false git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92411 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4b7ce57f87d16a0acd0efbbbbd614985f65bc791 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 01:22:23 2010 +0000 constant fold nasty constant expressions formed by llvm-gcc, wrapping up PR3351. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92410 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4091917ae511e97c66b4d94602b1aa3457205ab2 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 00:31:05 2010 +0000 remove the instcombine transformations that are inserting nasty pointer to int casts that confuse later optimizations. See PR3351 for details. This improves but doesn't complete fix 483.xalancbmk because llvm-gcc does this xform in GCC's "fold" routine as well. Clang++ will do better I guess. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92408 91177308-0d34-0410-b5e6-96231b3b80d8 commit 910a778224f2b18bfadd8512345b17706d890f30 Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 00:22:15 2010 +0000 allow this to work on linux hosts. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92407 91177308-0d34-0410-b5e6-96231b3b80d8 commit a746511144561cb5a56ae14096499a8dcdf5d10e Author: Chris Lattner <sabre@nondot.org> Date: Sat Jan 2 00:00:03 2010 +0000 Teach codegen to handle: (X != null) | (Y != null) --> (X|Y) != 0 (X == null) & (Y == null) --> (X|Y) == 0 so that instcombine can stop doing this for pointers. This is part of PR3351, which is a case where instcombine doing this for pointers (inserting ptrtoint) is pessimizing code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92406 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3b9d28303feab3a9b0b446b189a3f23e8fff72a2 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 23:55:04 2010 +0000 rename file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92405 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0903092e4877dcf99741ed478addd9d0afc57ec5 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 23:37:34 2010 +0000 whitespace cleanup git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92404 91177308-0d34-0410-b5e6-96231b3b80d8 commit f54ff334cb53099a89446a32d22e37019825056a Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 23:09:08 2010 +0000 add a simple instcombine xform, simplify another one to use hasAllZeroIndices() instead of hand rolling a loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92403 91177308-0d34-0410-b5e6-96231b3b80d8 commit fc872393bf81fa6b0a601c6d7b76d1f1fb3b9699 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 22:42:29 2010 +0000 generalize the pointer difference optimization to handle a constantexpr gep on the 'base' side of the expression. This completes comment #4 in PR3351, which comes from 483.xalancbmk. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92402 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1f541cf11a4e334ce302282521bbab6605b2076d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 22:29:12 2010 +0000 teach instcombine to optimize pointer difference idioms involving constant expressions. This is a step towards comment #4 in PR3351. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92401 91177308-0d34-0410-b5e6-96231b3b80d8 commit b6292bc182efcd6d4e11c2b52671f66f8935e712 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 22:12:03 2010 +0000 use 'match' to simplify some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92400 91177308-0d34-0410-b5e6-96231b3b80d8 commit 34eb10d272168ccc1c93029279578cc5f02c3fa3 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 18:34:40 2010 +0000 implement the transform requested in PR5284 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92398 91177308-0d34-0410-b5e6-96231b3b80d8 commit 46e577bf2a6280f34443ebe54086acc3dd98a20d Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 04:41:36 2010 +0000 Fix a warning on gcc 4.4. SelectionDAGBuilder.cpp:4294: warning: suggest explicit braces to avoid ambiguous ‘else’ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92395 91177308-0d34-0410-b5e6-96231b3b80d8 commit 480b7f806a23fc202d62c88d0841ebeed547f4e2 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 04:41:22 2010 +0000 Trailing whitespace, 80-col violations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92394 91177308-0d34-0410-b5e6-96231b3b80d8 commit 305344c00aad44f387608b0e55786a151f42840d Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 04:41:10 2010 +0000 Minor simplifactions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92393 91177308-0d34-0410-b5e6-96231b3b80d8 commit de321fd87cc67481b8605dafc7edf8b59e95bd3c Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 04:40:54 2010 +0000 Typo. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92392 91177308-0d34-0410-b5e6-96231b3b80d8 commit 90837d9a6ecd25840dc9450638db4953b5a98e72 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 03:51:02 2010 +0000 Make CheckForSuperfluousOptions handle list form of 'switch_on' correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92391 91177308-0d34-0410-b5e6-96231b3b80d8 commit 1ab87cfc39d712753f6d1f9c64d0a67e82744c7d Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 03:50:51 2010 +0000 Minor simplifications. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92390 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9718696a5cd121422f7bb2aef2d704d005ad8205 Author: Mikhail Glushenkov <foldr@codedgers.com> Date: Fri Jan 1 03:50:34 2010 +0000 Better error message. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92389 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6391637268da054569126bf1c0eee3a90e87a35a Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 03:32:16 2010 +0000 Teach codegen to lower llvm.powi to an efficient (but not optimal) multiply sequence when the power is a constant integer. Before, our codegen for std::pow(.., int) always turned into a libcall, which was really inefficient. This should also make many gfortran programs happier I'd imagine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92388 91177308-0d34-0410-b5e6-96231b3b80d8 commit bc7a9122a4566bf8ad1eb66dc22064fabda19f91 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 03:26:51 2010 +0000 Make this more likely to generate a libcall. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92387 91177308-0d34-0410-b5e6-96231b3b80d8 commit c42f65a4032db2a448aaa7b85dff872c8955f1ea Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 01:54:08 2010 +0000 add missing line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92384 91177308-0d34-0410-b5e6-96231b3b80d8 commit 30095b482545296c2e4d1e25ca7f728104612e28 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 01:52:15 2010 +0000 add a few trivial instcombines for llvm.powi. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92383 91177308-0d34-0410-b5e6-96231b3b80d8 commit f2b7b735f3f8abaa67b644eb410c182c6c257304 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 01:29:26 2010 +0000 update this. To take the next step, llvm.powi should be generalized to work on integers as well and codegen should lower them to branch trees. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92382 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9174de49a24169a0d3d58b6378ec05dbb549060b Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 01:13:15 2010 +0000 When factoring multiply expressions across adds, factor both positive and negative forms of constants together. This allows us to compile: int foo(int x, int y) { return (x-y) + (x-y) + (x-y); } into: _foo: ## @foo subl %esi, %edi leal (%rdi,%rdi,2), %eax ret instead of (where the 3 and -3 were not factored): _foo: imull $-3, 8(%esp), %ecx imull $3, 4(%esp), %eax addl %ecx, %eax ret this started out as: movl 12(%ebp), %ecx imull $3, 8(%ebp), %eax subl %ecx, %eax subl %ecx, %eax subl %ecx, %eax ret This comes from PR5359. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92381 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4aed2811219557774a7df9a86529c6d72280be50 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 00:50:00 2010 +0000 test case we alredy get right. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92380 91177308-0d34-0410-b5e6-96231b3b80d8 commit 0fc5712a47212e229d5421c21100a3e5e3cc347f Author: Ted Kremenek <kremenek@apple.com> Date: Fri Jan 1 00:04:49 2010 +0000 Remove old header. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92378 91177308-0d34-0410-b5e6-96231b3b80d8 commit 680cc0add1cf3946bd625782d25e5116ae9b6749 Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 00:04:26 2010 +0000 clean up some comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92377 91177308-0d34-0410-b5e6-96231b3b80d8 commit e7d8b124af9cecb15576e155686447438f07122d Author: Chris Lattner <sabre@nondot.org> Date: Fri Jan 1 00:01:34 2010 +0000 switch from std::map to DenseMap for rank data structures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92375 91177308-0d34-0410-b5e6-96231b3b80d8 commit 49b38e9dc18b42fcb62e9e47729f8a2c349ba464 Author: Ted Kremenek <kremenek@apple.com> Date: Thu Dec 31 23:40:17 2009 +0000 Remove derelict serialization code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92374 91177308-0d34-0410-b5e6-96231b3b80d8 commit dd7266b6fa5dafad5e578ce761995dda8263ba78 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 20:34:32 2009 +0000 reuse negates where possible instead of always creating them from scratch. This allows us to optimize test12 into: define i32 @test12(i32 %X) { %factor = mul i32 %X, -3 ; <i32> [#uses=1] %Z = add i32 %factor, 6 ; <i32> [#uses=1] ret i32 %Z } instead of: define i32 @test12(i32 %X) { %Y = sub i32 6, %X ; <i32> [#uses=1] %C = sub i32 %Y, %X ; <i32> [#uses=1] %Z = sub i32 %C, %X ; <i32> [#uses=1] ret i32 %Z } git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92373 91177308-0d34-0410-b5e6-96231b3b80d8 commit dabb5f7a839c6ffa02eba804d2ee257a849816ee Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 19:49:01 2009 +0000 we don't need a smallptrset to detect duplicates, the values are sorted, so we can just do a linear scan. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92372 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7a14c94ff032c286735e3d51ad3716292eb02d9c Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 19:34:45 2009 +0000 make reassociate more careful about not leaving around dead mul's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92370 91177308-0d34-0410-b5e6-96231b3b80d8 commit b350027509cee7866483cd4c772c0ba585b81201 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 19:25:19 2009 +0000 remove debug git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92369 91177308-0d34-0410-b5e6-96231b3b80d8 commit eef3d7ee13996d710f5af71a4a1791a7bfa64057 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 19:24:52 2009 +0000 teach reassociate to factor x+x+x -> x*3. While I'm at it, fix RemoveDeadBinaryOp to actually do something. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92368 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4ecba488405762d5bdcb4cfceb50a14728bc9a5d Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 18:40:32 2009 +0000 change reassociate to use SmallVector for its key datastructures instead of std::vector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92366 91177308-0d34-0410-b5e6-96231b3b80d8 commit a49b7bd78269db61b5905196c3a42687aa9ea684 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 18:18:46 2009 +0000 change an if to an assert, fix comment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92364 91177308-0d34-0410-b5e6-96231b3b80d8 commit 87a70035c511a65fdf87d3c114669553ef70442d Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 18:17:13 2009 +0000 move the rest of the add optimization code out to OptimizeAdd, improve some comments, simplify a bit of code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92363 91177308-0d34-0410-b5e6-96231b3b80d8 commit 35f374a80c2c56df08b8a86049b70c39cfa9aa6a Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 17:51:05 2009 +0000 factor statistic updating better. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92362 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3866fd8b0928b0e2a81b931077fb42cc919206ec Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Thu Dec 31 16:27:13 2009 +0000 Silence compiler warning. warning: comparison between signed and unsigned integer expressions git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92359 91177308-0d34-0410-b5e6-96231b3b80d8 commit f26331c710d7cb3dc5e2df5f599e0b439b2e0d2e Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 08:33:49 2009 +0000 simple fix for an incorrect factoring which causes a miscompilation, PR5458. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92354 91177308-0d34-0410-b5e6-96231b3b80d8 commit 432f8a4ede7b5b32887a2ae4c7f8cd822feb9de4 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 08:32:22 2009 +0000 merge some more tests in. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92353 91177308-0d34-0410-b5e6-96231b3b80d8 commit e1d8cae5d7441a85b5138590f2a19e774efc5a14 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 08:29:56 2009 +0000 filecheckize git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92352 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a8f839a3540ae2c6933fa8f850a51b95104e61d Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 08:23:09 2009 +0000 fix refactoro git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92349 91177308-0d34-0410-b5e6-96231b3b80d8 commit 67ee6d8a18ce97db9a33a19ffe62c53b3bac264a Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 07:59:34 2009 +0000 factor code out into helper functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92347 91177308-0d34-0410-b5e6-96231b3b80d8 commit f854201455275fe4ec9b15b8bef96d515990b99f Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 07:48:51 2009 +0000 switch some std::vector's to smallvector. Reduce nesting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92346 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4671c2dcae45396caa118cee1be30d21caac5f6 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 07:33:14 2009 +0000 use more modern datastructures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92344 91177308-0d34-0410-b5e6-96231b3b80d8 commit eca6bc45daaff60fd301ddcb3c94f0810738f2ed Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 07:17:37 2009 +0000 clean up -debug output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92343 91177308-0d34-0410-b5e6-96231b3b80d8 commit a5f5a55bd2010c450ba3a648ad5e716c840ac606 Author: Douglas Gregor <doug.gregor@gmail.com> Date: Thu Dec 31 04:24:34 2009 +0000 Document the edit-distance algorithm used in StringRef, switch it over to SmallVector, and add a unit test. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92340 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a1c423fb9667a46973660d699e342f781ff0e1b Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 03:02:42 2009 +0000 this #include is ok. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92338 91177308-0d34-0410-b5e6-96231b3b80d8 commit 05a0becaf20bf261a03929e63cb10c25a9172406 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 03:02:08 2009 +0000 fix Analysis/DebugInfo.h to not include Metadata.h. Do this by moving one method out of line and eliminating redundant checks from other methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92337 91177308-0d34-0410-b5e6-96231b3b80d8 commit 42dfc1d91651da34013c8ae49382ca10961224ae Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 03:00:49 2009 +0000 add some basic named MD tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92336 91177308-0d34-0410-b5e6-96231b3b80d8 commit cf722229b32c21d5253ce611583938c1272f54de Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:33:14 2009 +0000 use early exits to reduce indentation. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92335 91177308-0d34-0410-b5e6-96231b3b80d8 commit c216378f3e025eed5df082c89eb82b28be8e1f34 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:31:59 2009 +0000 eliminate another copy of the mdnode printing logic, simplify the one that remains. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92334 91177308-0d34-0410-b5e6-96231b3b80d8 commit d256081f4440011f5cb24d08d5112ecf710869c9 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:27:30 2009 +0000 random tidying for MDNode printing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92333 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7d7fac9a02beee58e15c60298a26f5f9670d15c8 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:23:35 2009 +0000 eliminate a bunch of useless forwarding functions with one caller. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92332 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4f23f2e3d4679ea7a9b3f6a79ffbe6015ff95742 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:20:11 2009 +0000 make mdnMap type safe, rename accessors for consistency with the rest of llvm. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92331 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6a1e1086cfb3e9daffc318b392bf82e2cc59f041 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:15:45 2009 +0000 metadata can't be a global var initializer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92330 91177308-0d34-0410-b5e6-96231b3b80d8 commit d1af981f1285805303100ba20190a3f9e9c4f4a2 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:13:35 2009 +0000 simplify mdnode printing logic. Now N->dump() only dumps one node instead of all of them. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92329 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4e50db19cd616dc6705d14b1f85dba6494ce0260 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 02:12:13 2009 +0000 don't unittest mdnode printing, we have disassembler tests for this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92328 91177308-0d34-0410-b5e6-96231b3b80d8 commit d401bb57e7bc85c1c1e2170b3f66989b438246c1 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:54:05 2009 +0000 unify two copies of the NamedMDNode printing code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92327 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4dd513c791f8a7dbd1ed28a455740f144d1f2a2 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:44:44 2009 +0000 fix printing of function-local metadata to print all the operands of the mdnode, not just operand 0 over and over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92326 91177308-0d34-0410-b5e6-96231b3b80d8 commit 5828cf6c126f0f0c7fbc09fa1db040025598cc5e Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:41:14 2009 +0000 simplify printing of mdstring and Argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92325 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7811ce3c042b1e10bf9a92978a360ba64916dfc5 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:36:50 2009 +0000 simplify asmprinting of NamedMDNode git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92324 91177308-0d34-0410-b5e6-96231b3b80d8 commit a643a318f7a73ba97a66bd9bf68de4f7f19c1c7b Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:32:41 2009 +0000 Remove #include of metadata.h from intrinsicinst.h. The only method that needs it (DbgValueInst::getValue) has been moved out of line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92323 91177308-0d34-0410-b5e6-96231b3b80d8 commit 782edc0ad4962d0f22679c264b9ad9aeb43495e5 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:22:29 2009 +0000 rename "elements" of metadata to "operands". "Elements" are things that occur in types. "operands" are things that occur in values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92322 91177308-0d34-0410-b5e6-96231b3b80d8 commit c79176153244447832fda44fc92602cb19c9da20 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 01:05:46 2009 +0000 Optimize MDNode to coallocate the operand list immediately after the MDNode in memory. This eliminates the operands pointer and saves a new[] per node. Note that the code in DIDerivedType::replaceAllUsesWith is wrong and quite scary. A MDNode should not be RAUW'd with something else: this changes all uses of the mdnode, which may not be debug info related! Debug info should use something non-mdnode for declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92321 91177308-0d34-0410-b5e6-96231b3b80d8 commit 67735d43b803531f50ba62a14a19750f3509d640 Author: Chris Lattner <sabre@nondot.org> Date: Thu Dec 31 00:51:46 2009 +0000 tidy git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92320 91177308-0d34-0410-b5e6-96231b3b80d8 commit f0deeb1db6042913943e6b7d60cdd118ef2a9376 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 21:42:11 2009 +0000 do not bother reuniquing mdnodes whose operands drop to null. Doing so can be a huge performance issue when tearing down modules and mdnodes are not guaranteed to be unique anyway. This speeds up: $ time ~/llvm/Release/bin/clang gcc.c -w -S -g from 72 to 35s, where gcc.c is from: http://people.csail.mit.edu/smcc/projects/single-file-programs/ git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92315 91177308-0d34-0410-b5e6-96231b3b80d8 commit c6729718c58b0778c48378d4a2f9e18778d396aa Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 20:25:09 2009 +0000 remove some misleading comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92311 91177308-0d34-0410-b5e6-96231b3b80d8 commit e63a69745242ce18f887b374f0db666f0f778e4c Author: Douglas Gregor <doug.gregor@gmail.com> Date: Wed Dec 30 17:23:44 2009 +0000 Implement edit distance for StringRef git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92309 91177308-0d34-0410-b5e6-96231b3b80d8 commit 205f53281b573f15e78ce49fdb0f700092ee977b Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 06:00:36 2009 +0000 remove some fixme's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92304 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9d0d3555fc441023a92a5a248e6f3d9a5b44a950 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:54:51 2009 +0000 fix two bogus tests that the asmparser now rejects. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92303 91177308-0d34-0410-b5e6-96231b3b80d8 commit 252f0e4c82322f10f0cf3e99b2faa00d9ed03f08 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:48:36 2009 +0000 now that instruction metadata is only parsed in one place, eliminate the parser-global MDsOnInst vector and make ParseInstructionMetadata return its result by-ref through an argument like the entire rest of the parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92302 91177308-0d34-0410-b5e6-96231b3b80d8 commit c095b028825a29bad04e198523c3488e779d8c7c Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:44:30 2009 +0000 reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly handle the comma case for metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92301 91177308-0d34-0410-b5e6-96231b3b80d8 commit 50bbd7c6b40c7c8a2f0f1f46302b805ff986a146 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:31:19 2009 +0000 rename ParseOptionalCustomMetadata -> ParseInstructionMetadata, and make it non-optional. This fixes the bug where we'd accept and ignore a spurious comma after some instructions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92300 91177308-0d34-0410-b5e6-96231b3b80d8 commit a834b598af65a2b754df36042a8e7f1886263836 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:27:33 2009 +0000 convert 4 more instructions over. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92299 91177308-0d34-0410-b5e6-96231b3b80d8 commit b0f5db5cb5246de5a9d8f25d81788e837b35398a Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:23:43 2009 +0000 add facilities to start factoring instruction metadata parsing out of each opcode's handler. Change ret over so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92298 91177308-0d34-0410-b5e6-96231b3b80d8 commit a36628319feacb86df07dfc1ca6c5e05b764ba74 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:14:00 2009 +0000 reimplement insertvalue/extractvalue metadata handling to not blindly accept invalid input. Actually add a testcase. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92297 91177308-0d34-0410-b5e6-96231b3b80d8 commit ad53f269b62cd83bfa6caf79632016715c44536f Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:04:46 2009 +0000 remove two bogus calls that accepted metadata in the middle of insert/extract value *constant exprs*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92296 91177308-0d34-0410-b5e6-96231b3b80d8 commit 106ec003fa597a1634e0a8f20e7c466497ef04ac Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 05:02:06 2009 +0000 rename NamedOrCustomMD -> MetadataVar to follow conventions of all the rest of the code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92295 91177308-0d34-0410-b5e6-96231b3b80d8 commit f7da8c1f859cb6e837e3a44ed6147a1bc4733857 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 04:56:59 2009 +0000 rename lltok::Metadata -> lltok::exclaim. We name tokens after their syntactic form, not their semantic form. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92294 91177308-0d34-0410-b5e6-96231b3b80d8 commit 321130761ffd8fb17d1e90824ed5f0711f15e8af Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 04:51:58 2009 +0000 rename MetadataCache -> NumberedMetadata to follow the convention used by other things. Convert it to a vector since it is a dense numbering. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92293 91177308-0d34-0410-b5e6-96231b3b80d8 commit 42913ca9f6a8786f8f0c6835e670402f7db5d165 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 04:42:57 2009 +0000 rewrite ParseMDNodeVector to follow the normal patter used in the .ll parser. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92292 91177308-0d34-0410-b5e6-96231b3b80d8 commit 8859ed33bc71bf98ea6f8e162ee4359fa1744d94 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 04:15:23 2009 +0000 rename ParseMDNode -> ParseMDNodeID, since it parses !42, not !{... } as you'd expect. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92291 91177308-0d34-0410-b5e6-96231b3b80d8 commit e78c594690534be3d922f4c2f59ece9a7da1d186 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 04:13:37 2009 +0000 fix parsing of mdstring values. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92290 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5e601df8a3ed005307e6e1194a39446a98d1b83 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 02:20:07 2009 +0000 remove the code added in r90497. It has several major issues and no tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92288 91177308-0d34-0410-b5e6-96231b3b80d8 commit c5a4e14fc3a40fe3a2843a2c0ae2587927677842 Author: Chris Lattner <sabre@nondot.org> Date: Wed Dec 30 02:11:14 2009 +0000 split t_Metadata into t_MDNode and t_MDString, eliminating some unsafe casting. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92287 91177308-0d34-0410-b5e6-96231b3b80d8 commit da5298327ce62bd6d8327e24d5789b52902c4f60 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 22:40:21 2009 +0000 factor code even more. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92280 91177308-0d34-0410-b5e6-96231b3b80d8 commit b5a95af25e0603970ceac878057d48682d7cdfed Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 22:35:39 2009 +0000 simplify some code and unbreak the build by not consuming an extra token. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92279 91177308-0d34-0410-b5e6-96231b3b80d8 commit 68c027ce120b4bb4fd519f9f710fe819b728698a Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Dec 29 22:17:06 2009 +0000 remove a really wrong parenthesis. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92277 91177308-0d34-0410-b5e6-96231b3b80d8 commit e599a697b4098ccd98f8edc80b4c1503194a5c7e Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 22:01:50 2009 +0000 clean up some really strange code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92275 91177308-0d34-0410-b5e6-96231b3b80d8 commit 3d53e97911a01aa7278e301aa3ad41ec5de588df Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 21:53:55 2009 +0000 change ParseMDString and ParseMDNode to take arguments of the right type. This exposed a raft of other problems, which I'll deal with in subsequent patches. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92273 91177308-0d34-0410-b5e6-96231b3b80d8 commit 349e4075fbe75fccaa4e94296af269bcd9a866dd Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 21:43:58 2009 +0000 switch to TrackingVH instead of WeakVH, since these can never be RAUW'd and go to null. This also gets us some sorely lacking type safety. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92272 91177308-0d34-0410-b5e6-96231b3b80d8 commit af9ba478bc13ec6132d707b84d218daa8f26fc36 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 21:25:40 2009 +0000 Each instruction is allowed to have *multiple* different metadata objects on them. Though the entire compiler supports this, the asmparser didn't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92270 91177308-0d34-0410-b5e6-96231b3b80d8 commit 24392c25bc8f9283a50d326eb2b5e9bc24416cb5 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 21:17:33 2009 +0000 Do not crash when .ll printing metadata that smells like debug info, but isn't. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92268 91177308-0d34-0410-b5e6-96231b3b80d8 commit f272fd760f2a623eea02766fb1143f94746f3ca3 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 21:09:57 2009 +0000 fix indentation, fit in 80 cols. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92267 91177308-0d34-0410-b5e6-96231b3b80d8 commit 527d14b89e5dde3ec59e4431be4c102383d55edf Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Dec 29 16:57:26 2009 +0000 Replace a few more SmallVectors with arrays. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92265 91177308-0d34-0410-b5e6-96231b3b80d8 commit a7b0ebd1d27261cff8d0c0a0e20ab84d2da81ae8 Author: Benjamin Kramer <benny.kra@googlemail.com> Date: Tue Dec 29 11:04:52 2009 +0000 Use an array instead of a SmallVector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92264 91177308-0d34-0410-b5e6-96231b3b80d8 commit 457576ff0a03b6a73006b4202ae17304125e38c0 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 09:32:19 2009 +0000 remove a bunch of unneeded functions. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92263 91177308-0d34-0410-b5e6-96231b3b80d8 commit 49c94d990cc63b75b1a9a010d818c27ca2a779bb Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 09:22:47 2009 +0000 major cleanups, much of this file was incorrectly indented. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92262 91177308-0d34-0410-b5e6-96231b3b80d8 commit d0aad044ccc2d58a1e5a3a704de3f2e85b46706a Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 09:15:46 2009 +0000 one pass of cleanup over DebugInfo.h. Much more is still needed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92261 91177308-0d34-0410-b5e6-96231b3b80d8 commit c4d8577e32301f706cf33e6f9401b062870476ab Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 09:12:29 2009 +0000 prune #includes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92260 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6bba08039ac1edd35d89b5a7da3c06317b0a5a73 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 09:01:33 2009 +0000 Final step in the metadata API restructuring: move the getMDKindID/getMDKindNames methods to LLVMContext (and add convenience methods to Module), eliminating MetadataContext. Move the state that it maintains out to LLVMContext. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8 commit 58d94d4250c8a42d3392e01c3dd9e108e1bc5791 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 08:06:56 2009 +0000 just cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92258 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7a21401bf89ad297f30839e65e5c09ad63073f85 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 08:03:58 2009 +0000 remove useless argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92256 91177308-0d34-0410-b5e6-96231b3b80d8 commit c5c30fec467ddaa595605058a29eae086ba5130c Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:56:15 2009 +0000 privatize another interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92255 91177308-0d34-0410-b5e6-96231b3b80d8 commit a361a085cb03ab1e951ed341cb3271a8f54f587e Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:50:09 2009 +0000 the only call to this function (from clang) has been removed, zap it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92254 91177308-0d34-0410-b5e6-96231b3b80d8 commit 9924ee255336099ea7fc66ff6c98e8ce367db9f4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:44:16 2009 +0000 remove some unneeded Metadata interfaces. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92252 91177308-0d34-0410-b5e6-96231b3b80d8 commit 81ffc04666323d8fc0b1a831d63486436dec815f Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:28:33 2009 +0000 fix .cpp file to not wrap the entire file in namespace blocks. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92250 91177308-0d34-0410-b5e6-96231b3b80d8 commit 6ae0692560544ab40362e7902db0d4933395c1b1 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:25:48 2009 +0000 tidy up debug info comments, use ->isVoidTy() where reasonable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92249 91177308-0d34-0410-b5e6-96231b3b80d8 commit f4a877b44e61d0e4f3a03219ab430f4c4fbaed94 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 07:12:03 2009 +0000 sink twine.h down out of Value.h. It is annoying that you need to #include Twine.h just to give a twine a default value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92247 91177308-0d34-0410-b5e6-96231b3b80d8 commit 260cabecaaba7c0ce020aab05f08062154205014 Author: Sanjiv Gupta <sanjiv.gupta@microchip.com> Date: Tue Dec 29 03:24:34 2009 +0000 Extern declaration for unordered.f32 libcall was not being emitted. Fixed that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92242 91177308-0d34-0410-b5e6-96231b3b80d8 commit 2394453af76b7e98b2574613a9af4523ae124805 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 02:53:52 2009 +0000 When doing v1->RAUW(v2), don't do anything to metadata. We don't know why one was replaced with the other. Even in the specific case of debug information, it doesn't make sense to transfer the location over, this will just result in jumbled loc info. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92241 91177308-0d34-0410-b5e6-96231b3b80d8 commit 809758b23bf141f89fc0e4bb46b16705babcb217 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 02:46:09 2009 +0000 sink the Instruction::HasMetadata bit into SubclassData. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8 commit ed71f551254a290c97860a7d8106a26905705dc4 Author: Chris Lattner <sabre@nondot.org> Date: Tue Dec 29 02:14:09 2009 +0000 add a layer of accessors around the Value::SubClassData member, and use a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8 commit d11da6df1ecf393f637674081b24a631417321ed Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 23:41:32 2009 +0000 This is a major cleanup of the instruction metadata interfaces that I asked Devang to do back on Sep 27. Instead of going through the MetadataContext class with methods like getMD() and getMDs(), just ask the instruction directly for its metadata with getMetadata() and getAllMetadata(). This includes a variety of other fixes and improvements: previously all Value*'s were bloated because the HasMetadata bit was thrown into value, adding a 9th bit to a byte. Now this is properly sunk down to the Instruction class (the only place where it makes sense) and it will be folded away somewhere soon. This also fixes some confusion in getMDs and its clients about whether the returned list is indexed by the MDID or densely packed. This is now returned sorted and densely packed and the comments make this clear. This introduces a number of fixme's which I'll follow up on. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8 commit 7006b38f3ae7c3b5a565ff924b729111807327eb Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:56:07 2009 +0000 rearrange some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92234 91177308-0d34-0410-b5e6-96231b3b80d8 commit 343d8d6a1128b42a9bb2ee6ad4c726cea1f3ae2e Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:52:41 2009 +0000 add IRBuilder.cpp to cmake git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92233 91177308-0d34-0410-b5e6-96231b3b80d8 commit e9f460d2376ae08b4897c2a16ce16523f3e079c6 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:52:06 2009 +0000 remove #include that comes in from ConstantFolder.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92232 91177308-0d34-0410-b5e6-96231b3b80d8 commit 46c22854156dc4b4ec23dff224d977e2df55dda1 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:50:56 2009 +0000 remove #include of Function.h from IRBuilder git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92231 91177308-0d34-0410-b5e6-96231b3b80d8 commit 4b342015570ced985595ad672e1b2a63910caf76 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:45:40 2009 +0000 move debug info stuff out of line, allowing two #includes to go away from IRBuilder.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92230 91177308-0d34-0410-b5e6-96231b3b80d8 commit 24115ad0a861ee64d3e5ed72a54b3932174b2d39 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:28:46 2009 +0000 split code that doesn't need to be templated out of IRBuilder into a new non-templated IRBuilderBase class. Move that large CreateGlobalString out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92227 91177308-0d34-0410-b5e6-96231b3b80d8 commit 88b45f9bec26faf55292c7cb2b2dd13dbf2723ec Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 21:12:29 2009 +0000 rename ivar to be more descriptive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92226 91177308-0d34-0410-b5e6-96231b3b80d8 commit 68d0d0c2d9a9ceaf5d23d83d224235acba505245 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 20:45:51 2009 +0000 rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind doesn't exist already, eliminate registerMDKind. Tidy up a bunch of random stuff. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8 commit 093b1167ac64f42f6ac318d821f85c41bc8b2339 Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 20:10:43 2009 +0000 rename getHandlerNames to getMDKindNames, simplify its interface and simplify all the clients that use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92224 91177308-0d34-0410-b5e6-96231b3b80d8 commit bf70eda2e1f91cc4a58435342d5d27db1405445f Author: Chris Lattner <sabre@nondot.org> Date: Mon Dec 28 19:49:00 2009 +0000 tidy up and delete a dead smallvector. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92223 91177308-0d34-0410-b5e6-96231b3b80d8
7353 lines
286 KiB
HTML
7353 lines
286 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
"http://www.w3.org/TR/html4/strict.dtd">
|
|
<html>
|
|
<head>
|
|
<title>LLVM Assembly Language Reference Manual</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta name="author" content="Chris Lattner">
|
|
<meta name="description"
|
|
content="LLVM Assembly Language Reference Manual.">
|
|
<link rel="stylesheet" href="llvm.css" type="text/css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div class="doc_title"> LLVM Language Reference Manual </div>
|
|
<ol>
|
|
<li><a href="#abstract">Abstract</a></li>
|
|
<li><a href="#introduction">Introduction</a></li>
|
|
<li><a href="#identifiers">Identifiers</a></li>
|
|
<li><a href="#highlevel">High Level Structure</a>
|
|
<ol>
|
|
<li><a href="#modulestructure">Module Structure</a></li>
|
|
<li><a href="#linkage">Linkage Types</a>
|
|
<ol>
|
|
<li><a href="#linkage_private">'<tt>private</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_linker_private">'<tt>linker_private</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_internal">'<tt>internal</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_available_externally">'<tt>available_externally</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_linkonce">'<tt>linkonce</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_common">'<tt>common</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_weak">'<tt>weak</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_appending">'<tt>appending</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_externweak">'<tt>extern_weak</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_linkonce_odr">'<tt>linkonce_odr</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_weak">'<tt>weak_odr</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_external">'<tt>externally visible</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_dllimport">'<tt>dllimport</tt>' Linkage</a></li>
|
|
<li><a href="#linkage_dllexport">'<tt>dllexport</tt>' Linkage</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#callingconv">Calling Conventions</a></li>
|
|
<li><a href="#namedtypes">Named Types</a></li>
|
|
<li><a href="#globalvars">Global Variables</a></li>
|
|
<li><a href="#functionstructure">Functions</a></li>
|
|
<li><a href="#aliasstructure">Aliases</a></li>
|
|
<li><a href="#namedmetadatastructure">Named Metadata</a></li>
|
|
<li><a href="#paramattrs">Parameter Attributes</a></li>
|
|
<li><a href="#fnattrs">Function Attributes</a></li>
|
|
<li><a href="#gc">Garbage Collector Names</a></li>
|
|
<li><a href="#moduleasm">Module-Level Inline Assembly</a></li>
|
|
<li><a href="#datalayout">Data Layout</a></li>
|
|
<li><a href="#pointeraliasing">Pointer Aliasing Rules</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#typesystem">Type System</a>
|
|
<ol>
|
|
<li><a href="#t_classifications">Type Classifications</a></li>
|
|
<li><a href="#t_primitive">Primitive Types</a>
|
|
<ol>
|
|
<li><a href="#t_integer">Integer Type</a></li>
|
|
<li><a href="#t_floating">Floating Point Types</a></li>
|
|
<li><a href="#t_void">Void Type</a></li>
|
|
<li><a href="#t_label">Label Type</a></li>
|
|
<li><a href="#t_metadata">Metadata Type</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#t_derived">Derived Types</a>
|
|
<ol>
|
|
<li><a href="#t_array">Array Type</a></li>
|
|
<li><a href="#t_function">Function Type</a></li>
|
|
<li><a href="#t_pointer">Pointer Type</a></li>
|
|
<li><a href="#t_struct">Structure Type</a></li>
|
|
<li><a href="#t_pstruct">Packed Structure Type</a></li>
|
|
<li><a href="#t_vector">Vector Type</a></li>
|
|
<li><a href="#t_opaque">Opaque Type</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#t_uprefs">Type Up-references</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#constants">Constants</a>
|
|
<ol>
|
|
<li><a href="#simpleconstants">Simple Constants</a></li>
|
|
<li><a href="#complexconstants">Complex Constants</a></li>
|
|
<li><a href="#globalconstants">Global Variable and Function Addresses</a></li>
|
|
<li><a href="#undefvalues">Undefined Values</a></li>
|
|
<li><a href="#blockaddress">Addresses of Basic Blocks</a></li>
|
|
<li><a href="#constantexprs">Constant Expressions</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#othervalues">Other Values</a>
|
|
<ol>
|
|
<li><a href="#inlineasm">Inline Assembler Expressions</a></li>
|
|
<li><a href="#metadata">Metadata Nodes and Metadata Strings</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#intrinsic_globals">Intrinsic Global Variables</a>
|
|
<ol>
|
|
<li><a href="#intg_used">The '<tt>llvm.used</tt>' Global Variable</a></li>
|
|
<li><a href="#intg_compiler_used">The '<tt>llvm.compiler.used</tt>'
|
|
Global Variable</a></li>
|
|
<li><a href="#intg_global_ctors">The '<tt>llvm.global_ctors</tt>'
|
|
Global Variable</a></li>
|
|
<li><a href="#intg_global_dtors">The '<tt>llvm.global_dtors</tt>'
|
|
Global Variable</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#instref">Instruction Reference</a>
|
|
<ol>
|
|
<li><a href="#terminators">Terminator Instructions</a>
|
|
<ol>
|
|
<li><a href="#i_ret">'<tt>ret</tt>' Instruction</a></li>
|
|
<li><a href="#i_br">'<tt>br</tt>' Instruction</a></li>
|
|
<li><a href="#i_switch">'<tt>switch</tt>' Instruction</a></li>
|
|
<li><a href="#i_indirectbr">'<tt>indirectbr</tt>' Instruction</a></li>
|
|
<li><a href="#i_invoke">'<tt>invoke</tt>' Instruction</a></li>
|
|
<li><a href="#i_unwind">'<tt>unwind</tt>' Instruction</a></li>
|
|
<li><a href="#i_unreachable">'<tt>unreachable</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#binaryops">Binary Operations</a>
|
|
<ol>
|
|
<li><a href="#i_add">'<tt>add</tt>' Instruction</a></li>
|
|
<li><a href="#i_fadd">'<tt>fadd</tt>' Instruction</a></li>
|
|
<li><a href="#i_sub">'<tt>sub</tt>' Instruction</a></li>
|
|
<li><a href="#i_fsub">'<tt>fsub</tt>' Instruction</a></li>
|
|
<li><a href="#i_mul">'<tt>mul</tt>' Instruction</a></li>
|
|
<li><a href="#i_fmul">'<tt>fmul</tt>' Instruction</a></li>
|
|
<li><a href="#i_udiv">'<tt>udiv</tt>' Instruction</a></li>
|
|
<li><a href="#i_sdiv">'<tt>sdiv</tt>' Instruction</a></li>
|
|
<li><a href="#i_fdiv">'<tt>fdiv</tt>' Instruction</a></li>
|
|
<li><a href="#i_urem">'<tt>urem</tt>' Instruction</a></li>
|
|
<li><a href="#i_srem">'<tt>srem</tt>' Instruction</a></li>
|
|
<li><a href="#i_frem">'<tt>frem</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#bitwiseops">Bitwise Binary Operations</a>
|
|
<ol>
|
|
<li><a href="#i_shl">'<tt>shl</tt>' Instruction</a></li>
|
|
<li><a href="#i_lshr">'<tt>lshr</tt>' Instruction</a></li>
|
|
<li><a href="#i_ashr">'<tt>ashr</tt>' Instruction</a></li>
|
|
<li><a href="#i_and">'<tt>and</tt>' Instruction</a></li>
|
|
<li><a href="#i_or">'<tt>or</tt>' Instruction</a></li>
|
|
<li><a href="#i_xor">'<tt>xor</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#vectorops">Vector Operations</a>
|
|
<ol>
|
|
<li><a href="#i_extractelement">'<tt>extractelement</tt>' Instruction</a></li>
|
|
<li><a href="#i_insertelement">'<tt>insertelement</tt>' Instruction</a></li>
|
|
<li><a href="#i_shufflevector">'<tt>shufflevector</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#aggregateops">Aggregate Operations</a>
|
|
<ol>
|
|
<li><a href="#i_extractvalue">'<tt>extractvalue</tt>' Instruction</a></li>
|
|
<li><a href="#i_insertvalue">'<tt>insertvalue</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#memoryops">Memory Access and Addressing Operations</a>
|
|
<ol>
|
|
<li><a href="#i_alloca">'<tt>alloca</tt>' Instruction</a></li>
|
|
<li><a href="#i_load">'<tt>load</tt>' Instruction</a></li>
|
|
<li><a href="#i_store">'<tt>store</tt>' Instruction</a></li>
|
|
<li><a href="#i_getelementptr">'<tt>getelementptr</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#convertops">Conversion Operations</a>
|
|
<ol>
|
|
<li><a href="#i_trunc">'<tt>trunc .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_zext">'<tt>zext .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_sext">'<tt>sext .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_fptrunc">'<tt>fptrunc .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_fpext">'<tt>fpext .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_fptoui">'<tt>fptoui .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_fptosi">'<tt>fptosi .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_uitofp">'<tt>uitofp .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_sitofp">'<tt>sitofp .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_ptrtoint">'<tt>ptrtoint .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_inttoptr">'<tt>inttoptr .. to</tt>' Instruction</a></li>
|
|
<li><a href="#i_bitcast">'<tt>bitcast .. to</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#otherops">Other Operations</a>
|
|
<ol>
|
|
<li><a href="#i_icmp">'<tt>icmp</tt>' Instruction</a></li>
|
|
<li><a href="#i_fcmp">'<tt>fcmp</tt>' Instruction</a></li>
|
|
<li><a href="#i_phi">'<tt>phi</tt>' Instruction</a></li>
|
|
<li><a href="#i_select">'<tt>select</tt>' Instruction</a></li>
|
|
<li><a href="#i_call">'<tt>call</tt>' Instruction</a></li>
|
|
<li><a href="#i_va_arg">'<tt>va_arg</tt>' Instruction</a></li>
|
|
</ol>
|
|
</li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#intrinsics">Intrinsic Functions</a>
|
|
<ol>
|
|
<li><a href="#int_varargs">Variable Argument Handling Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_va_start">'<tt>llvm.va_start</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_va_end">'<tt>llvm.va_end</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_gc">Accurate Garbage Collection Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_gcroot">'<tt>llvm.gcroot</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_gcread">'<tt>llvm.gcread</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_gcwrite">'<tt>llvm.gcwrite</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_codegen">Code Generator Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_stacksave">'<tt>llvm.stacksave</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_stackrestore">'<tt>llvm.stackrestore</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_prefetch">'<tt>llvm.prefetch</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_pcmarker">'<tt>llvm.pcmarker</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_readcyclecounter"><tt>llvm.readcyclecounter</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_libc">Standard C Library Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_memcpy">'<tt>llvm.memcpy.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_memmove">'<tt>llvm.memmove.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_memset">'<tt>llvm.memset.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_sqrt">'<tt>llvm.sqrt.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_powi">'<tt>llvm.powi.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_sin">'<tt>llvm.sin.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_cos">'<tt>llvm.cos.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_pow">'<tt>llvm.pow.*</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_manip">Bit Manipulation Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_bswap">'<tt>llvm.bswap.*</tt>' Intrinsics</a></li>
|
|
<li><a href="#int_ctpop">'<tt>llvm.ctpop.*</tt>' Intrinsic </a></li>
|
|
<li><a href="#int_ctlz">'<tt>llvm.ctlz.*</tt>' Intrinsic </a></li>
|
|
<li><a href="#int_cttz">'<tt>llvm.cttz.*</tt>' Intrinsic </a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_overflow">Arithmetic with Overflow Intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_sadd_overflow">'<tt>llvm.sadd.with.overflow.*</tt> Intrinsics</a></li>
|
|
<li><a href="#int_uadd_overflow">'<tt>llvm.uadd.with.overflow.*</tt> Intrinsics</a></li>
|
|
<li><a href="#int_ssub_overflow">'<tt>llvm.ssub.with.overflow.*</tt> Intrinsics</a></li>
|
|
<li><a href="#int_usub_overflow">'<tt>llvm.usub.with.overflow.*</tt> Intrinsics</a></li>
|
|
<li><a href="#int_smul_overflow">'<tt>llvm.smul.with.overflow.*</tt> Intrinsics</a></li>
|
|
<li><a href="#int_umul_overflow">'<tt>llvm.umul.with.overflow.*</tt> Intrinsics</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_debugger">Debugger intrinsics</a></li>
|
|
<li><a href="#int_eh">Exception Handling intrinsics</a></li>
|
|
<li><a href="#int_trampoline">Trampoline Intrinsic</a>
|
|
<ol>
|
|
<li><a href="#int_it">'<tt>llvm.init.trampoline</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_atomics">Atomic intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_memory_barrier"><tt>llvm.memory_barrier</tt></a></li>
|
|
<li><a href="#int_atomic_cmp_swap"><tt>llvm.atomic.cmp.swap</tt></a></li>
|
|
<li><a href="#int_atomic_swap"><tt>llvm.atomic.swap</tt></a></li>
|
|
<li><a href="#int_atomic_load_add"><tt>llvm.atomic.load.add</tt></a></li>
|
|
<li><a href="#int_atomic_load_sub"><tt>llvm.atomic.load.sub</tt></a></li>
|
|
<li><a href="#int_atomic_load_and"><tt>llvm.atomic.load.and</tt></a></li>
|
|
<li><a href="#int_atomic_load_nand"><tt>llvm.atomic.load.nand</tt></a></li>
|
|
<li><a href="#int_atomic_load_or"><tt>llvm.atomic.load.or</tt></a></li>
|
|
<li><a href="#int_atomic_load_xor"><tt>llvm.atomic.load.xor</tt></a></li>
|
|
<li><a href="#int_atomic_load_max"><tt>llvm.atomic.load.max</tt></a></li>
|
|
<li><a href="#int_atomic_load_min"><tt>llvm.atomic.load.min</tt></a></li>
|
|
<li><a href="#int_atomic_load_umax"><tt>llvm.atomic.load.umax</tt></a></li>
|
|
<li><a href="#int_atomic_load_umin"><tt>llvm.atomic.load.umin</tt></a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_memorymarkers">Memory Use Markers</a>
|
|
<ol>
|
|
<li><a href="#int_lifetime_start"><tt>llvm.lifetime.start</tt></a></li>
|
|
<li><a href="#int_lifetime_end"><tt>llvm.lifetime.end</tt></a></li>
|
|
<li><a href="#int_invariant_start"><tt>llvm.invariant.start</tt></a></li>
|
|
<li><a href="#int_invariant_end"><tt>llvm.invariant.end</tt></a></li>
|
|
</ol>
|
|
</li>
|
|
<li><a href="#int_general">General intrinsics</a>
|
|
<ol>
|
|
<li><a href="#int_var_annotation">
|
|
'<tt>llvm.var.annotation</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_annotation">
|
|
'<tt>llvm.annotation.*</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_trap">
|
|
'<tt>llvm.trap</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_stackprotector">
|
|
'<tt>llvm.stackprotector</tt>' Intrinsic</a></li>
|
|
<li><a href="#int_objectsize">
|
|
'<tt>llvm.objectsize</tt>' Intrinsic</a></li>
|
|
</ol>
|
|
</li>
|
|
</ol>
|
|
</li>
|
|
</ol>
|
|
|
|
<div class="doc_author">
|
|
<p>Written by <a href="mailto:sabre@nondot.org">Chris Lattner</a>
|
|
and <a href="mailto:vadve@cs.uiuc.edu">Vikram Adve</a></p>
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="abstract">Abstract </a></div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>This document is a reference manual for the LLVM assembly language. LLVM is
|
|
a Static Single Assignment (SSA) based representation that provides type
|
|
safety, low-level operations, flexibility, and the capability of representing
|
|
'all' high-level languages cleanly. It is the common code representation
|
|
used throughout all phases of the LLVM compilation strategy.</p>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="introduction">Introduction</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The LLVM code representation is designed to be used in three different forms:
|
|
as an in-memory compiler IR, as an on-disk bitcode representation (suitable
|
|
for fast loading by a Just-In-Time compiler), and as a human readable
|
|
assembly language representation. This allows LLVM to provide a powerful
|
|
intermediate representation for efficient compiler transformations and
|
|
analysis, while providing a natural means to debug and visualize the
|
|
transformations. The three different forms of LLVM are all equivalent. This
|
|
document describes the human readable representation and notation.</p>
|
|
|
|
<p>The LLVM representation aims to be light-weight and low-level while being
|
|
expressive, typed, and extensible at the same time. It aims to be a
|
|
"universal IR" of sorts, by being at a low enough level that high-level ideas
|
|
may be cleanly mapped to it (similar to how microprocessors are "universal
|
|
IR's", allowing many source languages to be mapped to them). By providing
|
|
type information, LLVM can be used as the target of optimizations: for
|
|
example, through pointer analysis, it can be proven that a C automatic
|
|
variable is never accessed outside of the current function, allowing it to
|
|
be promoted to a simple SSA value instead of a memory location.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="wellformed">Well-Formedness</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>It is important to note that this document describes 'well formed' LLVM
|
|
assembly language. There is a difference between what the parser accepts and
|
|
what is considered 'well formed'. For example, the following instruction is
|
|
syntactically okay, but not well formed:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%x = <a href="#i_add">add</a> i32 1, %x
|
|
</pre>
|
|
</div>
|
|
|
|
<p>because the definition of <tt>%x</tt> does not dominate all of its uses. The
|
|
LLVM infrastructure provides a verification pass that may be used to verify
|
|
that an LLVM module is well formed. This pass is automatically run by the
|
|
parser after parsing input assembly and by the optimizer before it outputs
|
|
bitcode. The violations pointed out by the verifier pass indicate bugs in
|
|
transformation passes or input to the parser.</p>
|
|
|
|
</div>
|
|
|
|
<!-- Describe the typesetting conventions here. -->
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="identifiers">Identifiers</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM identifiers come in two basic types: global and local. Global
|
|
identifiers (functions, global variables) begin with the <tt>'@'</tt>
|
|
character. Local identifiers (register names, types) begin with
|
|
the <tt>'%'</tt> character. Additionally, there are three different formats
|
|
for identifiers, for different purposes:</p>
|
|
|
|
<ol>
|
|
<li>Named values are represented as a string of characters with their prefix.
|
|
For example, <tt>%foo</tt>, <tt>@DivisionByZero</tt>,
|
|
<tt>%a.really.long.identifier</tt>. The actual regular expression used is
|
|
'<tt>[%@][a-zA-Z$._][a-zA-Z$._0-9]*</tt>'. Identifiers which require
|
|
other characters in their names can be surrounded with quotes. Special
|
|
characters may be escaped using <tt>"\xx"</tt> where <tt>xx</tt> is the
|
|
ASCII code for the character in hexadecimal. In this way, any character
|
|
can be used in a name value, even quotes themselves.</li>
|
|
|
|
<li>Unnamed values are represented as an unsigned numeric value with their
|
|
prefix. For example, <tt>%12</tt>, <tt>@2</tt>, <tt>%44</tt>.</li>
|
|
|
|
<li>Constants, which are described in a <a href="#constants">section about
|
|
constants</a>, below.</li>
|
|
</ol>
|
|
|
|
<p>LLVM requires that values start with a prefix for two reasons: Compilers
|
|
don't need to worry about name clashes with reserved words, and the set of
|
|
reserved words may be expanded in the future without penalty. Additionally,
|
|
unnamed identifiers allow a compiler to quickly come up with a temporary
|
|
variable without having to avoid symbol table conflicts.</p>
|
|
|
|
<p>Reserved words in LLVM are very similar to reserved words in other
|
|
languages. There are keywords for different opcodes
|
|
('<tt><a href="#i_add">add</a></tt>',
|
|
'<tt><a href="#i_bitcast">bitcast</a></tt>',
|
|
'<tt><a href="#i_ret">ret</a></tt>', etc...), for primitive type names
|
|
('<tt><a href="#t_void">void</a></tt>',
|
|
'<tt><a href="#t_primitive">i32</a></tt>', etc...), and others. These
|
|
reserved words cannot conflict with variable names, because none of them
|
|
start with a prefix character (<tt>'%'</tt> or <tt>'@'</tt>).</p>
|
|
|
|
<p>Here is an example of LLVM code to multiply the integer variable
|
|
'<tt>%X</tt>' by 8:</p>
|
|
|
|
<p>The easy way:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%result = <a href="#i_mul">mul</a> i32 %X, 8
|
|
</pre>
|
|
</div>
|
|
|
|
<p>After strength reduction:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%result = <a href="#i_shl">shl</a> i32 %X, i8 3
|
|
</pre>
|
|
</div>
|
|
|
|
<p>And the hard way:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%0 = <a href="#i_add">add</a> i32 %X, %X <i>; yields {i32}:%0</i>
|
|
%1 = <a href="#i_add">add</a> i32 %0, %0 <i>; yields {i32}:%1</i>
|
|
%result = <a href="#i_add">add</a> i32 %1, %1
|
|
</pre>
|
|
</div>
|
|
|
|
<p>This last way of multiplying <tt>%X</tt> by 8 illustrates several important
|
|
lexical features of LLVM:</p>
|
|
|
|
<ol>
|
|
<li>Comments are delimited with a '<tt>;</tt>' and go until the end of
|
|
line.</li>
|
|
|
|
<li>Unnamed temporaries are created when the result of a computation is not
|
|
assigned to a named value.</li>
|
|
|
|
<li>Unnamed temporaries are numbered sequentially</li>
|
|
</ol>
|
|
|
|
<p>It also shows a convention that we follow in this document. When
|
|
demonstrating instructions, we will follow an instruction with a comment that
|
|
defines the type and name of value produced. Comments are shown in italic
|
|
text.</p>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="highlevel">High Level Structure</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="modulestructure">Module Structure</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM programs are composed of "Module"s, each of which is a translation unit
|
|
of the input programs. Each module consists of functions, global variables,
|
|
and symbol table entries. Modules may be combined together with the LLVM
|
|
linker, which merges function (and global variable) definitions, resolves
|
|
forward declarations, and merges symbol table entries. Here is an example of
|
|
the "hello world" module:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
<i>; Declare the string constant as a global constant.</i>
|
|
<a href="#identifiers">@.LC0</a> = <a href="#linkage_internal">internal</a> <a href="#globalvars">constant</a> <a href="#t_array">[13 x i8]</a> c"hello world\0A\00" <i>; [13 x i8]*</i>
|
|
|
|
<i>; External declaration of the puts function</i>
|
|
<a href="#functionstructure">declare</a> i32 @puts(i8 *) <i>; i32(i8 *)* </i>
|
|
|
|
<i>; Definition of main function</i>
|
|
define i32 @main() { <i>; i32()* </i>
|
|
<i>; Convert [13 x i8]* to i8 *...</i>
|
|
%cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x i8]* @.LC0, i64 0, i64 0 <i>; i8 *</i>
|
|
|
|
<i>; Call puts function to write out the string to stdout.</i>
|
|
<a href="#i_call">call</a> i32 @puts(i8 * %cast210) <i>; i32</i>
|
|
<a href="#i_ret">ret</a> i32 0<br>}
|
|
|
|
<i>; Named metadata</i>
|
|
!1 = metadata !{i32 41}
|
|
!foo = !{!1, null}
|
|
</pre>
|
|
</div>
|
|
|
|
<p>This example is made up of a <a href="#globalvars">global variable</a> named
|
|
"<tt>.LC0</tt>", an external declaration of the "<tt>puts</tt>" function,
|
|
a <a href="#functionstructure">function definition</a> for
|
|
"<tt>main</tt>" and <a href="#namedmetadatastructure">named metadata</a>
|
|
"<tt>foo"</tt>.</p>
|
|
|
|
<p>In general, a module is made up of a list of global values, where both
|
|
functions and global variables are global values. Global values are
|
|
represented by a pointer to a memory location (in this case, a pointer to an
|
|
array of char, and a pointer to a function), and have one of the
|
|
following <a href="#linkage">linkage types</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="linkage">Linkage Types</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>All Global Variables and Functions have one of the following types of
|
|
linkage:</p>
|
|
|
|
<dl>
|
|
<dt><tt><b><a name="linkage_private">private</a></b></tt></dt>
|
|
<dd>Global values with private linkage are only directly accessible by objects
|
|
in the current module. In particular, linking code into a module with an
|
|
private global value may cause the private to be renamed as necessary to
|
|
avoid collisions. Because the symbol is private to the module, all
|
|
references can be updated. This doesn't show up in any symbol table in the
|
|
object file.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_linker_private">linker_private</a></b></tt></dt>
|
|
<dd>Similar to private, but the symbol is passed through the assembler and
|
|
removed by the linker after evaluation. Note that (unlike private
|
|
symbols) linker_private symbols are subject to coalescing by the linker:
|
|
weak symbols get merged and redefinitions are rejected. However, unlike
|
|
normal strong symbols, they are removed by the linker from the final
|
|
linked image (executable or dynamic library).</dd>
|
|
|
|
<dt><tt><b><a name="linkage_internal">internal</a></b></tt></dt>
|
|
<dd>Similar to private, but the value shows as a local symbol
|
|
(<tt>STB_LOCAL</tt> in the case of ELF) in the object file. This
|
|
corresponds to the notion of the '<tt>static</tt>' keyword in C.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_available_externally">available_externally</a></b></tt></dt>
|
|
<dd>Globals with "<tt>available_externally</tt>" linkage are never emitted
|
|
into the object file corresponding to the LLVM module. They exist to
|
|
allow inlining and other optimizations to take place given knowledge of
|
|
the definition of the global, which is known to be somewhere outside the
|
|
module. Globals with <tt>available_externally</tt> linkage are allowed to
|
|
be discarded at will, and are otherwise the same as <tt>linkonce_odr</tt>.
|
|
This linkage type is only allowed on definitions, not declarations.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_linkonce">linkonce</a></b></tt></dt>
|
|
<dd>Globals with "<tt>linkonce</tt>" linkage are merged with other globals of
|
|
the same name when linkage occurs. This can be used to implement
|
|
some forms of inline functions, templates, or other code which must be
|
|
generated in each translation unit that uses it, but where the body may
|
|
be overridden with a more definitive definition later. Unreferenced
|
|
<tt>linkonce</tt> globals are allowed to be discarded. Note that
|
|
<tt>linkonce</tt> linkage does not actually allow the optimizer to
|
|
inline the body of this function into callers because it doesn't know if
|
|
this definition of the function is the definitive definition within the
|
|
program or whether it will be overridden by a stronger definition.
|
|
To enable inlining and other optimizations, use "<tt>linkonce_odr</tt>"
|
|
linkage.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_weak">weak</a></b></tt></dt>
|
|
<dd>"<tt>weak</tt>" linkage has the same merging semantics as
|
|
<tt>linkonce</tt> linkage, except that unreferenced globals with
|
|
<tt>weak</tt> linkage may not be discarded. This is used for globals that
|
|
are declared "weak" in C source code.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_common">common</a></b></tt></dt>
|
|
<dd>"<tt>common</tt>" linkage is most similar to "<tt>weak</tt>" linkage, but
|
|
they are used for tentative definitions in C, such as "<tt>int X;</tt>" at
|
|
global scope.
|
|
Symbols with "<tt>common</tt>" linkage are merged in the same way as
|
|
<tt>weak symbols</tt>, and they may not be deleted if unreferenced.
|
|
<tt>common</tt> symbols may not have an explicit section,
|
|
must have a zero initializer, and may not be marked '<a
|
|
href="#globalvars"><tt>constant</tt></a>'. Functions and aliases may not
|
|
have common linkage.</dd>
|
|
|
|
|
|
<dt><tt><b><a name="linkage_appending">appending</a></b></tt></dt>
|
|
<dd>"<tt>appending</tt>" linkage may only be applied to global variables of
|
|
pointer to array type. When two global variables with appending linkage
|
|
are linked together, the two global arrays are appended together. This is
|
|
the LLVM, typesafe, equivalent of having the system linker append together
|
|
"sections" with identical names when .o files are linked.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_externweak">extern_weak</a></b></tt></dt>
|
|
<dd>The semantics of this linkage follow the ELF object file model: the symbol
|
|
is weak until linked, if not linked, the symbol becomes null instead of
|
|
being an undefined reference.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_linkonce_odr">linkonce_odr</a></b></tt></dt>
|
|
<dt><tt><b><a name="linkage_weak_odr">weak_odr</a></b></tt></dt>
|
|
<dd>Some languages allow differing globals to be merged, such as two functions
|
|
with different semantics. Other languages, such as <tt>C++</tt>, ensure
|
|
that only equivalent globals are ever merged (the "one definition rule" -
|
|
"ODR"). Such languages can use the <tt>linkonce_odr</tt>
|
|
and <tt>weak_odr</tt> linkage types to indicate that the global will only
|
|
be merged with equivalent globals. These linkage types are otherwise the
|
|
same as their non-<tt>odr</tt> versions.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_external">externally visible</a></b></tt>:</dt>
|
|
<dd>If none of the above identifiers are used, the global is externally
|
|
visible, meaning that it participates in linkage and can be used to
|
|
resolve external symbol references.</dd>
|
|
</dl>
|
|
|
|
<p>The next two types of linkage are targeted for Microsoft Windows platform
|
|
only. They are designed to support importing (exporting) symbols from (to)
|
|
DLLs (Dynamic Link Libraries).</p>
|
|
|
|
<dl>
|
|
<dt><tt><b><a name="linkage_dllimport">dllimport</a></b></tt></dt>
|
|
<dd>"<tt>dllimport</tt>" linkage causes the compiler to reference a function
|
|
or variable via a global pointer to a pointer that is set up by the DLL
|
|
exporting the symbol. On Microsoft Windows targets, the pointer name is
|
|
formed by combining <code>__imp_</code> and the function or variable
|
|
name.</dd>
|
|
|
|
<dt><tt><b><a name="linkage_dllexport">dllexport</a></b></tt></dt>
|
|
<dd>"<tt>dllexport</tt>" linkage causes the compiler to provide a global
|
|
pointer to a pointer in a DLL, so that it can be referenced with the
|
|
<tt>dllimport</tt> attribute. On Microsoft Windows targets, the pointer
|
|
name is formed by combining <code>__imp_</code> and the function or
|
|
variable name.</dd>
|
|
</dl>
|
|
|
|
<p>For example, since the "<tt>.LC0</tt>" variable is defined to be internal, if
|
|
another module defined a "<tt>.LC0</tt>" variable and was linked with this
|
|
one, one of the two would be renamed, preventing a collision. Since
|
|
"<tt>main</tt>" and "<tt>puts</tt>" are external (i.e., lacking any linkage
|
|
declarations), they are accessible outside of the current module.</p>
|
|
|
|
<p>It is illegal for a function <i>declaration</i> to have any linkage type
|
|
other than "externally visible", <tt>dllimport</tt>
|
|
or <tt>extern_weak</tt>.</p>
|
|
|
|
<p>Aliases can have only <tt>external</tt>, <tt>internal</tt>, <tt>weak</tt>
|
|
or <tt>weak_odr</tt> linkages.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="callingconv">Calling Conventions</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM <a href="#functionstructure">functions</a>, <a href="#i_call">calls</a>
|
|
and <a href="#i_invoke">invokes</a> can all have an optional calling
|
|
convention specified for the call. The calling convention of any pair of
|
|
dynamic caller/callee must match, or the behavior of the program is
|
|
undefined. The following calling conventions are supported by LLVM, and more
|
|
may be added in the future:</p>
|
|
|
|
<dl>
|
|
<dt><b>"<tt>ccc</tt>" - The C calling convention</b>:</dt>
|
|
<dd>This calling convention (the default if no other calling convention is
|
|
specified) matches the target C calling conventions. This calling
|
|
convention supports varargs function calls and tolerates some mismatch in
|
|
the declared prototype and implemented declaration of the function (as
|
|
does normal C).</dd>
|
|
|
|
<dt><b>"<tt>fastcc</tt>" - The fast calling convention</b>:</dt>
|
|
<dd>This calling convention attempts to make calls as fast as possible
|
|
(e.g. by passing things in registers). This calling convention allows the
|
|
target to use whatever tricks it wants to produce fast code for the
|
|
target, without having to conform to an externally specified ABI
|
|
(Application Binary Interface).
|
|
<a href="CodeGenerator.html#tailcallopt">Tail calls can only be optimized
|
|
when this convention is used.</a> This calling convention does not
|
|
support varargs and requires the prototype of all callees to exactly match
|
|
the prototype of the function definition.</dd>
|
|
|
|
<dt><b>"<tt>coldcc</tt>" - The cold calling convention</b>:</dt>
|
|
<dd>This calling convention attempts to make code in the caller as efficient
|
|
as possible under the assumption that the call is not commonly executed.
|
|
As such, these calls often preserve all registers so that the call does
|
|
not break any live ranges in the caller side. This calling convention
|
|
does not support varargs and requires the prototype of all callees to
|
|
exactly match the prototype of the function definition.</dd>
|
|
|
|
<dt><b>"<tt>cc <<em>n</em>></tt>" - Numbered convention</b>:</dt>
|
|
<dd>Any calling convention may be specified by number, allowing
|
|
target-specific calling conventions to be used. Target specific calling
|
|
conventions start at 64.</dd>
|
|
</dl>
|
|
|
|
<p>More calling conventions can be added/defined on an as-needed basis, to
|
|
support Pascal conventions or any other well-known target-independent
|
|
convention.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="visibility">Visibility Styles</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>All Global Variables and Functions have one of the following visibility
|
|
styles:</p>
|
|
|
|
<dl>
|
|
<dt><b>"<tt>default</tt>" - Default style</b>:</dt>
|
|
<dd>On targets that use the ELF object file format, default visibility means
|
|
that the declaration is visible to other modules and, in shared libraries,
|
|
means that the declared entity may be overridden. On Darwin, default
|
|
visibility means that the declaration is visible to other modules. Default
|
|
visibility corresponds to "external linkage" in the language.</dd>
|
|
|
|
<dt><b>"<tt>hidden</tt>" - Hidden style</b>:</dt>
|
|
<dd>Two declarations of an object with hidden visibility refer to the same
|
|
object if they are in the same shared object. Usually, hidden visibility
|
|
indicates that the symbol will not be placed into the dynamic symbol
|
|
table, so no other module (executable or shared library) can reference it
|
|
directly.</dd>
|
|
|
|
<dt><b>"<tt>protected</tt>" - Protected style</b>:</dt>
|
|
<dd>On ELF, protected visibility indicates that the symbol will be placed in
|
|
the dynamic symbol table, but that references within the defining module
|
|
will bind to the local symbol. That is, the symbol cannot be overridden by
|
|
another module.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="namedtypes">Named Types</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM IR allows you to specify name aliases for certain types. This can make
|
|
it easier to read the IR and make the IR more condensed (particularly when
|
|
recursive types are involved). An example of a name specification is:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%mytype = type { %mytype*, i32 }
|
|
</pre>
|
|
</div>
|
|
|
|
<p>You may give a name to any <a href="#typesystem">type</a> except
|
|
"<a href="t_void">void</a>". Type name aliases may be used anywhere a type
|
|
is expected with the syntax "%mytype".</p>
|
|
|
|
<p>Note that type names are aliases for the structural type that they indicate,
|
|
and that you can therefore specify multiple names for the same type. This
|
|
often leads to confusing behavior when dumping out a .ll file. Since LLVM IR
|
|
uses structural typing, the name is not part of the type. When printing out
|
|
LLVM IR, the printer will pick <em>one name</em> to render all types of a
|
|
particular shape. This means that if you have code where two different
|
|
source types end up having the same LLVM type, that the dumper will sometimes
|
|
print the "wrong" or unexpected type. This is an important design point and
|
|
isn't going to change.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="globalvars">Global Variables</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Global variables define regions of memory allocated at compilation time
|
|
instead of run-time. Global variables may optionally be initialized, may
|
|
have an explicit section to be placed in, and may have an optional explicit
|
|
alignment specified. A variable may be defined as "thread_local", which
|
|
means that it will not be shared by threads (each thread will have a
|
|
separated copy of the variable). A variable may be defined as a global
|
|
"constant," which indicates that the contents of the variable
|
|
will <b>never</b> be modified (enabling better optimization, allowing the
|
|
global data to be placed in the read-only section of an executable, etc).
|
|
Note that variables that need runtime initialization cannot be marked
|
|
"constant" as there is a store to the variable.</p>
|
|
|
|
<p>LLVM explicitly allows <em>declarations</em> of global variables to be marked
|
|
constant, even if the final definition of the global is not. This capability
|
|
can be used to enable slightly better optimization of the program, but
|
|
requires the language definition to guarantee that optimizations based on the
|
|
'constantness' are valid for the translation units that do not include the
|
|
definition.</p>
|
|
|
|
<p>As SSA values, global variables define pointer values that are in scope
|
|
(i.e. they dominate) all basic blocks in the program. Global variables
|
|
always define a pointer to their "content" type because they describe a
|
|
region of memory, and all memory objects in LLVM are accessed through
|
|
pointers.</p>
|
|
|
|
<p>A global variable may be declared to reside in a target-specific numbered
|
|
address space. For targets that support them, address spaces may affect how
|
|
optimizations are performed and/or what target instructions are used to
|
|
access the variable. The default address space is zero. The address space
|
|
qualifier must precede any other attributes.</p>
|
|
|
|
<p>LLVM allows an explicit section to be specified for globals. If the target
|
|
supports it, it will emit globals to the section specified.</p>
|
|
|
|
<p>An explicit alignment may be specified for a global. If not present, or if
|
|
the alignment is set to zero, the alignment of the global is set by the
|
|
target to whatever it feels convenient. If an explicit alignment is
|
|
specified, the global is forced to have at least that much alignment. All
|
|
alignments must be a power of 2.</p>
|
|
|
|
<p>For example, the following defines a global in a numbered address space with
|
|
an initializer, section, and alignment:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
@G = addrspace(5) constant float 1.0, section "foo", align 4
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="functionstructure">Functions</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM function definitions consist of the "<tt>define</tt>" keyord, an
|
|
optional <a href="#linkage">linkage type</a>, an optional
|
|
<a href="#visibility">visibility style</a>, an optional
|
|
<a href="#callingconv">calling convention</a>, a return type, an optional
|
|
<a href="#paramattrs">parameter attribute</a> for the return type, a function
|
|
name, a (possibly empty) argument list (each with optional
|
|
<a href="#paramattrs">parameter attributes</a>), optional
|
|
<a href="#fnattrs">function attributes</a>, an optional section, an optional
|
|
alignment, an optional <a href="#gc">garbage collector name</a>, an opening
|
|
curly brace, a list of basic blocks, and a closing curly brace.</p>
|
|
|
|
<p>LLVM function declarations consist of the "<tt>declare</tt>" keyword, an
|
|
optional <a href="#linkage">linkage type</a>, an optional
|
|
<a href="#visibility">visibility style</a>, an optional
|
|
<a href="#callingconv">calling convention</a>, a return type, an optional
|
|
<a href="#paramattrs">parameter attribute</a> for the return type, a function
|
|
name, a possibly empty list of arguments, an optional alignment, and an
|
|
optional <a href="#gc">garbage collector name</a>.</p>
|
|
|
|
<p>A function definition contains a list of basic blocks, forming the CFG
|
|
(Control Flow Graph) for the function. Each basic block may optionally start
|
|
with a label (giving the basic block a symbol table entry), contains a list
|
|
of instructions, and ends with a <a href="#terminators">terminator</a>
|
|
instruction (such as a branch or function return).</p>
|
|
|
|
<p>The first basic block in a function is special in two ways: it is immediately
|
|
executed on entrance to the function, and it is not allowed to have
|
|
predecessor basic blocks (i.e. there can not be any branches to the entry
|
|
block of a function). Because the block can have no predecessors, it also
|
|
cannot have any <a href="#i_phi">PHI nodes</a>.</p>
|
|
|
|
<p>LLVM allows an explicit section to be specified for functions. If the target
|
|
supports it, it will emit functions to the section specified.</p>
|
|
|
|
<p>An explicit alignment may be specified for a function. If not present, or if
|
|
the alignment is set to zero, the alignment of the function is set by the
|
|
target to whatever it feels convenient. If an explicit alignment is
|
|
specified, the function is forced to have at least that much alignment. All
|
|
alignments must be a power of 2.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<div class="doc_code">
|
|
<pre>
|
|
define [<a href="#linkage">linkage</a>] [<a href="#visibility">visibility</a>]
|
|
[<a href="#callingconv">cconv</a>] [<a href="#paramattrs">ret attrs</a>]
|
|
<ResultType> @<FunctionName> ([argument list])
|
|
[<a href="#fnattrs">fn Attrs</a>] [section "name"] [align N]
|
|
[<a href="#gc">gc</a>] { ... }
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="aliasstructure">Aliases</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Aliases act as "second name" for the aliasee value (which can be either
|
|
function, global variable, another alias or bitcast of global value). Aliases
|
|
may have an optional <a href="#linkage">linkage type</a>, and an
|
|
optional <a href="#visibility">visibility style</a>.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<div class="doc_code">
|
|
<pre>
|
|
@<Name> = alias [Linkage] [Visibility] <AliaseeTy> @<Aliasee>
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="namedmetadatastructure">Named Metadata</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Named metadata is a collection of metadata. <a href="#metadata">Metadata
|
|
nodes</a> (but not metadata strings) and null are the only valid operands for
|
|
a named metadata.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<div class="doc_code">
|
|
<pre>
|
|
!1 = metadata !{metadata !"one"}
|
|
!name = !{null, !1}
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="paramattrs">Parameter Attributes</a></div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The return type and each parameter of a function type may have a set of
|
|
<i>parameter attributes</i> associated with them. Parameter attributes are
|
|
used to communicate additional information about the result or parameters of
|
|
a function. Parameter attributes are considered to be part of the function,
|
|
not of the function type, so functions with different parameter attributes
|
|
can have the same function type.</p>
|
|
|
|
<p>Parameter attributes are simple keywords that follow the type specified. If
|
|
multiple parameter attributes are needed, they are space separated. For
|
|
example:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
declare i32 @printf(i8* noalias nocapture, ...)
|
|
declare i32 @atoi(i8 zeroext)
|
|
declare signext i8 @returns_signed_char()
|
|
</pre>
|
|
</div>
|
|
|
|
<p>Note that any attributes for the function result (<tt>nounwind</tt>,
|
|
<tt>readonly</tt>) come immediately after the argument list.</p>
|
|
|
|
<p>Currently, only the following parameter attributes are defined:</p>
|
|
|
|
<dl>
|
|
<dt><tt><b>zeroext</b></tt></dt>
|
|
<dd>This indicates to the code generator that the parameter or return value
|
|
should be zero-extended to a 32-bit value by the caller (for a parameter)
|
|
or the callee (for a return value).</dd>
|
|
|
|
<dt><tt><b>signext</b></tt></dt>
|
|
<dd>This indicates to the code generator that the parameter or return value
|
|
should be sign-extended to a 32-bit value by the caller (for a parameter)
|
|
or the callee (for a return value).</dd>
|
|
|
|
<dt><tt><b>inreg</b></tt></dt>
|
|
<dd>This indicates that this parameter or return value should be treated in a
|
|
special target-dependent fashion during while emitting code for a function
|
|
call or return (usually, by putting it in a register as opposed to memory,
|
|
though some targets use it to distinguish between two different kinds of
|
|
registers). Use of this attribute is target-specific.</dd>
|
|
|
|
<dt><tt><b><a name="byval">byval</a></b></tt></dt>
|
|
<dd>This indicates that the pointer parameter should really be passed by value
|
|
to the function. The attribute implies that a hidden copy of the pointee
|
|
is made between the caller and the callee, so the callee is unable to
|
|
modify the value in the callee. This attribute is only valid on LLVM
|
|
pointer arguments. It is generally used to pass structs and arrays by
|
|
value, but is also valid on pointers to scalars. The copy is considered
|
|
to belong to the caller not the callee (for example,
|
|
<tt><a href="#readonly">readonly</a></tt> functions should not write to
|
|
<tt>byval</tt> parameters). This is not a valid attribute for return
|
|
values. The byval attribute also supports specifying an alignment with
|
|
the align attribute. This has a target-specific effect on the code
|
|
generator that usually indicates a desired alignment for the synthesized
|
|
stack slot.</dd>
|
|
|
|
<dt><tt><b>sret</b></tt></dt>
|
|
<dd>This indicates that the pointer parameter specifies the address of a
|
|
structure that is the return value of the function in the source program.
|
|
This pointer must be guaranteed by the caller to be valid: loads and
|
|
stores to the structure may be assumed by the callee to not to trap. This
|
|
may only be applied to the first parameter. This is not a valid attribute
|
|
for return values. </dd>
|
|
|
|
<dt><tt><b>noalias</b></tt></dt>
|
|
<dd>This indicates that the pointer does not alias any global or any other
|
|
parameter. The caller is responsible for ensuring that this is the
|
|
case. On a function return value, <tt>noalias</tt> additionally indicates
|
|
that the pointer does not alias any other pointers visible to the
|
|
caller. For further details, please see the discussion of the NoAlias
|
|
response in
|
|
<a href="http://llvm.org/docs/AliasAnalysis.html#MustMayNo">alias
|
|
analysis</a>.</dd>
|
|
|
|
<dt><tt><b>nocapture</b></tt></dt>
|
|
<dd>This indicates that the callee does not make any copies of the pointer
|
|
that outlive the callee itself. This is not a valid attribute for return
|
|
values.</dd>
|
|
|
|
<dt><tt><b>nest</b></tt></dt>
|
|
<dd>This indicates that the pointer parameter can be excised using the
|
|
<a href="#int_trampoline">trampoline intrinsics</a>. This is not a valid
|
|
attribute for return values.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="gc">Garbage Collector Names</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Each function may specify a garbage collector name, which is simply a
|
|
string:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
define void @f() gc "name" { ... }
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The compiler declares the supported values of <i>name</i>. Specifying a
|
|
collector which will cause the compiler to alter its output in order to
|
|
support the named garbage collection algorithm.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="fnattrs">Function Attributes</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Function attributes are set to communicate additional information about a
|
|
function. Function attributes are considered to be part of the function, not
|
|
of the function type, so functions with different parameter attributes can
|
|
have the same function type.</p>
|
|
|
|
<p>Function attributes are simple keywords that follow the type specified. If
|
|
multiple attributes are needed, they are space separated. For example:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
define void @f() noinline { ... }
|
|
define void @f() alwaysinline { ... }
|
|
define void @f() alwaysinline optsize { ... }
|
|
define void @f() optsize { ... }
|
|
</pre>
|
|
</div>
|
|
|
|
<dl>
|
|
<dt><tt><b>alwaysinline</b></tt></dt>
|
|
<dd>This attribute indicates that the inliner should attempt to inline this
|
|
function into callers whenever possible, ignoring any active inlining size
|
|
threshold for this caller.</dd>
|
|
|
|
<dt><tt><b>noinline</b></tt></dt>
|
|
<dd>This attribute indicates that the inliner should never inline this
|
|
function in any situation. This attribute may not be used together with
|
|
the <tt>alwaysinline</tt> attribute.</dd>
|
|
|
|
<dt><tt><b>optsize</b></tt></dt>
|
|
<dd>This attribute suggests that optimization passes and code generator passes
|
|
make choices that keep the code size of this function low, and otherwise
|
|
do optimizations specifically to reduce code size.</dd>
|
|
|
|
<dt><tt><b>noreturn</b></tt></dt>
|
|
<dd>This function attribute indicates that the function never returns
|
|
normally. This produces undefined behavior at runtime if the function
|
|
ever does dynamically return.</dd>
|
|
|
|
<dt><tt><b>nounwind</b></tt></dt>
|
|
<dd>This function attribute indicates that the function never returns with an
|
|
unwind or exceptional control flow. If the function does unwind, its
|
|
runtime behavior is undefined.</dd>
|
|
|
|
<dt><tt><b>readnone</b></tt></dt>
|
|
<dd>This attribute indicates that the function computes its result (or decides
|
|
to unwind an exception) based strictly on its arguments, without
|
|
dereferencing any pointer arguments or otherwise accessing any mutable
|
|
state (e.g. memory, control registers, etc) visible to caller functions.
|
|
It does not write through any pointer arguments
|
|
(including <tt><a href="#byval">byval</a></tt> arguments) and never
|
|
changes any state visible to callers. This means that it cannot unwind
|
|
exceptions by calling the <tt>C++</tt> exception throwing methods, but
|
|
could use the <tt>unwind</tt> instruction.</dd>
|
|
|
|
<dt><tt><b><a name="readonly">readonly</a></b></tt></dt>
|
|
<dd>This attribute indicates that the function does not write through any
|
|
pointer arguments (including <tt><a href="#byval">byval</a></tt>
|
|
arguments) or otherwise modify any state (e.g. memory, control registers,
|
|
etc) visible to caller functions. It may dereference pointer arguments
|
|
and read state that may be set in the caller. A readonly function always
|
|
returns the same value (or unwinds an exception identically) when called
|
|
with the same set of arguments and global state. It cannot unwind an
|
|
exception by calling the <tt>C++</tt> exception throwing methods, but may
|
|
use the <tt>unwind</tt> instruction.</dd>
|
|
|
|
<dt><tt><b><a name="ssp">ssp</a></b></tt></dt>
|
|
<dd>This attribute indicates that the function should emit a stack smashing
|
|
protector. It is in the form of a "canary"—a random value placed on
|
|
the stack before the local variables that's checked upon return from the
|
|
function to see if it has been overwritten. A heuristic is used to
|
|
determine if a function needs stack protectors or not.<br>
|
|
<br>
|
|
If a function that has an <tt>ssp</tt> attribute is inlined into a
|
|
function that doesn't have an <tt>ssp</tt> attribute, then the resulting
|
|
function will have an <tt>ssp</tt> attribute.</dd>
|
|
|
|
<dt><tt><b>sspreq</b></tt></dt>
|
|
<dd>This attribute indicates that the function should <em>always</em> emit a
|
|
stack smashing protector. This overrides
|
|
the <tt><a href="#ssp">ssp</a></tt> function attribute.<br>
|
|
<br>
|
|
If a function that has an <tt>sspreq</tt> attribute is inlined into a
|
|
function that doesn't have an <tt>sspreq</tt> attribute or which has
|
|
an <tt>ssp</tt> attribute, then the resulting function will have
|
|
an <tt>sspreq</tt> attribute.</dd>
|
|
|
|
<dt><tt><b>noredzone</b></tt></dt>
|
|
<dd>This attribute indicates that the code generator should not use a red
|
|
zone, even if the target-specific ABI normally permits it.</dd>
|
|
|
|
<dt><tt><b>noimplicitfloat</b></tt></dt>
|
|
<dd>This attributes disables implicit floating point instructions.</dd>
|
|
|
|
<dt><tt><b>naked</b></tt></dt>
|
|
<dd>This attribute disables prologue / epilogue emission for the function.
|
|
This can have very system-specific consequences.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="moduleasm">Module-Level Inline Assembly</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Modules may contain "module-level inline asm" blocks, which corresponds to
|
|
the GCC "file scope inline asm" blocks. These blocks are internally
|
|
concatenated by LLVM and treated as a single unit, but may be separated in
|
|
the <tt>.ll</tt> file if desired. The syntax is very simple:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
module asm "inline asm code goes here"
|
|
module asm "more can go here"
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The strings can contain any character by escaping non-printable characters.
|
|
The escape sequence used is simply "\xx" where "xx" is the two digit hex code
|
|
for the number.</p>
|
|
|
|
<p>The inline asm code is simply printed to the machine code .s file when
|
|
assembly code is generated.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="datalayout">Data Layout</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>A module may specify a target specific data layout string that specifies how
|
|
data is to be laid out in memory. The syntax for the data layout is
|
|
simply:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
target datalayout = "<i>layout specification</i>"
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The <i>layout specification</i> consists of a list of specifications
|
|
separated by the minus sign character ('-'). Each specification starts with
|
|
a letter and may include other information after the letter to define some
|
|
aspect of the data layout. The specifications accepted are as follows:</p>
|
|
|
|
<dl>
|
|
<dt><tt>E</tt></dt>
|
|
<dd>Specifies that the target lays out data in big-endian form. That is, the
|
|
bits with the most significance have the lowest address location.</dd>
|
|
|
|
<dt><tt>e</tt></dt>
|
|
<dd>Specifies that the target lays out data in little-endian form. That is,
|
|
the bits with the least significance have the lowest address
|
|
location.</dd>
|
|
|
|
<dt><tt>p:<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the <i>size</i> of a pointer and its <i>abi</i> and
|
|
<i>preferred</i> alignments. All sizes are in bits. Specifying
|
|
the <i>pref</i> alignment is optional. If omitted, the
|
|
preceding <tt>:</tt> should be omitted too.</dd>
|
|
|
|
<dt><tt>i<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the alignment for an integer type of a given bit
|
|
<i>size</i>. The value of <i>size</i> must be in the range [1,2^23).</dd>
|
|
|
|
<dt><tt>v<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the alignment for a vector type of a given bit
|
|
<i>size</i>.</dd>
|
|
|
|
<dt><tt>f<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the alignment for a floating point type of a given bit
|
|
<i>size</i>. The value of <i>size</i> must be either 32 (float) or 64
|
|
(double).</dd>
|
|
|
|
<dt><tt>a<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the alignment for an aggregate type of a given bit
|
|
<i>size</i>.</dd>
|
|
|
|
<dt><tt>s<i>size</i>:<i>abi</i>:<i>pref</i></tt></dt>
|
|
<dd>This specifies the alignment for a stack object of a given bit
|
|
<i>size</i>.</dd>
|
|
|
|
<dt><tt>n<i>size1</i>:<i>size2</i>:<i>size3</i>...</tt></dt>
|
|
<dd>This specifies a set of native integer widths for the target CPU
|
|
in bits. For example, it might contain "n32" for 32-bit PowerPC,
|
|
"n32:64" for PowerPC 64, or "n8:16:32:64" for X86-64. Elements of
|
|
this set are considered to support most general arithmetic
|
|
operations efficiently.</dd>
|
|
</dl>
|
|
|
|
<p>When constructing the data layout for a given target, LLVM starts with a
|
|
default set of specifications which are then (possibly) overriden by the
|
|
specifications in the <tt>datalayout</tt> keyword. The default specifications
|
|
are given in this list:</p>
|
|
|
|
<ul>
|
|
<li><tt>E</tt> - big endian</li>
|
|
<li><tt>p:32:64:64</tt> - 32-bit pointers with 64-bit alignment</li>
|
|
<li><tt>i1:8:8</tt> - i1 is 8-bit (byte) aligned</li>
|
|
<li><tt>i8:8:8</tt> - i8 is 8-bit (byte) aligned</li>
|
|
<li><tt>i16:16:16</tt> - i16 is 16-bit aligned</li>
|
|
<li><tt>i32:32:32</tt> - i32 is 32-bit aligned</li>
|
|
<li><tt>i64:32:64</tt> - i64 has ABI alignment of 32-bits but preferred
|
|
alignment of 64-bits</li>
|
|
<li><tt>f32:32:32</tt> - float is 32-bit aligned</li>
|
|
<li><tt>f64:64:64</tt> - double is 64-bit aligned</li>
|
|
<li><tt>v64:64:64</tt> - 64-bit vector is 64-bit aligned</li>
|
|
<li><tt>v128:128:128</tt> - 128-bit vector is 128-bit aligned</li>
|
|
<li><tt>a0:0:1</tt> - aggregates are 8-bit aligned</li>
|
|
<li><tt>s0:64:64</tt> - stack objects are 64-bit aligned</li>
|
|
</ul>
|
|
|
|
<p>When LLVM is determining the alignment for a given type, it uses the
|
|
following rules:</p>
|
|
|
|
<ol>
|
|
<li>If the type sought is an exact match for one of the specifications, that
|
|
specification is used.</li>
|
|
|
|
<li>If no match is found, and the type sought is an integer type, then the
|
|
smallest integer type that is larger than the bitwidth of the sought type
|
|
is used. If none of the specifications are larger than the bitwidth then
|
|
the the largest integer type is used. For example, given the default
|
|
specifications above, the i7 type will use the alignment of i8 (next
|
|
largest) while both i65 and i256 will use the alignment of i64 (largest
|
|
specified).</li>
|
|
|
|
<li>If no match is found, and the type sought is a vector type, then the
|
|
largest vector type that is smaller than the sought vector type will be
|
|
used as a fall back. This happens because <128 x double> can be
|
|
implemented in terms of 64 <2 x double>, for example.</li>
|
|
</ol>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="pointeraliasing">Pointer Aliasing Rules</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Any memory access must be done through a pointer value associated
|
|
with an address range of the memory access, otherwise the behavior
|
|
is undefined. Pointer values are associated with address ranges
|
|
according to the following rules:</p>
|
|
|
|
<ul>
|
|
<li>A pointer value formed from a
|
|
<tt><a href="#i_getelementptr">getelementptr</a></tt> instruction
|
|
is associated with the addresses associated with the first operand
|
|
of the <tt>getelementptr</tt>.</li>
|
|
<li>An address of a global variable is associated with the address
|
|
range of the variable's storage.</li>
|
|
<li>The result value of an allocation instruction is associated with
|
|
the address range of the allocated storage.</li>
|
|
<li>A null pointer in the default address-space is associated with
|
|
no address.</li>
|
|
<li>A pointer value formed by an
|
|
<tt><a href="#i_inttoptr">inttoptr</a></tt> is associated with all
|
|
address ranges of all pointer values that contribute (directly or
|
|
indirectly) to the computation of the pointer's value.</li>
|
|
<li>The result value of a
|
|
<tt><a href="#i_bitcast">bitcast</a></tt> is associated with all
|
|
addresses associated with the operand of the <tt>bitcast</tt>.</li>
|
|
<li>An integer constant other than zero or a pointer value returned
|
|
from a function not defined within LLVM may be associated with address
|
|
ranges allocated through mechanisms other than those provided by
|
|
LLVM. Such ranges shall not overlap with any ranges of addresses
|
|
allocated by mechanisms provided by LLVM.</li>
|
|
</ul>
|
|
|
|
<p>LLVM IR does not associate types with memory. The result type of a
|
|
<tt><a href="#i_load">load</a></tt> merely indicates the size and
|
|
alignment of the memory from which to load, as well as the
|
|
interpretation of the value. The first operand of a
|
|
<tt><a href="#i_store">store</a></tt> similarly only indicates the size
|
|
and alignment of the store.</p>
|
|
|
|
<p>Consequently, type-based alias analysis, aka TBAA, aka
|
|
<tt>-fstrict-aliasing</tt>, is not applicable to general unadorned
|
|
LLVM IR. <a href="#metadata">Metadata</a> may be used to encode
|
|
additional information which specialized optimization passes may use
|
|
to implement type-based alias analysis.</p>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="typesystem">Type System</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The LLVM type system is one of the most important features of the
|
|
intermediate representation. Being typed enables a number of optimizations
|
|
to be performed on the intermediate representation directly, without having
|
|
to do extra analyses on the side before the transformation. A strong type
|
|
system makes it easier to read the generated code and enables novel analyses
|
|
and transformations that are not feasible to perform on normal three address
|
|
code representations.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="t_classifications">Type
|
|
Classifications</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The types fall into a few useful classifications:</p>
|
|
|
|
<table border="1" cellspacing="0" cellpadding="4">
|
|
<tbody>
|
|
<tr><th>Classification</th><th>Types</th></tr>
|
|
<tr>
|
|
<td><a href="#t_integer">integer</a></td>
|
|
<td><tt>i1, i2, i3, ... i8, ... i16, ... i32, ... i64, ... </tt></td>
|
|
</tr>
|
|
<tr>
|
|
<td><a href="#t_floating">floating point</a></td>
|
|
<td><tt>float, double, x86_fp80, fp128, ppc_fp128</tt></td>
|
|
</tr>
|
|
<tr>
|
|
<td><a name="t_firstclass">first class</a></td>
|
|
<td><a href="#t_integer">integer</a>,
|
|
<a href="#t_floating">floating point</a>,
|
|
<a href="#t_pointer">pointer</a>,
|
|
<a href="#t_vector">vector</a>,
|
|
<a href="#t_struct">structure</a>,
|
|
<a href="#t_array">array</a>,
|
|
<a href="#t_label">label</a>,
|
|
<a href="#t_metadata">metadata</a>.
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a href="#t_primitive">primitive</a></td>
|
|
<td><a href="#t_label">label</a>,
|
|
<a href="#t_void">void</a>,
|
|
<a href="#t_floating">floating point</a>,
|
|
<a href="#t_metadata">metadata</a>.</td>
|
|
</tr>
|
|
<tr>
|
|
<td><a href="#t_derived">derived</a></td>
|
|
<td><a href="#t_integer">integer</a>,
|
|
<a href="#t_array">array</a>,
|
|
<a href="#t_function">function</a>,
|
|
<a href="#t_pointer">pointer</a>,
|
|
<a href="#t_struct">structure</a>,
|
|
<a href="#t_pstruct">packed structure</a>,
|
|
<a href="#t_vector">vector</a>,
|
|
<a href="#t_opaque">opaque</a>.
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<p>The <a href="#t_firstclass">first class</a> types are perhaps the most
|
|
important. Values of these types are the only ones which can be produced by
|
|
instructions.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="t_primitive">Primitive Types</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The primitive types are the fundamental building blocks of the LLVM
|
|
system.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_integer">Integer Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The integer type is a very simple type that simply specifies an arbitrary
|
|
bit width for the integer type desired. Any bit width from 1 bit to
|
|
2<sup>23</sup>-1 (about 8 million) can be specified.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
iN
|
|
</pre>
|
|
|
|
<p>The number of bits the integer will occupy is specified by the <tt>N</tt>
|
|
value.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>i1</tt></td>
|
|
<td class="left">a single-bit integer.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>i32</tt></td>
|
|
<td class="left">a 32-bit integer.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>i1942652</tt></td>
|
|
<td class="left">a really big integer of over 1 million bits.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_floating">Floating Point Types</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<table>
|
|
<tbody>
|
|
<tr><th>Type</th><th>Description</th></tr>
|
|
<tr><td><tt>float</tt></td><td>32-bit floating point value</td></tr>
|
|
<tr><td><tt>double</tt></td><td>64-bit floating point value</td></tr>
|
|
<tr><td><tt>fp128</tt></td><td>128-bit floating point value (112-bit mantissa)</td></tr>
|
|
<tr><td><tt>x86_fp80</tt></td><td>80-bit floating point value (X87)</td></tr>
|
|
<tr><td><tt>ppc_fp128</tt></td><td>128-bit floating point value (two 64-bits)</td></tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_void">Void Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The void type does not represent any value and has no size.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
void
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_label">Label Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The label type represents code labels.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
label
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_metadata">Metadata Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The metadata type represents embedded metadata. No derived types may be
|
|
created from metadata except for <a href="#t_function">function</a>
|
|
arguments.
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
metadata
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="t_derived">Derived Types</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The real power in LLVM comes from the derived types in the system. This is
|
|
what allows a programmer to represent arrays, functions, pointers, and other
|
|
useful types. Each of these types contain one or more element types which
|
|
may be a primitive type, or another derived type. For example, it is
|
|
possible to have a two dimensional array, using an array as the element type
|
|
of another array.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_array">Array Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The array type is a very simple derived type that arranges elements
|
|
sequentially in memory. The array type requires a size (number of elements)
|
|
and an underlying data type.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
[<# elements> x <elementtype>]
|
|
</pre>
|
|
|
|
<p>The number of elements is a constant integer value; <tt>elementtype</tt> may
|
|
be any type with a size.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>[40 x i32]</tt></td>
|
|
<td class="left">Array of 40 32-bit integer values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>[41 x i32]</tt></td>
|
|
<td class="left">Array of 41 32-bit integer values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>[4 x i8]</tt></td>
|
|
<td class="left">Array of 4 8-bit integer values.</td>
|
|
</tr>
|
|
</table>
|
|
<p>Here are some examples of multidimensional arrays:</p>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>[3 x [4 x i32]]</tt></td>
|
|
<td class="left">3x4 array of 32-bit integer values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>[12 x [10 x float]]</tt></td>
|
|
<td class="left">12x10 array of single precision floating point values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>[2 x [3 x [4 x i16]]]</tt></td>
|
|
<td class="left">2x3x4 array of 16-bit integer values.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<p>There is no restriction on indexing beyond the end of the array implied by
|
|
a static type (though there are restrictions on indexing beyond the bounds
|
|
of an allocated object in some cases). This means that single-dimension
|
|
'variable sized array' addressing can be implemented in LLVM with a zero
|
|
length array type. An implementation of 'pascal style arrays' in LLVM could
|
|
use the type "<tt>{ i32, [0 x float]}</tt>", for example.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_function">Function Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The function type can be thought of as a function signature. It consists of
|
|
a return type and a list of formal parameter types. The return type of a
|
|
function type is a scalar type, a void type, or a struct type. If the return
|
|
type is a struct type then all struct elements must be of first class types,
|
|
and the struct must have at least one element.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<returntype> (<parameter list>)
|
|
</pre>
|
|
|
|
<p>...where '<tt><parameter list></tt>' is a comma-separated list of type
|
|
specifiers. Optionally, the parameter list may include a type <tt>...</tt>,
|
|
which indicates that the function takes a variable number of arguments.
|
|
Variable argument functions can access their arguments with
|
|
the <a href="#int_varargs">variable argument handling intrinsic</a>
|
|
functions. '<tt><returntype></tt>' is a any type except
|
|
<a href="#t_label">label</a>.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>i32 (i32)</tt></td>
|
|
<td class="left">function taking an <tt>i32</tt>, returning an <tt>i32</tt>
|
|
</td>
|
|
</tr><tr class="layout">
|
|
<td class="left"><tt>float (i16 signext, i32 *) *
|
|
</tt></td>
|
|
<td class="left"><a href="#t_pointer">Pointer</a> to a function that takes
|
|
an <tt>i16</tt> that should be sign extended and a
|
|
<a href="#t_pointer">pointer</a> to <tt>i32</tt>, returning
|
|
<tt>float</tt>.
|
|
</td>
|
|
</tr><tr class="layout">
|
|
<td class="left"><tt>i32 (i8*, ...)</tt></td>
|
|
<td class="left">A vararg function that takes at least one
|
|
<a href="#t_pointer">pointer</a> to <tt>i8 </tt> (char in C),
|
|
which returns an integer. This is the signature for <tt>printf</tt> in
|
|
LLVM.
|
|
</td>
|
|
</tr><tr class="layout">
|
|
<td class="left"><tt>{i32, i32} (i32)</tt></td>
|
|
<td class="left">A function taking an <tt>i32</tt>, returning a
|
|
<a href="#t_struct">structure</a> containing two <tt>i32</tt> values
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_struct">Structure Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The structure type is used to represent a collection of data members together
|
|
in memory. The packing of the field types is defined to match the ABI of the
|
|
underlying processor. The elements of a structure may be any type that has a
|
|
size.</p>
|
|
|
|
<p>Structures in memory are accessed using '<tt><a href="#i_load">load</a></tt>'
|
|
and '<tt><a href="#i_store">store</a></tt>' by getting a pointer to a field
|
|
with the '<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.
|
|
Structures in registers are accessed using the
|
|
'<tt><a href="#i_extractvalue">extractvalue</a></tt>' and
|
|
'<tt><a href="#i_insertvalue">insertvalue</a></tt>' instructions.</p>
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
{ <type list> }
|
|
</pre>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>{ i32, i32, i32 }</tt></td>
|
|
<td class="left">A triple of three <tt>i32</tt> values</td>
|
|
</tr><tr class="layout">
|
|
<td class="left"><tt>{ float, i32 (i32) * }</tt></td>
|
|
<td class="left">A pair, where the first element is a <tt>float</tt> and the
|
|
second element is a <a href="#t_pointer">pointer</a> to a
|
|
<a href="#t_function">function</a> that takes an <tt>i32</tt>, returning
|
|
an <tt>i32</tt>.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_pstruct">Packed Structure Type</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The packed structure type is used to represent a collection of data members
|
|
together in memory. There is no padding between fields. Further, the
|
|
alignment of a packed structure is 1 byte. The elements of a packed
|
|
structure may be any type that has a size.</p>
|
|
|
|
<p>Structures are accessed using '<tt><a href="#i_load">load</a></tt> and
|
|
'<tt><a href="#i_store">store</a></tt>' by getting a pointer to a field with
|
|
the '<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
< { <type list> } >
|
|
</pre>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>< { i32, i32, i32 } ></tt></td>
|
|
<td class="left">A triple of three <tt>i32</tt> values</td>
|
|
</tr><tr class="layout">
|
|
<td class="left">
|
|
<tt>< { float, i32 (i32)* } ></tt></td>
|
|
<td class="left">A pair, where the first element is a <tt>float</tt> and the
|
|
second element is a <a href="#t_pointer">pointer</a> to a
|
|
<a href="#t_function">function</a> that takes an <tt>i32</tt>, returning
|
|
an <tt>i32</tt>.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_pointer">Pointer Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>As in many languages, the pointer type represents a pointer or reference to
|
|
another object, which must live in memory. Pointer types may have an optional
|
|
address space attribute defining the target-specific numbered address space
|
|
where the pointed-to object resides. The default address space is zero.</p>
|
|
|
|
<p>Note that LLVM does not permit pointers to void (<tt>void*</tt>) nor does it
|
|
permit pointers to labels (<tt>label*</tt>). Use <tt>i8*</tt> instead.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<type> *
|
|
</pre>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>[4 x i32]*</tt></td>
|
|
<td class="left">A <a href="#t_pointer">pointer</a> to <a
|
|
href="#t_array">array</a> of four <tt>i32</tt> values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>i32 (i32 *) *</tt></td>
|
|
<td class="left"> A <a href="#t_pointer">pointer</a> to a <a
|
|
href="#t_function">function</a> that takes an <tt>i32*</tt>, returning an
|
|
<tt>i32</tt>.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>i32 addrspace(5)*</tt></td>
|
|
<td class="left">A <a href="#t_pointer">pointer</a> to an <tt>i32</tt> value
|
|
that resides in address space #5.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_vector">Vector Type</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>A vector type is a simple derived type that represents a vector of elements.
|
|
Vector types are used when multiple primitive data are operated in parallel
|
|
using a single instruction (SIMD). A vector type requires a size (number of
|
|
elements) and an underlying primitive data type. Vector types are considered
|
|
<a href="#t_firstclass">first class</a>.</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
< <# elements> x <elementtype> >
|
|
</pre>
|
|
|
|
<p>The number of elements is a constant integer value; elementtype may be any
|
|
integer or floating point type.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt><4 x i32></tt></td>
|
|
<td class="left">Vector of 4 32-bit integer values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt><8 x float></tt></td>
|
|
<td class="left">Vector of 8 32-bit floating-point values.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt><2 x i64></tt></td>
|
|
<td class="left">Vector of 2 64-bit integer values.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="t_opaque">Opaque Type</a> </div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>Opaque types are used to represent unknown types in the system. This
|
|
corresponds (for example) to the C notion of a forward declared structure
|
|
type. In LLVM, opaque types can eventually be resolved to any type (not just
|
|
a structure type).</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
opaque
|
|
</pre>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>opaque</tt></td>
|
|
<td class="left">An opaque type.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="t_uprefs">Type Up-references</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Overview:</h5>
|
|
<p>An "up reference" allows you to refer to a lexically enclosing type without
|
|
requiring it to have a name. For instance, a structure declaration may
|
|
contain a pointer to any of the types it is lexically a member of. Example
|
|
of up references (with their equivalent as named type declarations)
|
|
include:</p>
|
|
|
|
<pre>
|
|
{ \2 * } %x = type { %x* }
|
|
{ \2 }* %y = type { %y }*
|
|
\1* %z = type %z*
|
|
</pre>
|
|
|
|
<p>An up reference is needed by the asmprinter for printing out cyclic types
|
|
when there is no declared name for a type in the cycle. Because the
|
|
asmprinter does not want to print out an infinite type string, it needs a
|
|
syntax to handle recursive types that have no names (all names are optional
|
|
in llvm IR).</p>
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
\<level>
|
|
</pre>
|
|
|
|
<p>The level is the count of the lexical type that is being referred to.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<table class="layout">
|
|
<tr class="layout">
|
|
<td class="left"><tt>\1*</tt></td>
|
|
<td class="left">Self-referential pointer.</td>
|
|
</tr>
|
|
<tr class="layout">
|
|
<td class="left"><tt>{ { \3*, i8 }, i32 }</tt></td>
|
|
<td class="left">Recursive structure where the upref refers to the out-most
|
|
structure.</td>
|
|
</tr>
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="constants">Constants</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM has several different basic types of constants. This section describes
|
|
them all and their syntax.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="simpleconstants">Simple Constants</a></div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<dl>
|
|
<dt><b>Boolean constants</b></dt>
|
|
<dd>The two strings '<tt>true</tt>' and '<tt>false</tt>' are both valid
|
|
constants of the <tt><a href="#t_integer">i1</a></tt> type.</dd>
|
|
|
|
<dt><b>Integer constants</b></dt>
|
|
<dd>Standard integers (such as '4') are constants of
|
|
the <a href="#t_integer">integer</a> type. Negative numbers may be used
|
|
with integer types.</dd>
|
|
|
|
<dt><b>Floating point constants</b></dt>
|
|
<dd>Floating point constants use standard decimal notation (e.g. 123.421),
|
|
exponential notation (e.g. 1.23421e+2), or a more precise hexadecimal
|
|
notation (see below). The assembler requires the exact decimal value of a
|
|
floating-point constant. For example, the assembler accepts 1.25 but
|
|
rejects 1.3 because 1.3 is a repeating decimal in binary. Floating point
|
|
constants must have a <a href="#t_floating">floating point</a> type. </dd>
|
|
|
|
<dt><b>Null pointer constants</b></dt>
|
|
<dd>The identifier '<tt>null</tt>' is recognized as a null pointer constant
|
|
and must be of <a href="#t_pointer">pointer type</a>.</dd>
|
|
</dl>
|
|
|
|
<p>The one non-intuitive notation for constants is the hexadecimal form of
|
|
floating point constants. For example, the form '<tt>double
|
|
0x432ff973cafa8000</tt>' is equivalent to (but harder to read than)
|
|
'<tt>double 4.5e+15</tt>'. The only time hexadecimal floating point
|
|
constants are required (and the only time that they are generated by the
|
|
disassembler) is when a floating point constant must be emitted but it cannot
|
|
be represented as a decimal floating point number in a reasonable number of
|
|
digits. For example, NaN's, infinities, and other special values are
|
|
represented in their IEEE hexadecimal format so that assembly and disassembly
|
|
do not cause any bits to change in the constants.</p>
|
|
|
|
<p>When using the hexadecimal form, constants of types float and double are
|
|
represented using the 16-digit form shown above (which matches the IEEE754
|
|
representation for double); float values must, however, be exactly
|
|
representable as IEE754 single precision. Hexadecimal format is always used
|
|
for long double, and there are three forms of long double. The 80-bit format
|
|
used by x86 is represented as <tt>0xK</tt> followed by 20 hexadecimal digits.
|
|
The 128-bit format used by PowerPC (two adjacent doubles) is represented
|
|
by <tt>0xM</tt> followed by 32 hexadecimal digits. The IEEE 128-bit format
|
|
is represented by <tt>0xL</tt> followed by 32 hexadecimal digits; no
|
|
currently supported target uses this format. Long doubles will only work if
|
|
they match the long double format on your target. All hexadecimal formats
|
|
are big-endian (sign bit at the left).</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="aggregateconstants"></a> <!-- old anchor -->
|
|
<a name="complexconstants">Complex Constants</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Complex constants are a (potentially recursive) combination of simple
|
|
constants and smaller complex constants.</p>
|
|
|
|
<dl>
|
|
<dt><b>Structure constants</b></dt>
|
|
<dd>Structure constants are represented with notation similar to structure
|
|
type definitions (a comma separated list of elements, surrounded by braces
|
|
(<tt>{}</tt>)). For example: "<tt>{ i32 4, float 17.0, i32* @G }</tt>",
|
|
where "<tt>@G</tt>" is declared as "<tt>@G = external global i32</tt>".
|
|
Structure constants must have <a href="#t_struct">structure type</a>, and
|
|
the number and types of elements must match those specified by the
|
|
type.</dd>
|
|
|
|
<dt><b>Array constants</b></dt>
|
|
<dd>Array constants are represented with notation similar to array type
|
|
definitions (a comma separated list of elements, surrounded by square
|
|
brackets (<tt>[]</tt>)). For example: "<tt>[ i32 42, i32 11, i32 74
|
|
]</tt>". Array constants must have <a href="#t_array">array type</a>, and
|
|
the number and types of elements must match those specified by the
|
|
type.</dd>
|
|
|
|
<dt><b>Vector constants</b></dt>
|
|
<dd>Vector constants are represented with notation similar to vector type
|
|
definitions (a comma separated list of elements, surrounded by
|
|
less-than/greater-than's (<tt><></tt>)). For example: "<tt>< i32
|
|
42, i32 11, i32 74, i32 100 ></tt>". Vector constants must
|
|
have <a href="#t_vector">vector type</a>, and the number and types of
|
|
elements must match those specified by the type.</dd>
|
|
|
|
<dt><b>Zero initialization</b></dt>
|
|
<dd>The string '<tt>zeroinitializer</tt>' can be used to zero initialize a
|
|
value to zero of <em>any</em> type, including scalar and aggregate types.
|
|
This is often used to avoid having to print large zero initializers
|
|
(e.g. for large arrays) and is always exactly equivalent to using explicit
|
|
zero initializers.</dd>
|
|
|
|
<dt><b>Metadata node</b></dt>
|
|
<dd>A metadata node is a structure-like constant with
|
|
<a href="#t_metadata">metadata type</a>. For example: "<tt>metadata !{
|
|
i32 0, metadata !"test" }</tt>". Unlike other constants that are meant to
|
|
be interpreted as part of the instruction stream, metadata is a place to
|
|
attach additional information such as debug info.</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="globalconstants">Global Variable and Function Addresses</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The addresses of <a href="#globalvars">global variables</a>
|
|
and <a href="#functionstructure">functions</a> are always implicitly valid
|
|
(link-time) constants. These constants are explicitly referenced when
|
|
the <a href="#identifiers">identifier for the global</a> is used and always
|
|
have <a href="#t_pointer">pointer</a> type. For example, the following is a
|
|
legal LLVM file:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
@X = global i32 17
|
|
@Y = global i32 42
|
|
@Z = global [2 x i32*] [ i32* @X, i32* @Y ]
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="undefvalues">Undefined Values</a></div>
|
|
<div class="doc_text">
|
|
|
|
<p>The string '<tt>undef</tt>' can be used anywhere a constant is expected, and
|
|
indicates that the user of the value may receive an unspecified bit-pattern.
|
|
Undefined values may be of any type (other than label or void) and be used
|
|
anywhere a constant is permitted.</p>
|
|
|
|
<p>Undefined values are useful because they indicate to the compiler that the
|
|
program is well defined no matter what value is used. This gives the
|
|
compiler more freedom to optimize. Here are some examples of (potentially
|
|
surprising) transformations that are valid (in pseudo IR):</p>
|
|
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%A = add %X, undef
|
|
%B = sub %X, undef
|
|
%C = xor %X, undef
|
|
Safe:
|
|
%A = undef
|
|
%B = undef
|
|
%C = undef
|
|
</pre>
|
|
</div>
|
|
|
|
<p>This is safe because all of the output bits are affected by the undef bits.
|
|
Any output bit can have a zero or one depending on the input bits.</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%A = or %X, undef
|
|
%B = and %X, undef
|
|
Safe:
|
|
%A = -1
|
|
%B = 0
|
|
Unsafe:
|
|
%A = undef
|
|
%B = undef
|
|
</pre>
|
|
</div>
|
|
|
|
<p>These logical operations have bits that are not always affected by the input.
|
|
For example, if "%X" has a zero bit, then the output of the 'and' operation will
|
|
always be a zero, no matter what the corresponding bit from the undef is. As
|
|
such, it is unsafe to optimize or assume that the result of the and is undef.
|
|
However, it is safe to assume that all bits of the undef could be 0, and
|
|
optimize the and to 0. Likewise, it is safe to assume that all the bits of
|
|
the undef operand to the or could be set, allowing the or to be folded to
|
|
-1.</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%A = select undef, %X, %Y
|
|
%B = select undef, 42, %Y
|
|
%C = select %X, %Y, undef
|
|
Safe:
|
|
%A = %X (or %Y)
|
|
%B = 42 (or %Y)
|
|
%C = %Y
|
|
Unsafe:
|
|
%A = undef
|
|
%B = undef
|
|
%C = undef
|
|
</pre>
|
|
</div>
|
|
|
|
<p>This set of examples show that undefined select (and conditional branch)
|
|
conditions can go "either way" but they have to come from one of the two
|
|
operands. In the %A example, if %X and %Y were both known to have a clear low
|
|
bit, then %A would have to have a cleared low bit. However, in the %C example,
|
|
the optimizer is allowed to assume that the undef operand could be the same as
|
|
%Y, allowing the whole select to be eliminated.</p>
|
|
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%A = xor undef, undef
|
|
|
|
%B = undef
|
|
%C = xor %B, %B
|
|
|
|
%D = undef
|
|
%E = icmp lt %D, 4
|
|
%F = icmp gte %D, 4
|
|
|
|
Safe:
|
|
%A = undef
|
|
%B = undef
|
|
%C = undef
|
|
%D = undef
|
|
%E = undef
|
|
%F = undef
|
|
</pre>
|
|
</div>
|
|
|
|
<p>This example points out that two undef operands are not necessarily the same.
|
|
This can be surprising to people (and also matches C semantics) where they
|
|
assume that "X^X" is always zero, even if X is undef. This isn't true for a
|
|
number of reasons, but the short answer is that an undef "variable" can
|
|
arbitrarily change its value over its "live range". This is true because the
|
|
"variable" doesn't actually <em>have a live range</em>. Instead, the value is
|
|
logically read from arbitrary registers that happen to be around when needed,
|
|
so the value is not necessarily consistent over time. In fact, %A and %C need
|
|
to have the same semantics or the core LLVM "replace all uses with" concept
|
|
would not hold.</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%A = fdiv undef, %X
|
|
%B = fdiv %X, undef
|
|
Safe:
|
|
%A = undef
|
|
b: unreachable
|
|
</pre>
|
|
</div>
|
|
|
|
<p>These examples show the crucial difference between an <em>undefined
|
|
value</em> and <em>undefined behavior</em>. An undefined value (like undef) is
|
|
allowed to have an arbitrary bit-pattern. This means that the %A operation
|
|
can be constant folded to undef because the undef could be an SNaN, and fdiv is
|
|
not (currently) defined on SNaN's. However, in the second example, we can make
|
|
a more aggressive assumption: because the undef is allowed to be an arbitrary
|
|
value, we are allowed to assume that it could be zero. Since a divide by zero
|
|
has <em>undefined behavior</em>, we are allowed to assume that the operation
|
|
does not execute at all. This allows us to delete the divide and all code after
|
|
it: since the undefined operation "can't happen", the optimizer can assume that
|
|
it occurs in dead code.
|
|
</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
a: store undef -> %X
|
|
b: store %X -> undef
|
|
Safe:
|
|
a: <deleted>
|
|
b: unreachable
|
|
</pre>
|
|
</div>
|
|
|
|
<p>These examples reiterate the fdiv example: a store "of" an undefined value
|
|
can be assumed to not have any effect: we can assume that the value is
|
|
overwritten with bits that happen to match what was already there. However, a
|
|
store "to" an undefined location could clobber arbitrary memory, therefore, it
|
|
has undefined behavior.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="blockaddress">Addresses of Basic
|
|
Blocks</a></div>
|
|
<div class="doc_text">
|
|
|
|
<p><b><tt>blockaddress(@function, %block)</tt></b></p>
|
|
|
|
<p>The '<tt>blockaddress</tt>' constant computes the address of the specified
|
|
basic block in the specified function, and always has an i8* type. Taking
|
|
the address of the entry block is illegal.</p>
|
|
|
|
<p>This value only has defined behavior when used as an operand to the
|
|
'<a href="#i_indirectbr"><tt>indirectbr</tt></a>' instruction or for comparisons
|
|
against null. Pointer equality tests between labels addresses is undefined
|
|
behavior - though, again, comparison against null is ok, and no label is
|
|
equal to the null pointer. This may also be passed around as an opaque
|
|
pointer sized value as long as the bits are not inspected. This allows
|
|
<tt>ptrtoint</tt> and arithmetic to be performed on these values so long as
|
|
the original value is reconstituted before the <tt>indirectbr</tt>.</p>
|
|
|
|
<p>Finally, some targets may provide defined semantics when
|
|
using the value as the operand to an inline assembly, but that is target
|
|
specific.
|
|
</p>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="constantexprs">Constant Expressions</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Constant expressions are used to allow expressions involving other constants
|
|
to be used as constants. Constant expressions may be of
|
|
any <a href="#t_firstclass">first class</a> type and may involve any LLVM
|
|
operation that does not have side effects (e.g. load and call are not
|
|
supported). The following is the syntax for constant expressions:</p>
|
|
|
|
<dl>
|
|
<dt><b><tt>trunc ( CST to TYPE )</tt></b></dt>
|
|
<dd>Truncate a constant to another type. The bit size of CST must be larger
|
|
than the bit size of TYPE. Both types must be integers.</dd>
|
|
|
|
<dt><b><tt>zext ( CST to TYPE )</tt></b></dt>
|
|
<dd>Zero extend a constant to another type. The bit size of CST must be
|
|
smaller or equal to the bit size of TYPE. Both types must be
|
|
integers.</dd>
|
|
|
|
<dt><b><tt>sext ( CST to TYPE )</tt></b></dt>
|
|
<dd>Sign extend a constant to another type. The bit size of CST must be
|
|
smaller or equal to the bit size of TYPE. Both types must be
|
|
integers.</dd>
|
|
|
|
<dt><b><tt>fptrunc ( CST to TYPE )</tt></b></dt>
|
|
<dd>Truncate a floating point constant to another floating point type. The
|
|
size of CST must be larger than the size of TYPE. Both types must be
|
|
floating point.</dd>
|
|
|
|
<dt><b><tt>fpext ( CST to TYPE )</tt></b></dt>
|
|
<dd>Floating point extend a constant to another type. The size of CST must be
|
|
smaller or equal to the size of TYPE. Both types must be floating
|
|
point.</dd>
|
|
|
|
<dt><b><tt>fptoui ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a floating point constant to the corresponding unsigned integer
|
|
constant. TYPE must be a scalar or vector integer type. CST must be of
|
|
scalar or vector floating point type. Both CST and TYPE must be scalars,
|
|
or vectors of the same number of elements. If the value won't fit in the
|
|
integer type, the results are undefined.</dd>
|
|
|
|
<dt><b><tt>fptosi ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a floating point constant to the corresponding signed integer
|
|
constant. TYPE must be a scalar or vector integer type. CST must be of
|
|
scalar or vector floating point type. Both CST and TYPE must be scalars,
|
|
or vectors of the same number of elements. If the value won't fit in the
|
|
integer type, the results are undefined.</dd>
|
|
|
|
<dt><b><tt>uitofp ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert an unsigned integer constant to the corresponding floating point
|
|
constant. TYPE must be a scalar or vector floating point type. CST must be
|
|
of scalar or vector integer type. Both CST and TYPE must be scalars, or
|
|
vectors of the same number of elements. If the value won't fit in the
|
|
floating point type, the results are undefined.</dd>
|
|
|
|
<dt><b><tt>sitofp ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a signed integer constant to the corresponding floating point
|
|
constant. TYPE must be a scalar or vector floating point type. CST must be
|
|
of scalar or vector integer type. Both CST and TYPE must be scalars, or
|
|
vectors of the same number of elements. If the value won't fit in the
|
|
floating point type, the results are undefined.</dd>
|
|
|
|
<dt><b><tt>ptrtoint ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a pointer typed constant to the corresponding integer constant
|
|
<tt>TYPE</tt> must be an integer type. <tt>CST</tt> must be of pointer
|
|
type. The <tt>CST</tt> value is zero extended, truncated, or unchanged to
|
|
make it fit in <tt>TYPE</tt>.</dd>
|
|
|
|
<dt><b><tt>inttoptr ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a integer constant to a pointer constant. TYPE must be a pointer
|
|
type. CST must be of integer type. The CST value is zero extended,
|
|
truncated, or unchanged to make it fit in a pointer size. This one is
|
|
<i>really</i> dangerous!</dd>
|
|
|
|
<dt><b><tt>bitcast ( CST to TYPE )</tt></b></dt>
|
|
<dd>Convert a constant, CST, to another TYPE. The constraints of the operands
|
|
are the same as those for the <a href="#i_bitcast">bitcast
|
|
instruction</a>.</dd>
|
|
|
|
<dt><b><tt>getelementptr ( CSTPTR, IDX0, IDX1, ... )</tt></b></dt>
|
|
<dt><b><tt>getelementptr inbounds ( CSTPTR, IDX0, IDX1, ... )</tt></b></dt>
|
|
<dd>Perform the <a href="#i_getelementptr">getelementptr operation</a> on
|
|
constants. As with the <a href="#i_getelementptr">getelementptr</a>
|
|
instruction, the index list may have zero or more indexes, which are
|
|
required to make sense for the type of "CSTPTR".</dd>
|
|
|
|
<dt><b><tt>select ( COND, VAL1, VAL2 )</tt></b></dt>
|
|
<dd>Perform the <a href="#i_select">select operation</a> on constants.</dd>
|
|
|
|
<dt><b><tt>icmp COND ( VAL1, VAL2 )</tt></b></dt>
|
|
<dd>Performs the <a href="#i_icmp">icmp operation</a> on constants.</dd>
|
|
|
|
<dt><b><tt>fcmp COND ( VAL1, VAL2 )</tt></b></dt>
|
|
<dd>Performs the <a href="#i_fcmp">fcmp operation</a> on constants.</dd>
|
|
|
|
<dt><b><tt>extractelement ( VAL, IDX )</tt></b></dt>
|
|
<dd>Perform the <a href="#i_extractelement">extractelement operation</a> on
|
|
constants.</dd>
|
|
|
|
<dt><b><tt>insertelement ( VAL, ELT, IDX )</tt></b></dt>
|
|
<dd>Perform the <a href="#i_insertelement">insertelement operation</a> on
|
|
constants.</dd>
|
|
|
|
<dt><b><tt>shufflevector ( VEC1, VEC2, IDXMASK )</tt></b></dt>
|
|
<dd>Perform the <a href="#i_shufflevector">shufflevector operation</a> on
|
|
constants.</dd>
|
|
|
|
<dt><b><tt>OPCODE ( LHS, RHS )</tt></b></dt>
|
|
<dd>Perform the specified operation of the LHS and RHS constants. OPCODE may
|
|
be any of the <a href="#binaryops">binary</a>
|
|
or <a href="#bitwiseops">bitwise binary</a> operations. The constraints
|
|
on operands are the same as those for the corresponding instruction
|
|
(e.g. no bitwise operations on floating point values are allowed).</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="othervalues">Other Values</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="inlineasm">Inline Assembler Expressions</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM supports inline assembler expressions (as opposed
|
|
to <a href="#moduleasm"> Module-Level Inline Assembly</a>) through the use of
|
|
a special value. This value represents the inline assembler as a string
|
|
(containing the instructions to emit), a list of operand constraints (stored
|
|
as a string), a flag that indicates whether or not the inline asm
|
|
expression has side effects, and a flag indicating whether the function
|
|
containing the asm needs to align its stack conservatively. An example
|
|
inline assembler expression is:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
i32 (i32) asm "bswap $0", "=r,r"
|
|
</pre>
|
|
</div>
|
|
|
|
<p>Inline assembler expressions may <b>only</b> be used as the callee operand of
|
|
a <a href="#i_call"><tt>call</tt> instruction</a>. Thus, typically we
|
|
have:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%X = call i32 asm "<a href="#int_bswap">bswap</a> $0", "=r,r"(i32 %Y)
|
|
</pre>
|
|
</div>
|
|
|
|
<p>Inline asms with side effects not visible in the constraint list must be
|
|
marked as having side effects. This is done through the use of the
|
|
'<tt>sideeffect</tt>' keyword, like so:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
call void asm sideeffect "eieio", ""()
|
|
</pre>
|
|
</div>
|
|
|
|
<p>In some cases inline asms will contain code that will not work unless the
|
|
stack is aligned in some way, such as calls or SSE instructions on x86,
|
|
yet will not contain code that does that alignment within the asm.
|
|
The compiler should make conservative assumptions about what the asm might
|
|
contain and should generate its usual stack alignment code in the prologue
|
|
if the '<tt>alignstack</tt>' keyword is present:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
call void asm alignstack "eieio", ""()
|
|
</pre>
|
|
</div>
|
|
|
|
<p>If both keywords appear the '<tt>sideeffect</tt>' keyword must come
|
|
first.</p>
|
|
|
|
<p>TODO: The format of the asm and constraints string still need to be
|
|
documented here. Constraints on what can be done (e.g. duplication, moving,
|
|
etc need to be documented). This is probably best done by reference to
|
|
another document that covers inline asm from a holistic perspective.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"><a name="metadata">Metadata Nodes and Metadata
|
|
Strings</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM IR allows metadata to be attached to instructions in the program that
|
|
can convey extra information about the code to the optimizers and code
|
|
generator. One example application of metadata is source-level debug
|
|
information. There are two metadata primitives: strings and nodes. All
|
|
metadata has the <tt>metadata</tt> type and is identified in syntax by a
|
|
preceding exclamation point ('<tt>!</tt>').</p>
|
|
|
|
<p>A metadata string is a string surrounded by double quotes. It can contain
|
|
any character by escaping non-printable characters with "\xx" where "xx" is
|
|
the two digit hex code. For example: "<tt>!"test\00"</tt>".</p>
|
|
|
|
<p>Metadata nodes are represented with notation similar to structure constants
|
|
(a comma separated list of elements, surrounded by braces and preceded by an
|
|
exclamation point). For example: "<tt>!{ metadata !"test\00", i32
|
|
10}</tt>". Metadata nodes can have any values as their operand.</p>
|
|
|
|
<p>A <a href="#namedmetadatastructure">named metadata</a> is a collection of
|
|
metadata nodes, which can be looked up in the module symbol table. For
|
|
example: "<tt>!foo = metadata !{!4, !3}</tt>".
|
|
|
|
</div>
|
|
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section">
|
|
<a name="intrinsic_globals">Intrinsic Global Variables</a>
|
|
</div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<p>LLVM has a number of "magic" global variables that contain data that affect
|
|
code generation or other IR semantics. These are documented here. All globals
|
|
of this sort should have a section specified as "<tt>llvm.metadata</tt>". This
|
|
section and all globals that start with "<tt>llvm.</tt>" are reserved for use
|
|
by LLVM.</p>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="intg_used">The '<tt>llvm.used</tt>' Global Variable</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The <tt>@llvm.used</tt> global is an array with i8* element type which has <a
|
|
href="#linkage_appending">appending linkage</a>. This array contains a list of
|
|
pointers to global variables and functions which may optionally have a pointer
|
|
cast formed of bitcast or getelementptr. For example, a legal use of it is:</p>
|
|
|
|
<pre>
|
|
@X = global i8 4
|
|
@Y = global i32 123
|
|
|
|
@llvm.used = appending global [2 x i8*] [
|
|
i8* @X,
|
|
i8* bitcast (i32* @Y to i8*)
|
|
], section "llvm.metadata"
|
|
</pre>
|
|
|
|
<p>If a global variable appears in the <tt>@llvm.used</tt> list, then the
|
|
compiler, assembler, and linker are required to treat the symbol as if there is
|
|
a reference to the global that it cannot see. For example, if a variable has
|
|
internal linkage and no references other than that from the <tt>@llvm.used</tt>
|
|
list, it cannot be deleted. This is commonly used to represent references from
|
|
inline asms and other things the compiler cannot "see", and corresponds to
|
|
"attribute((used))" in GNU C.</p>
|
|
|
|
<p>On some targets, the code generator must emit a directive to the assembler or
|
|
object file to prevent the assembler and linker from molesting the symbol.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="intg_compiler_used">The '<tt>llvm.compiler.used</tt>' Global Variable</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The <tt>@llvm.compiler.used</tt> directive is the same as the
|
|
<tt>@llvm.used</tt> directive, except that it only prevents the compiler from
|
|
touching the symbol. On targets that support it, this allows an intelligent
|
|
linker to optimize references to the symbol without being impeded as it would be
|
|
by <tt>@llvm.used</tt>.</p>
|
|
|
|
<p>This is a rare construct that should only be used in rare circumstances, and
|
|
should not be exposed to source languages.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="intg_global_ctors">The '<tt>llvm.global_ctors</tt>' Global Variable</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>TODO: Describe this.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="intg_global_dtors">The '<tt>llvm.global_dtors</tt>' Global Variable</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>TODO: Describe this.</p>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="instref">Instruction Reference</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The LLVM instruction set consists of several different classifications of
|
|
instructions: <a href="#terminators">terminator
|
|
instructions</a>, <a href="#binaryops">binary instructions</a>,
|
|
<a href="#bitwiseops">bitwise binary instructions</a>,
|
|
<a href="#memoryops">memory instructions</a>, and
|
|
<a href="#otherops">other instructions</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="terminators">Terminator
|
|
Instructions</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>As mentioned <a href="#functionstructure">previously</a>, every basic block
|
|
in a program ends with a "Terminator" instruction, which indicates which
|
|
block should be executed after the current block is finished. These
|
|
terminator instructions typically yield a '<tt>void</tt>' value: they produce
|
|
control flow, not values (the one exception being the
|
|
'<a href="#i_invoke"><tt>invoke</tt></a>' instruction).</p>
|
|
|
|
<p>There are six different terminator instructions: the
|
|
'<a href="#i_ret"><tt>ret</tt></a>' instruction, the
|
|
'<a href="#i_br"><tt>br</tt></a>' instruction, the
|
|
'<a href="#i_switch"><tt>switch</tt></a>' instruction, the
|
|
'<a href="#i_indirectbr">'<tt>indirectbr</tt></a>' Instruction, the
|
|
'<a href="#i_invoke"><tt>invoke</tt></a>' instruction, the
|
|
'<a href="#i_unwind"><tt>unwind</tt></a>' instruction, and the
|
|
'<a href="#i_unreachable"><tt>unreachable</tt></a>' instruction.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_ret">'<tt>ret</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
ret <type> <value> <i>; Return a value from a non-void function</i>
|
|
ret void <i>; Return from void function</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>ret</tt>' instruction is used to return control flow (and optionally
|
|
a value) from a function back to the caller.</p>
|
|
|
|
<p>There are two forms of the '<tt>ret</tt>' instruction: one that returns a
|
|
value and then causes control flow, and one that just causes control flow to
|
|
occur.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>ret</tt>' instruction optionally accepts a single argument, the
|
|
return value. The type of the return value must be a
|
|
'<a href="#t_firstclass">first class</a>' type.</p>
|
|
|
|
<p>A function is not <a href="#wellformed">well formed</a> if it it has a
|
|
non-void return type and contains a '<tt>ret</tt>' instruction with no return
|
|
value or a return value with a type that does not match its type, or if it
|
|
has a void return type and contains a '<tt>ret</tt>' instruction with a
|
|
return value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>When the '<tt>ret</tt>' instruction is executed, control flow returns back to
|
|
the calling function's context. If the caller is a
|
|
"<a href="#i_call"><tt>call</tt></a>" instruction, execution continues at the
|
|
instruction after the call. If the caller was an
|
|
"<a href="#i_invoke"><tt>invoke</tt></a>" instruction, execution continues at
|
|
the beginning of the "normal" destination block. If the instruction returns
|
|
a value, that value shall set the call or invoke instruction's return
|
|
value.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
ret i32 5 <i>; Return an integer value of 5</i>
|
|
ret void <i>; Return from a void function</i>
|
|
ret { i32, i8 } { i32 4, i8 2 } <i>; Return a struct of values 4 and 2</i>
|
|
</pre>
|
|
|
|
</div>
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_br">'<tt>br</tt>' Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
br i1 <cond>, label <iftrue>, label <iffalse><br> br label <dest> <i>; Unconditional branch</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>br</tt>' instruction is used to cause control flow to transfer to a
|
|
different basic block in the current function. There are two forms of this
|
|
instruction, corresponding to a conditional branch and an unconditional
|
|
branch.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The conditional branch form of the '<tt>br</tt>' instruction takes a single
|
|
'<tt>i1</tt>' value and two '<tt>label</tt>' values. The unconditional form
|
|
of the '<tt>br</tt>' instruction takes a single '<tt>label</tt>' value as a
|
|
target.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>Upon execution of a conditional '<tt>br</tt>' instruction, the '<tt>i1</tt>'
|
|
argument is evaluated. If the value is <tt>true</tt>, control flows to the
|
|
'<tt>iftrue</tt>' <tt>label</tt> argument. If "cond" is <tt>false</tt>,
|
|
control flows to the '<tt>iffalse</tt>' <tt>label</tt> argument.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
Test:
|
|
%cond = <a href="#i_icmp">icmp</a> eq i32 %a, %b
|
|
br i1 %cond, label %IfEqual, label %IfUnequal
|
|
IfEqual:
|
|
<a href="#i_ret">ret</a> i32 1
|
|
IfUnequal:
|
|
<a href="#i_ret">ret</a> i32 0
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_switch">'<tt>switch</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
switch <intty> <value>, label <defaultdest> [ <intty> <val>, label <dest> ... ]
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>switch</tt>' instruction is used to transfer control flow to one of
|
|
several different places. It is a generalization of the '<tt>br</tt>'
|
|
instruction, allowing a branch to occur to one of many possible
|
|
destinations.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>switch</tt>' instruction uses three parameters: an integer
|
|
comparison value '<tt>value</tt>', a default '<tt>label</tt>' destination,
|
|
and an array of pairs of comparison value constants and '<tt>label</tt>'s.
|
|
The table is not allowed to contain duplicate constant entries.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The <tt>switch</tt> instruction specifies a table of values and
|
|
destinations. When the '<tt>switch</tt>' instruction is executed, this table
|
|
is searched for the given value. If the value is found, control flow is
|
|
transferred to the corresponding destination; otherwise, control flow is
|
|
transferred to the default destination.</p>
|
|
|
|
<h5>Implementation:</h5>
|
|
<p>Depending on properties of the target machine and the particular
|
|
<tt>switch</tt> instruction, this instruction may be code generated in
|
|
different ways. For example, it could be generated as a series of chained
|
|
conditional branches or with a lookup table.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<i>; Emulate a conditional br instruction</i>
|
|
%Val = <a href="#i_zext">zext</a> i1 %value to i32
|
|
switch i32 %Val, label %truedest [ i32 0, label %falsedest ]
|
|
|
|
<i>; Emulate an unconditional br instruction</i>
|
|
switch i32 0, label %dest [ ]
|
|
|
|
<i>; Implement a jump table:</i>
|
|
switch i32 %val, label %otherwise [ i32 0, label %onzero
|
|
i32 1, label %onone
|
|
i32 2, label %ontwo ]
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_indirectbr">'<tt>indirectbr</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
indirectbr <somety>* <address>, [ label <dest1>, label <dest2>, ... ]
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
|
|
<p>The '<tt>indirectbr</tt>' instruction implements an indirect branch to a label
|
|
within the current function, whose address is specified by
|
|
"<tt>address</tt>". Address must be derived from a <a
|
|
href="#blockaddress">blockaddress</a> constant.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
|
|
<p>The '<tt>address</tt>' argument is the address of the label to jump to. The
|
|
rest of the arguments indicate the full set of possible destinations that the
|
|
address may point to. Blocks are allowed to occur multiple times in the
|
|
destination list, though this isn't particularly useful.</p>
|
|
|
|
<p>This destination list is required so that dataflow analysis has an accurate
|
|
understanding of the CFG.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
|
|
<p>Control transfers to the block specified in the address argument. All
|
|
possible destination blocks must be listed in the label list, otherwise this
|
|
instruction has undefined behavior. This implies that jumps to labels
|
|
defined in other functions have undefined behavior as well.</p>
|
|
|
|
<h5>Implementation:</h5>
|
|
|
|
<p>This is typically implemented with a jump through a register.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
indirectbr i8* %Addr, [ label %bb1, label %bb2, label %bb3 ]
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_invoke">'<tt>invoke</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = invoke [<a href="#callingconv">cconv</a>] [<a href="#paramattrs">ret attrs</a>] <ptr to function ty> <function ptr val>(<function args>) [<a href="#fnattrs">fn attrs</a>]
|
|
to label <normal label> unwind label <exception label>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>invoke</tt>' instruction causes control to transfer to a specified
|
|
function, with the possibility of control flow transfer to either the
|
|
'<tt>normal</tt>' label or the '<tt>exception</tt>' label. If the callee
|
|
function returns with the "<tt><a href="#i_ret">ret</a></tt>" instruction,
|
|
control flow will return to the "normal" label. If the callee (or any
|
|
indirect callees) returns with the "<a href="#i_unwind"><tt>unwind</tt></a>"
|
|
instruction, control is interrupted and continued at the dynamically nearest
|
|
"exception" label.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>This instruction requires several arguments:</p>
|
|
|
|
<ol>
|
|
<li>The optional "cconv" marker indicates which <a href="#callingconv">calling
|
|
convention</a> the call should use. If none is specified, the call
|
|
defaults to using C calling conventions.</li>
|
|
|
|
<li>The optional <a href="#paramattrs">Parameter Attributes</a> list for
|
|
return values. Only '<tt>zeroext</tt>', '<tt>signext</tt>', and
|
|
'<tt>inreg</tt>' attributes are valid here.</li>
|
|
|
|
<li>'<tt>ptr to function ty</tt>': shall be the signature of the pointer to
|
|
function value being invoked. In most cases, this is a direct function
|
|
invocation, but indirect <tt>invoke</tt>s are just as possible, branching
|
|
off an arbitrary pointer to function value.</li>
|
|
|
|
<li>'<tt>function ptr val</tt>': An LLVM value containing a pointer to a
|
|
function to be invoked. </li>
|
|
|
|
<li>'<tt>function args</tt>': argument list whose types match the function
|
|
signature argument types. If the function signature indicates the
|
|
function accepts a variable number of arguments, the extra arguments can
|
|
be specified.</li>
|
|
|
|
<li>'<tt>normal label</tt>': the label reached when the called function
|
|
executes a '<tt><a href="#i_ret">ret</a></tt>' instruction. </li>
|
|
|
|
<li>'<tt>exception label</tt>': the label reached when a callee returns with
|
|
the <a href="#i_unwind"><tt>unwind</tt></a> instruction. </li>
|
|
|
|
<li>The optional <a href="#fnattrs">function attributes</a> list. Only
|
|
'<tt>noreturn</tt>', '<tt>nounwind</tt>', '<tt>readonly</tt>' and
|
|
'<tt>readnone</tt>' attributes are valid here.</li>
|
|
</ol>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction is designed to operate as a standard
|
|
'<tt><a href="#i_call">call</a></tt>' instruction in most regards. The
|
|
primary difference is that it establishes an association with a label, which
|
|
is used by the runtime library to unwind the stack.</p>
|
|
|
|
<p>This instruction is used in languages with destructors to ensure that proper
|
|
cleanup is performed in the case of either a <tt>longjmp</tt> or a thrown
|
|
exception. Additionally, this is important for implementation of
|
|
'<tt>catch</tt>' clauses in high-level languages that support them.</p>
|
|
|
|
<p>For the purposes of the SSA form, the definition of the value returned by the
|
|
'<tt>invoke</tt>' instruction is deemed to occur on the edge from the current
|
|
block to the "normal" label. If the callee unwinds then no return value is
|
|
available.</p>
|
|
|
|
<p>Note that the code generator does not yet completely support unwind, and
|
|
that the invoke/unwind semantics are likely to change in future versions.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%retval = invoke i32 @Test(i32 15) to label %Continue
|
|
unwind label %TestCleanup <i>; {i32}:retval set</i>
|
|
%retval = invoke <a href="#callingconv">coldcc</a> i32 %Testfnptr(i32 15) to label %Continue
|
|
unwind label %TestCleanup <i>; {i32}:retval set</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
|
|
<div class="doc_subsubsection"> <a name="i_unwind">'<tt>unwind</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
unwind
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>unwind</tt>' instruction unwinds the stack, continuing control flow
|
|
at the first callee in the dynamic call stack which used
|
|
an <a href="#i_invoke"><tt>invoke</tt></a> instruction to perform the call.
|
|
This is primarily used to implement exception handling.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>unwind</tt>' instruction causes execution of the current function to
|
|
immediately halt. The dynamic call stack is then searched for the
|
|
first <a href="#i_invoke"><tt>invoke</tt></a> instruction on the call stack.
|
|
Once found, execution continues at the "exceptional" destination block
|
|
specified by the <tt>invoke</tt> instruction. If there is no <tt>invoke</tt>
|
|
instruction in the dynamic call chain, undefined behavior results.</p>
|
|
|
|
<p>Note that the code generator does not yet completely support unwind, and
|
|
that the invoke/unwind semantics are likely to change in future versions.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
|
|
<div class="doc_subsubsection"> <a name="i_unreachable">'<tt>unreachable</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
unreachable
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>unreachable</tt>' instruction has no defined semantics. This
|
|
instruction is used to inform the optimizer that a particular portion of the
|
|
code is not reachable. This can be used to indicate that the code after a
|
|
no-return function cannot be reached, and other facts.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>unreachable</tt>' instruction has no defined semantics.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="binaryops">Binary Operations</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Binary operators are used to do most of the computation in a program. They
|
|
require two operands of the same type, execute an operation on them, and
|
|
produce a single value. The operands might represent multiple data, as is
|
|
the case with the <a href="#t_vector">vector</a> data type. The result value
|
|
has the same type as its operands.</p>
|
|
|
|
<p>There are several different binary operators:</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_add">'<tt>add</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = add <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = add nuw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = add nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = add nuw nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>add</tt>' instruction returns the sum of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>add</tt>' instruction must
|
|
be <a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of
|
|
integer values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the integer sum of the two operands.</p>
|
|
|
|
<p>If the sum has unsigned overflow, the result returned is the mathematical
|
|
result modulo 2<sup>n</sup>, where n is the bit width of the result.</p>
|
|
|
|
<p>Because LLVM integers use a two's complement representation, this instruction
|
|
is appropriate for both signed and unsigned integers.</p>
|
|
|
|
<p><tt>nuw</tt> and <tt>nsw</tt> stand for "No Unsigned Wrap"
|
|
and "No Signed Wrap", respectively. If the <tt>nuw</tt> and/or
|
|
<tt>nsw</tt> keywords are present, the result value of the <tt>add</tt>
|
|
is undefined if unsigned and/or signed overflow, respectively, occurs.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = add i32 4, %var <i>; yields {i32}:result = 4 + %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fadd">'<tt>fadd</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fadd <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fadd</tt>' instruction returns the sum of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>fadd</tt>' instruction must be
|
|
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
|
|
floating point values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the floating point sum of the two operands.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = fadd float 4.0, %var <i>; yields {float}:result = 4.0 + %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_sub">'<tt>sub</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = sub <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = sub nuw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = sub nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = sub nuw nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>sub</tt>' instruction returns the difference of its two
|
|
operands.</p>
|
|
|
|
<p>Note that the '<tt>sub</tt>' instruction is used to represent the
|
|
'<tt>neg</tt>' instruction present in most other intermediate
|
|
representations.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>sub</tt>' instruction must
|
|
be <a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of
|
|
integer values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the integer difference of the two operands.</p>
|
|
|
|
<p>If the difference has unsigned overflow, the result returned is the
|
|
mathematical result modulo 2<sup>n</sup>, where n is the bit width of the
|
|
result.</p>
|
|
|
|
<p>Because LLVM integers use a two's complement representation, this instruction
|
|
is appropriate for both signed and unsigned integers.</p>
|
|
|
|
<p><tt>nuw</tt> and <tt>nsw</tt> stand for "No Unsigned Wrap"
|
|
and "No Signed Wrap", respectively. If the <tt>nuw</tt> and/or
|
|
<tt>nsw</tt> keywords are present, the result value of the <tt>sub</tt>
|
|
is undefined if unsigned and/or signed overflow, respectively, occurs.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = sub i32 4, %var <i>; yields {i32}:result = 4 - %var</i>
|
|
<result> = sub i32 0, %val <i>; yields {i32}:result = -%var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fsub">'<tt>fsub</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fsub <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fsub</tt>' instruction returns the difference of its two
|
|
operands.</p>
|
|
|
|
<p>Note that the '<tt>fsub</tt>' instruction is used to represent the
|
|
'<tt>fneg</tt>' instruction present in most other intermediate
|
|
representations.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>fsub</tt>' instruction must be
|
|
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
|
|
floating point values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the floating point difference of the two operands.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = fsub float 4.0, %var <i>; yields {float}:result = 4.0 - %var</i>
|
|
<result> = fsub float -0.0, %val <i>; yields {float}:result = -%var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_mul">'<tt>mul</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = mul <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = mul nuw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = mul nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = mul nuw nsw <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>mul</tt>' instruction returns the product of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>mul</tt>' instruction must
|
|
be <a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of
|
|
integer values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the integer product of the two operands.</p>
|
|
|
|
<p>If the result of the multiplication has unsigned overflow, the result
|
|
returned is the mathematical result modulo 2<sup>n</sup>, where n is the bit
|
|
width of the result.</p>
|
|
|
|
<p>Because LLVM integers use a two's complement representation, and the result
|
|
is the same width as the operands, this instruction returns the correct
|
|
result for both signed and unsigned integers. If a full product
|
|
(e.g. <tt>i32</tt>x<tt>i32</tt>-><tt>i64</tt>) is needed, the operands should
|
|
be sign-extended or zero-extended as appropriate to the width of the full
|
|
product.</p>
|
|
|
|
<p><tt>nuw</tt> and <tt>nsw</tt> stand for "No Unsigned Wrap"
|
|
and "No Signed Wrap", respectively. If the <tt>nuw</tt> and/or
|
|
<tt>nsw</tt> keywords are present, the result value of the <tt>mul</tt>
|
|
is undefined if unsigned and/or signed overflow, respectively, occurs.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = mul i32 4, %var <i>; yields {i32}:result = 4 * %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fmul">'<tt>fmul</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fmul <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fmul</tt>' instruction returns the product of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>fmul</tt>' instruction must be
|
|
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
|
|
floating point values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the floating point product of the two operands.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = fmul float 4.0, %var <i>; yields {float}:result = 4.0 * %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_udiv">'<tt>udiv</tt>' Instruction
|
|
</a></div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = udiv <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>udiv</tt>' instruction returns the quotient of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>udiv</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the unsigned integer quotient of the two operands.</p>
|
|
|
|
<p>Note that unsigned integer division and signed integer division are distinct
|
|
operations; for signed integer division, use '<tt>sdiv</tt>'.</p>
|
|
|
|
<p>Division by zero leads to undefined behavior.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = udiv i32 4, %var <i>; yields {i32}:result = 4 / %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_sdiv">'<tt>sdiv</tt>' Instruction
|
|
</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = sdiv <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
<result> = sdiv exact <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>sdiv</tt>' instruction returns the quotient of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>sdiv</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the signed integer quotient of the two operands rounded
|
|
towards zero.</p>
|
|
|
|
<p>Note that signed integer division and unsigned integer division are distinct
|
|
operations; for unsigned integer division, use '<tt>udiv</tt>'.</p>
|
|
|
|
<p>Division by zero leads to undefined behavior. Overflow also leads to
|
|
undefined behavior; this is a rare case, but can occur, for example, by doing
|
|
a 32-bit division of -2147483648 by -1.</p>
|
|
|
|
<p>If the <tt>exact</tt> keyword is present, the result value of the
|
|
<tt>sdiv</tt> is undefined if the result would be rounded or if overflow
|
|
would occur.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = sdiv i32 4, %var <i>; yields {i32}:result = 4 / %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_fdiv">'<tt>fdiv</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fdiv <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fdiv</tt>' instruction returns the quotient of its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>fdiv</tt>' instruction must be
|
|
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
|
|
floating point values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is the floating point quotient of the two operands.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = fdiv float 4.0, %var <i>; yields {float}:result = 4.0 / %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_urem">'<tt>urem</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = urem <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>urem</tt>' instruction returns the remainder from the unsigned
|
|
division of its two arguments.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>urem</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction returns the unsigned integer <i>remainder</i> of a division.
|
|
This instruction always performs an unsigned division to get the
|
|
remainder.</p>
|
|
|
|
<p>Note that unsigned integer remainder and signed integer remainder are
|
|
distinct operations; for signed integer remainder, use '<tt>srem</tt>'.</p>
|
|
|
|
<p>Taking the remainder of a division by zero leads to undefined behavior.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = urem i32 4, %var <i>; yields {i32}:result = 4 % %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_srem">'<tt>srem</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = srem <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>srem</tt>' instruction returns the remainder from the signed
|
|
division of its two operands. This instruction can also take
|
|
<a href="#t_vector">vector</a> versions of the values in which case the
|
|
elements must be integers.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>srem</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction returns the <i>remainder</i> of a division (where the result
|
|
has the same sign as the dividend, <tt>op1</tt>), not the <i>modulo</i>
|
|
operator (where the result has the same sign as the divisor, <tt>op2</tt>) of
|
|
a value. For more information about the difference,
|
|
see <a href="http://mathforum.org/dr.math/problems/anne.4.28.99.html">The
|
|
Math Forum</a>. For a table of how this is implemented in various languages,
|
|
please see <a href="http://en.wikipedia.org/wiki/Modulo_operation">
|
|
Wikipedia: modulo operation</a>.</p>
|
|
|
|
<p>Note that signed integer remainder and unsigned integer remainder are
|
|
distinct operations; for unsigned integer remainder, use '<tt>urem</tt>'.</p>
|
|
|
|
<p>Taking the remainder of a division by zero leads to undefined behavior.
|
|
Overflow also leads to undefined behavior; this is a rare case, but can
|
|
occur, for example, by taking the remainder of a 32-bit division of
|
|
-2147483648 by -1. (The remainder doesn't actually overflow, but this rule
|
|
lets srem be implemented using instructions that return both the result of
|
|
the division and the remainder.)</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = srem i32 4, %var <i>; yields {i32}:result = 4 % %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_frem">'<tt>frem</tt>' Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = frem <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>frem</tt>' instruction returns the remainder from the division of
|
|
its two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>frem</tt>' instruction must be
|
|
<a href="#t_floating">floating point</a> or <a href="#t_vector">vector</a> of
|
|
floating point values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction returns the <i>remainder</i> of a division. The remainder
|
|
has the same sign as the dividend.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = frem float 4.0, %var <i>; yields {float}:result = 4.0 % %var</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="bitwiseops">Bitwise Binary
|
|
Operations</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Bitwise binary operators are used to do various forms of bit-twiddling in a
|
|
program. They are generally very efficient instructions and can commonly be
|
|
strength reduced from other instructions. They require two operands of the
|
|
same type, execute an operation on them, and produce a single value. The
|
|
resulting value is the same type as its operands.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_shl">'<tt>shl</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = shl <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>shl</tt>' instruction returns the first operand shifted to the left
|
|
a specified number of bits.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>Both arguments to the '<tt>shl</tt>' instruction must be the
|
|
same <a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of
|
|
integer type. '<tt>op2</tt>' is treated as an unsigned value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The value produced is <tt>op1</tt> * 2<sup><tt>op2</tt></sup> mod
|
|
2<sup>n</sup>, where <tt>n</tt> is the width of the result. If <tt>op2</tt>
|
|
is (statically or dynamically) negative or equal to or larger than the number
|
|
of bits in <tt>op1</tt>, the result is undefined. If the arguments are
|
|
vectors, each vector element of <tt>op1</tt> is shifted by the corresponding
|
|
shift amount in <tt>op2</tt>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = shl i32 4, %var <i>; yields {i32}: 4 << %var</i>
|
|
<result> = shl i32 4, 2 <i>; yields {i32}: 16</i>
|
|
<result> = shl i32 1, 10 <i>; yields {i32}: 1024</i>
|
|
<result> = shl i32 1, 32 <i>; undefined</i>
|
|
<result> = shl <2 x i32> < i32 1, i32 1>, < i32 1, i32 2> <i>; yields: result=<2 x i32> < i32 2, i32 4></i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_lshr">'<tt>lshr</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = lshr <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>lshr</tt>' instruction (logical shift right) returns the first
|
|
operand shifted to the right a specified number of bits with zero fill.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>Both arguments to the '<tt>lshr</tt>' instruction must be the same
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
type. '<tt>op2</tt>' is treated as an unsigned value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction always performs a logical shift right operation. The most
|
|
significant bits of the result will be filled with zero bits after the shift.
|
|
If <tt>op2</tt> is (statically or dynamically) equal to or larger than the
|
|
number of bits in <tt>op1</tt>, the result is undefined. If the arguments are
|
|
vectors, each vector element of <tt>op1</tt> is shifted by the corresponding
|
|
shift amount in <tt>op2</tt>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = lshr i32 4, 1 <i>; yields {i32}:result = 2</i>
|
|
<result> = lshr i32 4, 2 <i>; yields {i32}:result = 1</i>
|
|
<result> = lshr i8 4, 3 <i>; yields {i8}:result = 0</i>
|
|
<result> = lshr i8 -2, 1 <i>; yields {i8}:result = 0x7FFFFFFF </i>
|
|
<result> = lshr i32 1, 32 <i>; undefined</i>
|
|
<result> = lshr <2 x i32> < i32 -2, i32 4>, < i32 1, i32 2> <i>; yields: result=<2 x i32> < i32 0x7FFFFFFF, i32 1></i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_ashr">'<tt>ashr</tt>'
|
|
Instruction</a> </div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = ashr <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>ashr</tt>' instruction (arithmetic shift right) returns the first
|
|
operand shifted to the right a specified number of bits with sign
|
|
extension.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>Both arguments to the '<tt>ashr</tt>' instruction must be the same
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
type. '<tt>op2</tt>' is treated as an unsigned value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This instruction always performs an arithmetic shift right operation, The
|
|
most significant bits of the result will be filled with the sign bit
|
|
of <tt>op1</tt>. If <tt>op2</tt> is (statically or dynamically) equal to or
|
|
larger than the number of bits in <tt>op1</tt>, the result is undefined. If
|
|
the arguments are vectors, each vector element of <tt>op1</tt> is shifted by
|
|
the corresponding shift amount in <tt>op2</tt>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = ashr i32 4, 1 <i>; yields {i32}:result = 2</i>
|
|
<result> = ashr i32 4, 2 <i>; yields {i32}:result = 1</i>
|
|
<result> = ashr i8 4, 3 <i>; yields {i8}:result = 0</i>
|
|
<result> = ashr i8 -2, 1 <i>; yields {i8}:result = -1</i>
|
|
<result> = ashr i32 1, 32 <i>; undefined</i>
|
|
<result> = ashr <2 x i32> < i32 -2, i32 4>, < i32 1, i32 3> <i>; yields: result=<2 x i32> < i32 -1, i32 0></i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_and">'<tt>and</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = and <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>and</tt>' instruction returns the bitwise logical and of its two
|
|
operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>and</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The truth table used for the '<tt>and</tt>' instruction is:</p>
|
|
|
|
<table border="1" cellspacing="0" cellpadding="4">
|
|
<tbody>
|
|
<tr>
|
|
<td>In0</td>
|
|
<td>In1</td>
|
|
<td>Out</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = and i32 4, %var <i>; yields {i32}:result = 4 & %var</i>
|
|
<result> = and i32 15, 40 <i>; yields {i32}:result = 8</i>
|
|
<result> = and i32 4, 8 <i>; yields {i32}:result = 0</i>
|
|
</pre>
|
|
</div>
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_or">'<tt>or</tt>' Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = or <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>or</tt>' instruction returns the bitwise logical inclusive or of its
|
|
two operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>or</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The truth table used for the '<tt>or</tt>' instruction is:</p>
|
|
|
|
<table border="1" cellspacing="0" cellpadding="4">
|
|
<tbody>
|
|
<tr>
|
|
<td>In0</td>
|
|
<td>In1</td>
|
|
<td>Out</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = or i32 4, %var <i>; yields {i32}:result = 4 | %var</i>
|
|
<result> = or i32 15, 40 <i>; yields {i32}:result = 47</i>
|
|
<result> = or i32 4, 8 <i>; yields {i32}:result = 12</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_xor">'<tt>xor</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = xor <ty> <op1>, <op2> <i>; yields {ty}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>xor</tt>' instruction returns the bitwise logical exclusive or of
|
|
its two operands. The <tt>xor</tt> is used to implement the "one's
|
|
complement" operation, which is the "~" operator in C.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The two arguments to the '<tt>xor</tt>' instruction must be
|
|
<a href="#t_integer">integer</a> or <a href="#t_vector">vector</a> of integer
|
|
values. Both arguments must have identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The truth table used for the '<tt>xor</tt>' instruction is:</p>
|
|
|
|
<table border="1" cellspacing="0" cellpadding="4">
|
|
<tbody>
|
|
<tr>
|
|
<td>In0</td>
|
|
<td>In1</td>
|
|
<td>Out</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>0</td>
|
|
<td>1</td>
|
|
</tr>
|
|
<tr>
|
|
<td>1</td>
|
|
<td>1</td>
|
|
<td>0</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = xor i32 4, %var <i>; yields {i32}:result = 4 ^ %var</i>
|
|
<result> = xor i32 15, 40 <i>; yields {i32}:result = 39</i>
|
|
<result> = xor i32 4, 8 <i>; yields {i32}:result = 12</i>
|
|
<result> = xor i32 %V, -1 <i>; yields {i32}:result = ~%V</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="vectorops">Vector Operations</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM supports several instructions to represent vector operations in a
|
|
target-independent manner. These instructions cover the element-access and
|
|
vector-specific operations needed to process vectors effectively. While LLVM
|
|
does directly support these vector operations, many sophisticated algorithms
|
|
will want to use target-specific intrinsics to take full advantage of a
|
|
specific target.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_extractelement">'<tt>extractelement</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = extractelement <n x <ty>> <val>, i32 <idx> <i>; yields <ty></i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>extractelement</tt>' instruction extracts a single scalar element
|
|
from a vector at a specified index.</p>
|
|
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first operand of an '<tt>extractelement</tt>' instruction is a value
|
|
of <a href="#t_vector">vector</a> type. The second operand is an index
|
|
indicating the position from which to extract the element. The index may be
|
|
a variable.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The result is a scalar of the same type as the element type of
|
|
<tt>val</tt>. Its value is the value at position <tt>idx</tt> of
|
|
<tt>val</tt>. If <tt>idx</tt> exceeds the length of <tt>val</tt>, the
|
|
results are undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = extractelement <4 x i32> %vec, i32 0 <i>; yields i32</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_insertelement">'<tt>insertelement</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = insertelement <n x <ty>> <val>, <ty> <elt>, i32 <idx> <i>; yields <n x <ty>></i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>insertelement</tt>' instruction inserts a scalar element into a
|
|
vector at a specified index.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first operand of an '<tt>insertelement</tt>' instruction is a value
|
|
of <a href="#t_vector">vector</a> type. The second operand is a scalar value
|
|
whose type must equal the element type of the first operand. The third
|
|
operand is an index indicating the position at which to insert the value.
|
|
The index may be a variable.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The result is a vector of the same type as <tt>val</tt>. Its element values
|
|
are those of <tt>val</tt> except at position <tt>idx</tt>, where it gets the
|
|
value <tt>elt</tt>. If <tt>idx</tt> exceeds the length of <tt>val</tt>, the
|
|
results are undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = insertelement <4 x i32> %vec, i32 1, i32 0 <i>; yields <4 x i32></i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_shufflevector">'<tt>shufflevector</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> <i>; yields <m x <ty>></i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>shufflevector</tt>' instruction constructs a permutation of elements
|
|
from two input vectors, returning a vector with the same element type as the
|
|
input and length that is the same as the shuffle mask.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first two operands of a '<tt>shufflevector</tt>' instruction are vectors
|
|
with types that match each other. The third argument is a shuffle mask whose
|
|
element type is always 'i32'. The result of the instruction is a vector
|
|
whose length is the same as the shuffle mask and whose element type is the
|
|
same as the element type of the first two operands.</p>
|
|
|
|
<p>The shuffle mask operand is required to be a constant vector with either
|
|
constant integer or undef values.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The elements of the two input vectors are numbered from left to right across
|
|
both of the vectors. The shuffle mask operand specifies, for each element of
|
|
the result vector, which element of the two input vectors the result element
|
|
gets. The element selector may be undef (meaning "don't care") and the
|
|
second operand may be undef if performing a shuffle from only one vector.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = shufflevector <4 x i32> %v1, <4 x i32> %v2,
|
|
<4 x i32> <i32 0, i32 4, i32 1, i32 5> <i>; yields <4 x i32></i>
|
|
<result> = shufflevector <4 x i32> %v1, <4 x i32> undef,
|
|
<4 x i32> <i32 0, i32 1, i32 2, i32 3> <i>; yields <4 x i32></i> - Identity shuffle.
|
|
<result> = shufflevector <8 x i32> %v1, <8 x i32> undef,
|
|
<4 x i32> <i32 0, i32 1, i32 2, i32 3> <i>; yields <4 x i32></i>
|
|
<result> = shufflevector <4 x i32> %v1, <4 x i32> %v2,
|
|
<8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7 > <i>; yields <8 x i32></i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="aggregateops">Aggregate Operations</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM supports several instructions for working with aggregate values.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_extractvalue">'<tt>extractvalue</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = extractvalue <aggregate type> <val>, <idx>{, <idx>}*
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>extractvalue</tt>' instruction extracts the value of a struct field
|
|
or array element from an aggregate value.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first operand of an '<tt>extractvalue</tt>' instruction is a value
|
|
of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> type. The
|
|
operands are constant indices to specify which value to extract in a similar
|
|
manner as indices in a
|
|
'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The result is the value at the position in the aggregate specified by the
|
|
index operands.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = extractvalue {i32, float} %agg, 0 <i>; yields i32</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_insertvalue">'<tt>insertvalue</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = insertvalue <aggregate type> <val>, <ty> <elt>, <idx> <i>; yields <aggregate type></i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>insertvalue</tt>' instruction inserts a value into a struct field or
|
|
array element in an aggregate.</p>
|
|
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first operand of an '<tt>insertvalue</tt>' instruction is a value
|
|
of <a href="#t_struct">struct</a> or <a href="#t_array">array</a> type. The
|
|
second operand is a first-class value to insert. The following operands are
|
|
constant indices indicating the position at which to insert the value in a
|
|
similar manner as indices in a
|
|
'<tt><a href="#i_getelementptr">getelementptr</a></tt>' instruction. The
|
|
value to insert must have the same type as the value identified by the
|
|
indices.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The result is an aggregate of the same type as <tt>val</tt>. Its value is
|
|
that of <tt>val</tt> except that the value at the position specified by the
|
|
indices is that of <tt>elt</tt>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%agg1 = insertvalue {i32, float} undef, i32 1, 0 <i>; yields {i32 1, float undef}</i>
|
|
%agg2 = insertvalue {i32, float} %agg1, float %val, 1 <i>; yields {i32 1, float %val}</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="memoryops">Memory Access and Addressing Operations</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>A key design point of an SSA-based representation is how it represents
|
|
memory. In LLVM, no memory locations are in SSA form, which makes things
|
|
very simple. This section describes how to read, write, and allocate
|
|
memory in LLVM.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_alloca">'<tt>alloca</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = alloca <type>[, i32 <NumElements>][, align <alignment>] <i>; yields {type*}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>alloca</tt>' instruction allocates memory on the stack frame of the
|
|
currently executing function, to be automatically released when this function
|
|
returns to its caller. The object is always allocated in the generic address
|
|
space (address space zero).</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>alloca</tt>' instruction
|
|
allocates <tt>sizeof(<type>)*NumElements</tt> bytes of memory on the
|
|
runtime stack, returning a pointer of the appropriate type to the program.
|
|
If "NumElements" is specified, it is the number of elements allocated,
|
|
otherwise "NumElements" is defaulted to be one. If a constant alignment is
|
|
specified, the value result of the allocation is guaranteed to be aligned to
|
|
at least that boundary. If not specified, or if zero, the target can choose
|
|
to align the allocation on any convenient boundary compatible with the
|
|
type.</p>
|
|
|
|
<p>'<tt>type</tt>' may be any sized type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>Memory is allocated; a pointer is returned. The operation is undefined if
|
|
there is insufficient stack space for the allocation. '<tt>alloca</tt>'d
|
|
memory is automatically released when the function returns. The
|
|
'<tt>alloca</tt>' instruction is commonly used to represent automatic
|
|
variables that must have an address available. When the function returns
|
|
(either with the <tt><a href="#i_ret">ret</a></tt>
|
|
or <tt><a href="#i_unwind">unwind</a></tt> instructions), the memory is
|
|
reclaimed. Allocating zero bytes is legal, but the result is undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%ptr = alloca i32 <i>; yields {i32*}:ptr</i>
|
|
%ptr = alloca i32, i32 4 <i>; yields {i32*}:ptr</i>
|
|
%ptr = alloca i32, i32 4, align 1024 <i>; yields {i32*}:ptr</i>
|
|
%ptr = alloca i32, align 1024 <i>; yields {i32*}:ptr</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_load">'<tt>load</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = load <ty>* <pointer>[, align <alignment>]
|
|
<result> = volatile load <ty>* <pointer>[, align <alignment>]
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>load</tt>' instruction is used to read from memory.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument to the '<tt>load</tt>' instruction specifies the memory address
|
|
from which to load. The pointer must point to
|
|
a <a href="#t_firstclass">first class</a> type. If the <tt>load</tt> is
|
|
marked as <tt>volatile</tt>, then the optimizer is not allowed to modify the
|
|
number or order of execution of this <tt>load</tt> with other
|
|
volatile <tt>load</tt> and <tt><a href="#i_store">store</a></tt>
|
|
instructions. </p>
|
|
|
|
<p>The optional constant "align" argument specifies the alignment of the
|
|
operation (that is, the alignment of the memory address). A value of 0 or an
|
|
omitted "align" argument means that the operation has the preferential
|
|
alignment for the target. It is the responsibility of the code emitter to
|
|
ensure that the alignment information is correct. Overestimating the
|
|
alignment results in an undefined behavior. Underestimating the alignment may
|
|
produce less efficient code. An alignment of 1 is always safe.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The location of memory pointed to is loaded. If the value being loaded is of
|
|
scalar type then the number of bytes read does not exceed the minimum number
|
|
of bytes needed to hold all bits of the type. For example, loading an
|
|
<tt>i24</tt> reads at most three bytes. When loading a value of a type like
|
|
<tt>i20</tt> with a size that is not an integral number of bytes, the result
|
|
is undefined if the value was not originally written using a store of the
|
|
same type.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%ptr = <a href="#i_alloca">alloca</a> i32 <i>; yields {i32*}:ptr</i>
|
|
<a href="#i_store">store</a> i32 3, i32* %ptr <i>; yields {void}</i>
|
|
%val = load i32* %ptr <i>; yields {i32}:val = i32 3</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"> <a name="i_store">'<tt>store</tt>'
|
|
Instruction</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
store <ty> <value>, <ty>* <pointer>[, align <alignment>] <i>; yields {void}</i>
|
|
volatile store <ty> <value>, <ty>* <pointer>[, align <alignment>] <i>; yields {void}</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>store</tt>' instruction is used to write to memory.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>There are two arguments to the '<tt>store</tt>' instruction: a value to store
|
|
and an address at which to store it. The type of the
|
|
'<tt><pointer></tt>' operand must be a pointer to
|
|
the <a href="#t_firstclass">first class</a> type of the
|
|
'<tt><value></tt>' operand. If the <tt>store</tt> is marked
|
|
as <tt>volatile</tt>, then the optimizer is not allowed to modify the number
|
|
or order of execution of this <tt>store</tt> with other
|
|
volatile <tt>load</tt> and <tt><a href="#i_store">store</a></tt>
|
|
instructions.</p>
|
|
|
|
<p>The optional constant "align" argument specifies the alignment of the
|
|
operation (that is, the alignment of the memory address). A value of 0 or an
|
|
omitted "align" argument means that the operation has the preferential
|
|
alignment for the target. It is the responsibility of the code emitter to
|
|
ensure that the alignment information is correct. Overestimating the
|
|
alignment results in an undefined behavior. Underestimating the alignment may
|
|
produce less efficient code. An alignment of 1 is always safe.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The contents of memory are updated to contain '<tt><value></tt>' at the
|
|
location specified by the '<tt><pointer></tt>' operand. If
|
|
'<tt><value></tt>' is of scalar type then the number of bytes written
|
|
does not exceed the minimum number of bytes needed to hold all bits of the
|
|
type. For example, storing an <tt>i24</tt> writes at most three bytes. When
|
|
writing a value of a type like <tt>i20</tt> with a size that is not an
|
|
integral number of bytes, it is unspecified what happens to the extra bits
|
|
that do not belong to the type, but they will typically be overwritten.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%ptr = <a href="#i_alloca">alloca</a> i32 <i>; yields {i32*}:ptr</i>
|
|
store i32 3, i32* %ptr <i>; yields {void}</i>
|
|
%val = <a href="#i_load">load</a> i32* %ptr <i>; yields {i32}:val = i32 3</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_getelementptr">'<tt>getelementptr</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = getelementptr <pty>* <ptrval>{, <ty> <idx>}*
|
|
<result> = getelementptr inbounds <pty>* <ptrval>{, <ty> <idx>}*
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>getelementptr</tt>' instruction is used to get the address of a
|
|
subelement of an aggregate data structure. It performs address calculation
|
|
only and does not access memory.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is always a pointer, and forms the basis of the
|
|
calculation. The remaining arguments are indices that indicate which of the
|
|
elements of the aggregate object are indexed. The interpretation of each
|
|
index is dependent on the type being indexed into. The first index always
|
|
indexes the pointer value given as the first argument, the second index
|
|
indexes a value of the type pointed to (not necessarily the value directly
|
|
pointed to, since the first index can be non-zero), etc. The first type
|
|
indexed into must be a pointer value, subsequent types can be arrays, vectors
|
|
and structs. Note that subsequent types being indexed into can never be
|
|
pointers, since that would require loading the pointer before continuing
|
|
calculation.</p>
|
|
|
|
<p>The type of each index argument depends on the type it is indexing into.
|
|
When indexing into a (optionally packed) structure, only <tt>i32</tt> integer
|
|
<b>constants</b> are allowed. When indexing into an array, pointer or
|
|
vector, integers of any width are allowed, and they are not required to be
|
|
constant.</p>
|
|
|
|
<p>For example, let's consider a C code fragment and how it gets compiled to
|
|
LLVM:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
struct RT {
|
|
char A;
|
|
int B[10][20];
|
|
char C;
|
|
};
|
|
struct ST {
|
|
int X;
|
|
double Y;
|
|
struct RT Z;
|
|
};
|
|
|
|
int *foo(struct ST *s) {
|
|
return &s[1].Z.B[5][13];
|
|
}
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The LLVM code generated by the GCC frontend is:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%RT = <a href="#namedtypes">type</a> { i8 , [10 x [20 x i32]], i8 }
|
|
%ST = <a href="#namedtypes">type</a> { i32, double, %RT }
|
|
|
|
define i32* @foo(%ST* %s) {
|
|
entry:
|
|
%reg = getelementptr %ST* %s, i32 1, i32 2, i32 1, i32 5, i32 13
|
|
ret i32* %reg
|
|
}
|
|
</pre>
|
|
</div>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>In the example above, the first index is indexing into the '<tt>%ST*</tt>'
|
|
type, which is a pointer, yielding a '<tt>%ST</tt>' = '<tt>{ i32, double, %RT
|
|
}</tt>' type, a structure. The second index indexes into the third element
|
|
of the structure, yielding a '<tt>%RT</tt>' = '<tt>{ i8 , [10 x [20 x i32]],
|
|
i8 }</tt>' type, another structure. The third index indexes into the second
|
|
element of the structure, yielding a '<tt>[10 x [20 x i32]]</tt>' type, an
|
|
array. The two dimensions of the array are subscripted into, yielding an
|
|
'<tt>i32</tt>' type. The '<tt>getelementptr</tt>' instruction returns a
|
|
pointer to this element, thus computing a value of '<tt>i32*</tt>' type.</p>
|
|
|
|
<p>Note that it is perfectly legal to index partially through a structure,
|
|
returning a pointer to an inner element. Because of this, the LLVM code for
|
|
the given testcase is equivalent to:</p>
|
|
|
|
<pre>
|
|
define i32* @foo(%ST* %s) {
|
|
%t1 = getelementptr %ST* %s, i32 1 <i>; yields %ST*:%t1</i>
|
|
%t2 = getelementptr %ST* %t1, i32 0, i32 2 <i>; yields %RT*:%t2</i>
|
|
%t3 = getelementptr %RT* %t2, i32 0, i32 1 <i>; yields [10 x [20 x i32]]*:%t3</i>
|
|
%t4 = getelementptr [10 x [20 x i32]]* %t3, i32 0, i32 5 <i>; yields [20 x i32]*:%t4</i>
|
|
%t5 = getelementptr [20 x i32]* %t4, i32 0, i32 13 <i>; yields i32*:%t5</i>
|
|
ret i32* %t5
|
|
}
|
|
</pre>
|
|
|
|
<p>If the <tt>inbounds</tt> keyword is present, the result value of the
|
|
<tt>getelementptr</tt> is undefined if the base pointer is not an
|
|
<i>in bounds</i> address of an allocated object, or if any of the addresses
|
|
that would be formed by successive addition of the offsets implied by the
|
|
indices to the base address with infinitely precise arithmetic are not an
|
|
<i>in bounds</i> address of that allocated object.
|
|
The <i>in bounds</i> addresses for an allocated object are all the addresses
|
|
that point into the object, plus the address one byte past the end.</p>
|
|
|
|
<p>If the <tt>inbounds</tt> keyword is not present, the offsets are added to
|
|
the base address with silently-wrapping two's complement arithmetic, and
|
|
the result value of the <tt>getelementptr</tt> may be outside the object
|
|
pointed to by the base pointer. The result value may not necessarily be
|
|
used to access memory though, even if it happens to point into allocated
|
|
storage. See the <a href="#pointeraliasing">Pointer Aliasing Rules</a>
|
|
section for more information.</p>
|
|
|
|
<p>The getelementptr instruction is often confusing. For some more insight into
|
|
how it works, see <a href="GetElementPtr.html">the getelementptr FAQ</a>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<i>; yields [12 x i8]*:aptr</i>
|
|
%aptr = getelementptr {i32, [12 x i8]}* %saptr, i64 0, i32 1
|
|
<i>; yields i8*:vptr</i>
|
|
%vptr = getelementptr {i32, <2 x i8>}* %svptr, i64 0, i32 1, i32 1
|
|
<i>; yields i8*:eptr</i>
|
|
%eptr = getelementptr [12 x i8]* %aptr, i64 0, i32 1
|
|
<i>; yields i32*:iptr</i>
|
|
%iptr = getelementptr [10 x i32]* @arr, i16 0, i16 0
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="convertops">Conversion Operations</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The instructions in this category are the conversion instructions (casting)
|
|
which all take a single operand and a type. They perform various bit
|
|
conversions on the operand.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_trunc">'<tt>trunc .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = trunc <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>trunc</tt>' instruction truncates its operand to the
|
|
type <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>trunc</tt>' instruction takes a <tt>value</tt> to trunc, which must
|
|
be an <a href="#t_integer">integer</a> type, and a type that specifies the
|
|
size and type of the result, which must be
|
|
an <a href="#t_integer">integer</a> type. The bit size of <tt>value</tt> must
|
|
be larger than the bit size of <tt>ty2</tt>. Equal sized types are not
|
|
allowed.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>trunc</tt>' instruction truncates the high order bits
|
|
in <tt>value</tt> and converts the remaining bits to <tt>ty2</tt>. Since the
|
|
source size must be larger than the destination size, <tt>trunc</tt> cannot
|
|
be a <i>no-op cast</i>. It will always truncate bits.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = trunc i32 257 to i8 <i>; yields i8:1</i>
|
|
%Y = trunc i32 123 to i1 <i>; yields i1:true</i>
|
|
%Z = trunc i32 122 to i1 <i>; yields i1:false</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_zext">'<tt>zext .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = zext <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>zext</tt>' instruction zero extends its operand to type
|
|
<tt>ty2</tt>.</p>
|
|
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>zext</tt>' instruction takes a value to cast, which must be of
|
|
<a href="#t_integer">integer</a> type, and a type to cast it to, which must
|
|
also be of <a href="#t_integer">integer</a> type. The bit size of the
|
|
<tt>value</tt> must be smaller than the bit size of the destination type,
|
|
<tt>ty2</tt>.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The <tt>zext</tt> fills the high order bits of the <tt>value</tt> with zero
|
|
bits until it reaches the size of the destination type, <tt>ty2</tt>.</p>
|
|
|
|
<p>When zero extending from i1, the result will always be either 0 or 1.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = zext i32 257 to i64 <i>; yields i64:257</i>
|
|
%Y = zext i1 true to i32 <i>; yields i32:1</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_sext">'<tt>sext .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = sext <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>sext</tt>' sign extends <tt>value</tt> to the type <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>sext</tt>' instruction takes a value to cast, which must be of
|
|
<a href="#t_integer">integer</a> type, and a type to cast it to, which must
|
|
also be of <a href="#t_integer">integer</a> type. The bit size of the
|
|
<tt>value</tt> must be smaller than the bit size of the destination type,
|
|
<tt>ty2</tt>.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>sext</tt>' instruction performs a sign extension by copying the sign
|
|
bit (highest order bit) of the <tt>value</tt> until it reaches the bit size
|
|
of the type <tt>ty2</tt>.</p>
|
|
|
|
<p>When sign extending from i1, the extension always results in -1 or 0.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = sext i8 -1 to i16 <i>; yields i16 :65535</i>
|
|
%Y = sext i1 true to i32 <i>; yields i32:-1</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fptrunc">'<tt>fptrunc .. to</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fptrunc <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fptrunc</tt>' instruction truncates <tt>value</tt> to type
|
|
<tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>fptrunc</tt>' instruction takes a <a href="#t_floating">floating
|
|
point</a> value to cast and a <a href="#t_floating">floating point</a> type
|
|
to cast it to. The size of <tt>value</tt> must be larger than the size of
|
|
<tt>ty2</tt>. This implies that <tt>fptrunc</tt> cannot be used to make a
|
|
<i>no-op cast</i>.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>fptrunc</tt>' instruction truncates a <tt>value</tt> from a larger
|
|
<a href="#t_floating">floating point</a> type to a smaller
|
|
<a href="#t_floating">floating point</a> type. If the value cannot fit
|
|
within the destination type, <tt>ty2</tt>, then the results are
|
|
undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = fptrunc double 123.0 to float <i>; yields float:123.0</i>
|
|
%Y = fptrunc double 1.0E+300 to float <i>; yields undefined</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fpext">'<tt>fpext .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fpext <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fpext</tt>' extends a floating point <tt>value</tt> to a larger
|
|
floating point value.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>fpext</tt>' instruction takes a
|
|
<a href="#t_floating">floating point</a> <tt>value</tt> to cast, and
|
|
a <a href="#t_floating">floating point</a> type to cast it to. The source
|
|
type must be smaller than the destination type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>fpext</tt>' instruction extends the <tt>value</tt> from a smaller
|
|
<a href="#t_floating">floating point</a> type to a larger
|
|
<a href="#t_floating">floating point</a> type. The <tt>fpext</tt> cannot be
|
|
used to make a <i>no-op cast</i> because it always changes bits. Use
|
|
<tt>bitcast</tt> to make a <i>no-op cast</i> for a floating point cast.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = fpext float 3.1415 to double <i>; yields double:3.1415</i>
|
|
%Y = fpext float 1.0 to float <i>; yields float:1.0 (no-op)</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fptoui">'<tt>fptoui .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fptoui <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fptoui</tt>' converts a floating point <tt>value</tt> to its
|
|
unsigned integer equivalent of type <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>fptoui</tt>' instruction takes a value to cast, which must be a
|
|
scalar or vector <a href="#t_floating">floating point</a> value, and a type
|
|
to cast it to <tt>ty2</tt>, which must be an <a href="#t_integer">integer</a>
|
|
type. If <tt>ty</tt> is a vector floating point type, <tt>ty2</tt> must be a
|
|
vector integer type with the same number of elements as <tt>ty</tt></p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>fptoui</tt>' instruction converts its
|
|
<a href="#t_floating">floating point</a> operand into the nearest (rounding
|
|
towards zero) unsigned integer value. If the value cannot fit
|
|
in <tt>ty2</tt>, the results are undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = fptoui double 123.0 to i32 <i>; yields i32:123</i>
|
|
%Y = fptoui float 1.0E+300 to i1 <i>; yields undefined:1</i>
|
|
%Z = fptoui float 1.04E+17 to i8 <i>; yields undefined:1</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_fptosi">'<tt>fptosi .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fptosi <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fptosi</tt>' instruction converts
|
|
<a href="#t_floating">floating point</a> <tt>value</tt> to
|
|
type <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>fptosi</tt>' instruction takes a value to cast, which must be a
|
|
scalar or vector <a href="#t_floating">floating point</a> value, and a type
|
|
to cast it to <tt>ty2</tt>, which must be an <a href="#t_integer">integer</a>
|
|
type. If <tt>ty</tt> is a vector floating point type, <tt>ty2</tt> must be a
|
|
vector integer type with the same number of elements as <tt>ty</tt></p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>fptosi</tt>' instruction converts its
|
|
<a href="#t_floating">floating point</a> operand into the nearest (rounding
|
|
towards zero) signed integer value. If the value cannot fit in <tt>ty2</tt>,
|
|
the results are undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = fptosi double -123.0 to i32 <i>; yields i32:-123</i>
|
|
%Y = fptosi float 1.0E-247 to i1 <i>; yields undefined:1</i>
|
|
%Z = fptosi float 1.04E+17 to i8 <i>; yields undefined:1</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_uitofp">'<tt>uitofp .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = uitofp <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>uitofp</tt>' instruction regards <tt>value</tt> as an unsigned
|
|
integer and converts that value to the <tt>ty2</tt> type.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>uitofp</tt>' instruction takes a value to cast, which must be a
|
|
scalar or vector <a href="#t_integer">integer</a> value, and a type to cast
|
|
it to <tt>ty2</tt>, which must be an <a href="#t_floating">floating point</a>
|
|
type. If <tt>ty</tt> is a vector integer type, <tt>ty2</tt> must be a vector
|
|
floating point type with the same number of elements as <tt>ty</tt></p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>uitofp</tt>' instruction interprets its operand as an unsigned
|
|
integer quantity and converts it to the corresponding floating point
|
|
value. If the value cannot fit in the floating point value, the results are
|
|
undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = uitofp i32 257 to float <i>; yields float:257.0</i>
|
|
%Y = uitofp i8 -1 to double <i>; yields double:255.0</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_sitofp">'<tt>sitofp .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = sitofp <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>sitofp</tt>' instruction regards <tt>value</tt> as a signed integer
|
|
and converts that value to the <tt>ty2</tt> type.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>sitofp</tt>' instruction takes a value to cast, which must be a
|
|
scalar or vector <a href="#t_integer">integer</a> value, and a type to cast
|
|
it to <tt>ty2</tt>, which must be an <a href="#t_floating">floating point</a>
|
|
type. If <tt>ty</tt> is a vector integer type, <tt>ty2</tt> must be a vector
|
|
floating point type with the same number of elements as <tt>ty</tt></p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>sitofp</tt>' instruction interprets its operand as a signed integer
|
|
quantity and converts it to the corresponding floating point value. If the
|
|
value cannot fit in the floating point value, the results are undefined.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = sitofp i32 257 to float <i>; yields float:257.0</i>
|
|
%Y = sitofp i8 -1 to double <i>; yields double:-1.0</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_ptrtoint">'<tt>ptrtoint .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = ptrtoint <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>ptrtoint</tt>' instruction converts the pointer <tt>value</tt> to
|
|
the integer type <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>ptrtoint</tt>' instruction takes a <tt>value</tt> to cast, which
|
|
must be a <a href="#t_pointer">pointer</a> value, and a type to cast it to
|
|
<tt>ty2</tt>, which must be an <a href="#t_integer">integer</a> type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>ptrtoint</tt>' instruction converts <tt>value</tt> to integer type
|
|
<tt>ty2</tt> by interpreting the pointer value as an integer and either
|
|
truncating or zero extending that value to the size of the integer type. If
|
|
<tt>value</tt> is smaller than <tt>ty2</tt> then a zero extension is done. If
|
|
<tt>value</tt> is larger than <tt>ty2</tt> then a truncation is done. If they
|
|
are the same size, then nothing is done (<i>no-op cast</i>) other than a type
|
|
change.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = ptrtoint i32* %X to i8 <i>; yields truncation on 32-bit architecture</i>
|
|
%Y = ptrtoint i32* %x to i64 <i>; yields zero extension on 32-bit architecture</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_inttoptr">'<tt>inttoptr .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = inttoptr <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>inttoptr</tt>' instruction converts an integer <tt>value</tt> to a
|
|
pointer type, <tt>ty2</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>inttoptr</tt>' instruction takes an <a href="#t_integer">integer</a>
|
|
value to cast, and a type to cast it to, which must be a
|
|
<a href="#t_pointer">pointer</a> type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>inttoptr</tt>' instruction converts <tt>value</tt> to type
|
|
<tt>ty2</tt> by applying either a zero extension or a truncation depending on
|
|
the size of the integer <tt>value</tt>. If <tt>value</tt> is larger than the
|
|
size of a pointer then a truncation is done. If <tt>value</tt> is smaller
|
|
than the size of a pointer then a zero extension is done. If they are the
|
|
same size, nothing is done (<i>no-op cast</i>).</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = inttoptr i32 255 to i32* <i>; yields zero extension on 64-bit architecture</i>
|
|
%Y = inttoptr i32 255 to i32* <i>; yields no-op on 32-bit architecture</i>
|
|
%Z = inttoptr i64 0 to i32* <i>; yields truncation on 32-bit architecture</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_bitcast">'<tt>bitcast .. to</tt>' Instruction</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = bitcast <ty> <value> to <ty2> <i>; yields ty2</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
|
|
<tt>ty2</tt> without changing any bits.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>bitcast</tt>' instruction takes a value to cast, which must be a
|
|
non-aggregate first class value, and a type to cast it to, which must also be
|
|
a non-aggregate <a href="#t_firstclass">first class</a> type. The bit sizes
|
|
of <tt>value</tt> and the destination type, <tt>ty2</tt>, must be
|
|
identical. If the source type is a pointer, the destination type must also be
|
|
a pointer. This instruction supports bitwise conversion of vectors to
|
|
integers and to vectors of other types (as long as they have the same
|
|
size).</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>bitcast</tt>' instruction converts <tt>value</tt> to type
|
|
<tt>ty2</tt>. It is always a <i>no-op cast</i> because no bits change with
|
|
this conversion. The conversion is done as if the <tt>value</tt> had been
|
|
stored to memory and read back as type <tt>ty2</tt>. Pointer types may only
|
|
be converted to other pointer types with this instruction. To convert
|
|
pointers to other types, use the <a href="#i_inttoptr">inttoptr</a> or
|
|
<a href="#i_ptrtoint">ptrtoint</a> instructions first.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = bitcast i8 255 to i8 <i>; yields i8 :-1</i>
|
|
%Y = bitcast i32* %x to sint* <i>; yields sint*:%x</i>
|
|
%Z = bitcast <2 x int> %V to i64; <i>; yields i64: %V</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection"> <a name="otherops">Other Operations</a> </div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The instructions in this category are the "miscellaneous" instructions, which
|
|
defy better classification.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"><a name="i_icmp">'<tt>icmp</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = icmp <cond> <ty> <op1>, <op2> <i>; yields {i1} or {<N x i1>}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>icmp</tt>' instruction returns a boolean value or a vector of
|
|
boolean values based on comparison of its two integer, integer vector, or
|
|
pointer operands.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>icmp</tt>' instruction takes three operands. The first operand is
|
|
the condition code indicating the kind of comparison to perform. It is not a
|
|
value, just a keyword. The possible condition code are:</p>
|
|
|
|
<ol>
|
|
<li><tt>eq</tt>: equal</li>
|
|
<li><tt>ne</tt>: not equal </li>
|
|
<li><tt>ugt</tt>: unsigned greater than</li>
|
|
<li><tt>uge</tt>: unsigned greater or equal</li>
|
|
<li><tt>ult</tt>: unsigned less than</li>
|
|
<li><tt>ule</tt>: unsigned less or equal</li>
|
|
<li><tt>sgt</tt>: signed greater than</li>
|
|
<li><tt>sge</tt>: signed greater or equal</li>
|
|
<li><tt>slt</tt>: signed less than</li>
|
|
<li><tt>sle</tt>: signed less or equal</li>
|
|
</ol>
|
|
|
|
<p>The remaining two arguments must be <a href="#t_integer">integer</a> or
|
|
<a href="#t_pointer">pointer</a> or integer <a href="#t_vector">vector</a>
|
|
typed. They must also be identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>icmp</tt>' compares <tt>op1</tt> and <tt>op2</tt> according to the
|
|
condition code given as <tt>cond</tt>. The comparison performed always yields
|
|
either an <a href="#t_integer"><tt>i1</tt></a> or vector of <tt>i1</tt>
|
|
result, as follows:</p>
|
|
|
|
<ol>
|
|
<li><tt>eq</tt>: yields <tt>true</tt> if the operands are equal,
|
|
<tt>false</tt> otherwise. No sign interpretation is necessary or
|
|
performed.</li>
|
|
|
|
<li><tt>ne</tt>: yields <tt>true</tt> if the operands are unequal,
|
|
<tt>false</tt> otherwise. No sign interpretation is necessary or
|
|
performed.</li>
|
|
|
|
<li><tt>ugt</tt>: interprets the operands as unsigned values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is greater than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>uge</tt>: interprets the operands as unsigned values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is greater than or equal
|
|
to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ult</tt>: interprets the operands as unsigned values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is less than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ule</tt>: interprets the operands as unsigned values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is less than or equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>sgt</tt>: interprets the operands as signed values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is greater than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>sge</tt>: interprets the operands as signed values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is greater than or equal
|
|
to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>slt</tt>: interprets the operands as signed values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is less than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>sle</tt>: interprets the operands as signed values and yields
|
|
<tt>true</tt> if <tt>op1</tt> is less than or equal to <tt>op2</tt>.</li>
|
|
</ol>
|
|
|
|
<p>If the operands are <a href="#t_pointer">pointer</a> typed, the pointer
|
|
values are compared as if they were integers.</p>
|
|
|
|
<p>If the operands are integer vectors, then they are compared element by
|
|
element. The result is an <tt>i1</tt> vector with the same number of elements
|
|
as the values being compared. Otherwise, the result is an <tt>i1</tt>.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = icmp eq i32 4, 5 <i>; yields: result=false</i>
|
|
<result> = icmp ne float* %X, %X <i>; yields: result=false</i>
|
|
<result> = icmp ult i16 4, 5 <i>; yields: result=true</i>
|
|
<result> = icmp sgt i16 4, 5 <i>; yields: result=false</i>
|
|
<result> = icmp ule i16 -4, 5 <i>; yields: result=false</i>
|
|
<result> = icmp sge i16 4, 5 <i>; yields: result=false</i>
|
|
</pre>
|
|
|
|
<p>Note that the code generator does not yet support vector types with
|
|
the <tt>icmp</tt> instruction.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection"><a name="i_fcmp">'<tt>fcmp</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = fcmp <cond> <ty> <op1>, <op2> <i>; yields {i1} or {<N x i1>}:result</i>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>fcmp</tt>' instruction returns a boolean value or vector of boolean
|
|
values based on comparison of its operands.</p>
|
|
|
|
<p>If the operands are floating point scalars, then the result type is a boolean
|
|
(<a href="#t_integer"><tt>i1</tt></a>).</p>
|
|
|
|
<p>If the operands are floating point vectors, then the result type is a vector
|
|
of boolean with the same number of elements as the operands being
|
|
compared.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>fcmp</tt>' instruction takes three operands. The first operand is
|
|
the condition code indicating the kind of comparison to perform. It is not a
|
|
value, just a keyword. The possible condition code are:</p>
|
|
|
|
<ol>
|
|
<li><tt>false</tt>: no comparison, always returns false</li>
|
|
<li><tt>oeq</tt>: ordered and equal</li>
|
|
<li><tt>ogt</tt>: ordered and greater than </li>
|
|
<li><tt>oge</tt>: ordered and greater than or equal</li>
|
|
<li><tt>olt</tt>: ordered and less than </li>
|
|
<li><tt>ole</tt>: ordered and less than or equal</li>
|
|
<li><tt>one</tt>: ordered and not equal</li>
|
|
<li><tt>ord</tt>: ordered (no nans)</li>
|
|
<li><tt>ueq</tt>: unordered or equal</li>
|
|
<li><tt>ugt</tt>: unordered or greater than </li>
|
|
<li><tt>uge</tt>: unordered or greater than or equal</li>
|
|
<li><tt>ult</tt>: unordered or less than </li>
|
|
<li><tt>ule</tt>: unordered or less than or equal</li>
|
|
<li><tt>une</tt>: unordered or not equal</li>
|
|
<li><tt>uno</tt>: unordered (either nans)</li>
|
|
<li><tt>true</tt>: no comparison, always returns true</li>
|
|
</ol>
|
|
|
|
<p><i>Ordered</i> means that neither operand is a QNAN while
|
|
<i>unordered</i> means that either operand may be a QNAN.</p>
|
|
|
|
<p>Each of <tt>val1</tt> and <tt>val2</tt> arguments must be either
|
|
a <a href="#t_floating">floating point</a> type or
|
|
a <a href="#t_vector">vector</a> of floating point type. They must have
|
|
identical types.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>fcmp</tt>' instruction compares <tt>op1</tt> and <tt>op2</tt>
|
|
according to the condition code given as <tt>cond</tt>. If the operands are
|
|
vectors, then the vectors are compared element by element. Each comparison
|
|
performed always yields an <a href="#t_integer">i1</a> result, as
|
|
follows:</p>
|
|
|
|
<ol>
|
|
<li><tt>false</tt>: always yields <tt>false</tt>, regardless of operands.</li>
|
|
|
|
<li><tt>oeq</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ogt</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is greather than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>oge</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is greater than or equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>olt</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is less than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ole</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is less than or equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>one</tt>: yields <tt>true</tt> if both operands are not a QNAN and
|
|
<tt>op1</tt> is not equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ord</tt>: yields <tt>true</tt> if both operands are not a QNAN.</li>
|
|
|
|
<li><tt>ueq</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ugt</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is greater than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>uge</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is greater than or equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ult</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is less than <tt>op2</tt>.</li>
|
|
|
|
<li><tt>ule</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is less than or equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>une</tt>: yields <tt>true</tt> if either operand is a QNAN or
|
|
<tt>op1</tt> is not equal to <tt>op2</tt>.</li>
|
|
|
|
<li><tt>uno</tt>: yields <tt>true</tt> if either operand is a QNAN.</li>
|
|
|
|
<li><tt>true</tt>: always yields <tt>true</tt>, regardless of operands.</li>
|
|
</ol>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
<result> = fcmp oeq float 4.0, 5.0 <i>; yields: result=false</i>
|
|
<result> = fcmp one float 4.0, 5.0 <i>; yields: result=true</i>
|
|
<result> = fcmp olt float 4.0, 5.0 <i>; yields: result=true</i>
|
|
<result> = fcmp ueq double 1.0, 2.0 <i>; yields: result=false</i>
|
|
</pre>
|
|
|
|
<p>Note that the code generator does not yet support vector types with
|
|
the <tt>fcmp</tt> instruction.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_phi">'<tt>phi</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = phi <ty> [ <val0>, <label0>], ...
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>phi</tt>' instruction is used to implement the φ node in the
|
|
SSA graph representing the function.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The type of the incoming values is specified with the first type field. After
|
|
this, the '<tt>phi</tt>' instruction takes a list of pairs as arguments, with
|
|
one pair for each predecessor basic block of the current block. Only values
|
|
of <a href="#t_firstclass">first class</a> type may be used as the value
|
|
arguments to the PHI node. Only labels may be used as the label
|
|
arguments.</p>
|
|
|
|
<p>There must be no non-phi instructions between the start of a basic block and
|
|
the PHI instructions: i.e. PHI instructions must be first in a basic
|
|
block.</p>
|
|
|
|
<p>For the purposes of the SSA form, the use of each incoming value is deemed to
|
|
occur on the edge from the corresponding predecessor block to the current
|
|
block (but after any definition of an '<tt>invoke</tt>' instruction's return
|
|
value on the same edge).</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>At runtime, the '<tt>phi</tt>' instruction logically takes on the value
|
|
specified by the pair corresponding to the predecessor basic block that
|
|
executed just prior to the current block.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
Loop: ; Infinite loop that counts from 0 on up...
|
|
%indvar = phi i32 [ 0, %LoopHeader ], [ %nextindvar, %Loop ]
|
|
%nextindvar = add i32 %indvar, 1
|
|
br label %Loop
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_select">'<tt>select</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = select <i>selty</i> <cond>, <ty> <val1>, <ty> <val2> <i>; yields ty</i>
|
|
|
|
<i>selty</i> is either i1 or {<N x i1>}
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>select</tt>' instruction is used to choose one value based on a
|
|
condition, without branching.</p>
|
|
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The '<tt>select</tt>' instruction requires an 'i1' value or a vector of 'i1'
|
|
values indicating the condition, and two values of the
|
|
same <a href="#t_firstclass">first class</a> type. If the val1/val2 are
|
|
vectors and the condition is a scalar, then entire vectors are selected, not
|
|
individual elements.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>If the condition is an i1 and it evaluates to 1, the instruction returns the
|
|
first value argument; otherwise, it returns the second value argument.</p>
|
|
|
|
<p>If the condition is a vector of i1, then the value arguments must be vectors
|
|
of the same size, and the selection is done element by element.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%X = select i1 true, i8 17, i8 42 <i>; yields i8:17</i>
|
|
</pre>
|
|
|
|
<p>Note that the code generator does not yet support conditions
|
|
with vector type.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_call">'<tt>call</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<result> = [tail] call [<a href="#callingconv">cconv</a>] [<a href="#paramattrs">ret attrs</a>] <ty> [<fnty>*] <fnptrval>(<function args>) [<a href="#fnattrs">fn attrs</a>]
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>call</tt>' instruction represents a simple function call.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>This instruction requires several arguments:</p>
|
|
|
|
<ol>
|
|
<li>The optional "tail" marker indicates that the callee function does not
|
|
access any allocas or varargs in the caller. Note that calls may be
|
|
marked "tail" even if they do not occur before
|
|
a <a href="#i_ret"><tt>ret</tt></a> instruction. If the "tail" marker is
|
|
present, the function call is eligible for tail call optimization,
|
|
but <a href="CodeGenerator.html#tailcallopt">might not in fact be
|
|
optimized into a jump</a>. As of this writing, the extra requirements for
|
|
a call to actually be optimized are:
|
|
<ul>
|
|
<li>Caller and callee both have the calling
|
|
convention <tt>fastcc</tt>.</li>
|
|
<li>The call is in tail position (ret immediately follows call and ret
|
|
uses value of call or is void).</li>
|
|
<li>Option <tt>-tailcallopt</tt> is enabled,
|
|
or <code>llvm::PerformTailCallOpt</code> is <code>true</code>.</li>
|
|
<li><a href="CodeGenerator.html#tailcallopt">Platform specific
|
|
constraints are met.</a></li>
|
|
</ul>
|
|
</li>
|
|
|
|
<li>The optional "cconv" marker indicates which <a href="#callingconv">calling
|
|
convention</a> the call should use. If none is specified, the call
|
|
defaults to using C calling conventions. The calling convention of the
|
|
call must match the calling convention of the target function, or else the
|
|
behavior is undefined.</li>
|
|
|
|
<li>The optional <a href="#paramattrs">Parameter Attributes</a> list for
|
|
return values. Only '<tt>zeroext</tt>', '<tt>signext</tt>', and
|
|
'<tt>inreg</tt>' attributes are valid here.</li>
|
|
|
|
<li>'<tt>ty</tt>': the type of the call instruction itself which is also the
|
|
type of the return value. Functions that return no value are marked
|
|
<tt><a href="#t_void">void</a></tt>.</li>
|
|
|
|
<li>'<tt>fnty</tt>': shall be the signature of the pointer to function value
|
|
being invoked. The argument types must match the types implied by this
|
|
signature. This type can be omitted if the function is not varargs and if
|
|
the function type does not return a pointer to a function.</li>
|
|
|
|
<li>'<tt>fnptrval</tt>': An LLVM value containing a pointer to a function to
|
|
be invoked. In most cases, this is a direct function invocation, but
|
|
indirect <tt>call</tt>s are just as possible, calling an arbitrary pointer
|
|
to function value.</li>
|
|
|
|
<li>'<tt>function args</tt>': argument list whose types match the function
|
|
signature argument types. All arguments must be of
|
|
<a href="#t_firstclass">first class</a> type. If the function signature
|
|
indicates the function accepts a variable number of arguments, the extra
|
|
arguments can be specified.</li>
|
|
|
|
<li>The optional <a href="#fnattrs">function attributes</a> list. Only
|
|
'<tt>noreturn</tt>', '<tt>nounwind</tt>', '<tt>readonly</tt>' and
|
|
'<tt>readnone</tt>' attributes are valid here.</li>
|
|
</ol>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>call</tt>' instruction is used to cause control flow to transfer to
|
|
a specified function, with its incoming arguments bound to the specified
|
|
values. Upon a '<tt><a href="#i_ret">ret</a></tt>' instruction in the called
|
|
function, control flow continues with the instruction after the function
|
|
call, and the return value of the function is bound to the result
|
|
argument.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%retval = call i32 @test(i32 %argc)
|
|
call i32 (i8 *, ...)* @printf(i8 * %msg, i32 12, i8 42) <i>; yields i32</i>
|
|
%X = tail call i32 @foo() <i>; yields i32</i>
|
|
%Y = tail call <a href="#callingconv">fastcc</a> i32 @foo() <i>; yields i32</i>
|
|
call void %foo(i8 97 signext)
|
|
|
|
%struct.A = type { i32, i8 }
|
|
%r = call %struct.A @foo() <i>; yields { 32, i8 }</i>
|
|
%gr = extractvalue %struct.A %r, 0 <i>; yields i32</i>
|
|
%gr1 = extractvalue %struct.A %r, 1 <i>; yields i8</i>
|
|
%Z = call void @foo() noreturn <i>; indicates that %foo never returns normally</i>
|
|
%ZZ = call zeroext i32 @bar() <i>; Return value is %zero extended</i>
|
|
</pre>
|
|
|
|
<p>llvm treats calls to some functions with names and arguments that match the
|
|
standard C99 library as being the C99 library functions, and may perform
|
|
optimizations or generate code for them under that assumption. This is
|
|
something we'd like to change in the future to provide better support for
|
|
freestanding environments and non-C-based langauges.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="i_va_arg">'<tt>va_arg</tt>' Instruction</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
<resultval> = va_arg <va_list*> <arglist>, <argty>
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>va_arg</tt>' instruction is used to access arguments passed through
|
|
the "variable argument" area of a function call. It is used to implement the
|
|
<tt>va_arg</tt> macro in C.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>This instruction takes a <tt>va_list*</tt> value and the type of the
|
|
argument. It returns a value of the specified argument type and increments
|
|
the <tt>va_list</tt> to point to the next argument. The actual type
|
|
of <tt>va_list</tt> is target specific.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>va_arg</tt>' instruction loads an argument of the specified type
|
|
from the specified <tt>va_list</tt> and causes the <tt>va_list</tt> to point
|
|
to the next argument. For more information, see the variable argument
|
|
handling <a href="#int_varargs">Intrinsic Functions</a>.</p>
|
|
|
|
<p>It is legal for this instruction to be called in a function which does not
|
|
take a variable number of arguments, for example, the <tt>vfprintf</tt>
|
|
function.</p>
|
|
|
|
<p><tt>va_arg</tt> is an LLVM instruction instead of
|
|
an <a href="#intrinsics">intrinsic function</a> because it takes a type as an
|
|
argument.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<p>See the <a href="#int_varargs">variable argument processing</a> section.</p>
|
|
|
|
<p>Note that the code generator does not yet fully support va_arg on many
|
|
targets. Also, it does not currently support va_arg with aggregate types on
|
|
any target.</p>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<div class="doc_section"> <a name="intrinsics">Intrinsic Functions</a> </div>
|
|
<!-- *********************************************************************** -->
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM supports the notion of an "intrinsic function". These functions have
|
|
well known names and semantics and are required to follow certain
|
|
restrictions. Overall, these intrinsics represent an extension mechanism for
|
|
the LLVM language that does not require changing all of the transformations
|
|
in LLVM when adding to the language (or the bitcode reader/writer, the
|
|
parser, etc...).</p>
|
|
|
|
<p>Intrinsic function names must all start with an "<tt>llvm.</tt>" prefix. This
|
|
prefix is reserved in LLVM for intrinsic names; thus, function names may not
|
|
begin with this prefix. Intrinsic functions must always be external
|
|
functions: you cannot define the body of intrinsic functions. Intrinsic
|
|
functions may only be used in call or invoke instructions: it is illegal to
|
|
take the address of an intrinsic function. Additionally, because intrinsic
|
|
functions are part of the LLVM language, it is required if any are added that
|
|
they be documented here.</p>
|
|
|
|
<p>Some intrinsic functions can be overloaded, i.e., the intrinsic represents a
|
|
family of functions that perform the same operation but on different data
|
|
types. Because LLVM can represent over 8 million different integer types,
|
|
overloading is used commonly to allow an intrinsic function to operate on any
|
|
integer type. One or more of the argument types or the result type can be
|
|
overloaded to accept any integer type. Argument types may also be defined as
|
|
exactly matching a previous argument's type or the result type. This allows
|
|
an intrinsic function which accepts multiple arguments, but needs all of them
|
|
to be of the same type, to only be overloaded with respect to a single
|
|
argument or the result.</p>
|
|
|
|
<p>Overloaded intrinsics will have the names of its overloaded argument types
|
|
encoded into its function name, each preceded by a period. Only those types
|
|
which are overloaded result in a name suffix. Arguments whose type is matched
|
|
against another type do not. For example, the <tt>llvm.ctpop</tt> function
|
|
can take an integer of any width and returns an integer of exactly the same
|
|
integer width. This leads to a family of functions such as
|
|
<tt>i8 @llvm.ctpop.i8(i8 %val)</tt> and <tt>i29 @llvm.ctpop.i29(i29
|
|
%val)</tt>. Only one type, the return type, is overloaded, and only one type
|
|
suffix is required. Because the argument's type is matched against the return
|
|
type, it does not require its own name suffix.</p>
|
|
|
|
<p>To learn how to add an intrinsic function, please see the
|
|
<a href="ExtendingLLVM.html">Extending LLVM Guide</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_varargs">Variable Argument Handling Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>Variable argument support is defined in LLVM with
|
|
the <a href="#i_va_arg"><tt>va_arg</tt></a> instruction and these three
|
|
intrinsic functions. These functions are related to the similarly named
|
|
macros defined in the <tt><stdarg.h></tt> header file.</p>
|
|
|
|
<p>All of these functions operate on arguments that use a target-specific value
|
|
type "<tt>va_list</tt>". The LLVM assembly language reference manual does
|
|
not define what this type is, so all transformations should be prepared to
|
|
handle these functions regardless of the type used.</p>
|
|
|
|
<p>This example shows how the <a href="#i_va_arg"><tt>va_arg</tt></a>
|
|
instruction and the variable argument handling intrinsic functions are
|
|
used.</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
define i32 @test(i32 %X, ...) {
|
|
; Initialize variable argument processing
|
|
%ap = alloca i8*
|
|
%ap2 = bitcast i8** %ap to i8*
|
|
call void @llvm.va_start(i8* %ap2)
|
|
|
|
; Read a single integer argument
|
|
%tmp = va_arg i8** %ap, i32
|
|
|
|
; Demonstrate usage of llvm.va_copy and llvm.va_end
|
|
%aq = alloca i8*
|
|
%aq2 = bitcast i8** %aq to i8*
|
|
call void @llvm.va_copy(i8* %aq2, i8* %ap2)
|
|
call void @llvm.va_end(i8* %aq2)
|
|
|
|
; Stop processing of arguments.
|
|
call void @llvm.va_end(i8* %ap2)
|
|
ret i32 %tmp
|
|
}
|
|
|
|
declare void @llvm.va_start(i8*)
|
|
declare void @llvm.va_copy(i8*, i8*)
|
|
declare void @llvm.va_end(i8*)
|
|
</pre>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_va_start">'<tt>llvm.va_start</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void %llvm.va_start(i8* <arglist>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.va_start</tt>' intrinsic initializes <tt>*<arglist></tt>
|
|
for subsequent use by <tt><a href="#i_va_arg">va_arg</a></tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument is a pointer to a <tt>va_list</tt> element to initialize.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.va_start</tt>' intrinsic works just like the <tt>va_start</tt>
|
|
macro available in C. In a target-dependent way, it initializes
|
|
the <tt>va_list</tt> element to which the argument points, so that the next
|
|
call to <tt>va_arg</tt> will produce the first variable argument passed to
|
|
the function. Unlike the C <tt>va_start</tt> macro, this intrinsic does not
|
|
need to know the last argument of the function as the compiler can figure
|
|
that out.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_va_end">'<tt>llvm.va_end</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.va_end(i8* <arglist>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.va_end</tt>' intrinsic destroys <tt>*<arglist></tt>,
|
|
which has been initialized previously
|
|
with <tt><a href="#int_va_start">llvm.va_start</a></tt>
|
|
or <tt><a href="#i_va_copy">llvm.va_copy</a></tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument is a pointer to a <tt>va_list</tt> to destroy.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.va_end</tt>' intrinsic works just like the <tt>va_end</tt>
|
|
macro available in C. In a target-dependent way, it destroys
|
|
the <tt>va_list</tt> element to which the argument points. Calls
|
|
to <a href="#int_va_start"><tt>llvm.va_start</tt></a>
|
|
and <a href="#int_va_copy"> <tt>llvm.va_copy</tt></a> must be matched exactly
|
|
with calls to <tt>llvm.va_end</tt>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_va_copy">'<tt>llvm.va_copy</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.va_copy(i8* <destarglist>, i8* <srcarglist>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.va_copy</tt>' intrinsic copies the current argument position
|
|
from the source argument list to the destination argument list.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a pointer to a <tt>va_list</tt> element to initialize.
|
|
The second argument is a pointer to a <tt>va_list</tt> element to copy
|
|
from.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.va_copy</tt>' intrinsic works just like the <tt>va_copy</tt>
|
|
macro available in C. In a target-dependent way, it copies the
|
|
source <tt>va_list</tt> element into the destination <tt>va_list</tt>
|
|
element. This intrinsic is necessary because
|
|
the <tt><a href="#int_va_start"> llvm.va_start</a></tt> intrinsic may be
|
|
arbitrarily complex and require, for example, memory allocation.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_gc">Accurate Garbage Collection Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM support for <a href="GarbageCollection.html">Accurate Garbage
|
|
Collection</a> (GC) requires the implementation and generation of these
|
|
intrinsics. These intrinsics allow identification of <a href="#int_gcroot">GC
|
|
roots on the stack</a>, as well as garbage collector implementations that
|
|
require <a href="#int_gcread">read</a> and <a href="#int_gcwrite">write</a>
|
|
barriers. Front-ends for type-safe garbage collected languages should generate
|
|
these intrinsics to make use of the LLVM garbage collectors. For more details,
|
|
see <a href="GarbageCollection.html">Accurate Garbage Collection with
|
|
LLVM</a>.</p>
|
|
|
|
<p>The garbage collection intrinsics only operate on objects in the generic
|
|
address space (address space zero).</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_gcroot">'<tt>llvm.gcroot</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.gcroot(i8** %ptrloc, i8* %metadata)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.gcroot</tt>' intrinsic declares the existence of a GC root to
|
|
the code generator, and allows some metadata to be associated with it.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument specifies the address of a stack object that contains the
|
|
root pointer. The second pointer (which must be either a constant or a
|
|
global value address) contains the meta-data to be associated with the
|
|
root.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>At runtime, a call to this intrinsic stores a null pointer into the "ptrloc"
|
|
location. At compile-time, the code generator generates information to allow
|
|
the runtime to find the pointer at GC safe points. The '<tt>llvm.gcroot</tt>'
|
|
intrinsic may only be used in a function which <a href="#gc">specifies a GC
|
|
algorithm</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_gcread">'<tt>llvm.gcread</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i8* @llvm.gcread(i8* %ObjPtr, i8** %Ptr)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.gcread</tt>' intrinsic identifies reads of references from heap
|
|
locations, allowing garbage collector implementations that require read
|
|
barriers.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The second argument is the address to read from, which should be an address
|
|
allocated from the garbage collector. The first object is a pointer to the
|
|
start of the referenced object, if needed by the language runtime (otherwise
|
|
null).</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.gcread</tt>' intrinsic has the same semantics as a load
|
|
instruction, but may be replaced with substantially more complex code by the
|
|
garbage collector runtime, as needed. The '<tt>llvm.gcread</tt>' intrinsic
|
|
may only be used in a function which <a href="#gc">specifies a GC
|
|
algorithm</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_gcwrite">'<tt>llvm.gcwrite</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.gcwrite(i8* %P1, i8* %Obj, i8** %P2)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.gcwrite</tt>' intrinsic identifies writes of references to heap
|
|
locations, allowing garbage collector implementations that require write
|
|
barriers (such as generational or reference counting collectors).</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is the reference to store, the second is the start of the
|
|
object to store it to, and the third is the address of the field of Obj to
|
|
store to. If the runtime does not require a pointer to the object, Obj may
|
|
be null.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.gcwrite</tt>' intrinsic has the same semantics as a store
|
|
instruction, but may be replaced with substantially more complex code by the
|
|
garbage collector runtime, as needed. The '<tt>llvm.gcwrite</tt>' intrinsic
|
|
may only be used in a function which <a href="#gc">specifies a GC
|
|
algorithm</a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_codegen">Code Generator Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>These intrinsics are provided by LLVM to expose special features that may
|
|
only be implemented with code generator support.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_returnaddress">'<tt>llvm.returnaddress</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i8 *@llvm.returnaddress(i32 <level>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.returnaddress</tt>' intrinsic attempts to compute a
|
|
target-specific value indicating the return address of the current function
|
|
or one of its callers.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument to this intrinsic indicates which function to return the address
|
|
for. Zero indicates the calling function, one indicates its caller, etc.
|
|
The argument is <b>required</b> to be a constant integer value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.returnaddress</tt>' intrinsic either returns a pointer
|
|
indicating the return address of the specified call frame, or zero if it
|
|
cannot be identified. The value returned by this intrinsic is likely to be
|
|
incorrect or 0 for arguments other than zero, so it should only be used for
|
|
debugging purposes.</p>
|
|
|
|
<p>Note that calling this intrinsic does not prevent function inlining or other
|
|
aggressive transformations, so the value returned may not be that of the
|
|
obvious source-language caller.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_frameaddress">'<tt>llvm.frameaddress</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i8 *@llvm.frameaddress(i32 <level>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.frameaddress</tt>' intrinsic attempts to return the
|
|
target-specific frame pointer value for the specified stack frame.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument to this intrinsic indicates which function to return the frame
|
|
pointer for. Zero indicates the calling function, one indicates its caller,
|
|
etc. The argument is <b>required</b> to be a constant integer value.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.frameaddress</tt>' intrinsic either returns a pointer
|
|
indicating the frame address of the specified call frame, or zero if it
|
|
cannot be identified. The value returned by this intrinsic is likely to be
|
|
incorrect or 0 for arguments other than zero, so it should only be used for
|
|
debugging purposes.</p>
|
|
|
|
<p>Note that calling this intrinsic does not prevent function inlining or other
|
|
aggressive transformations, so the value returned may not be that of the
|
|
obvious source-language caller.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_stacksave">'<tt>llvm.stacksave</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i8 *@llvm.stacksave()
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.stacksave</tt>' intrinsic is used to remember the current state
|
|
of the function stack, for use
|
|
with <a href="#int_stackrestore"> <tt>llvm.stackrestore</tt></a>. This is
|
|
useful for implementing language features like scoped automatic variable
|
|
sized arrays in C99.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic returns a opaque pointer value that can be passed
|
|
to <a href="#int_stackrestore"><tt>llvm.stackrestore</tt></a>. When
|
|
an <tt>llvm.stackrestore</tt> intrinsic is executed with a value saved
|
|
from <tt>llvm.stacksave</tt>, it effectively restores the state of the stack
|
|
to the state it was in when the <tt>llvm.stacksave</tt> intrinsic executed.
|
|
In practice, this pops any <a href="#i_alloca">alloca</a> blocks from the
|
|
stack that were allocated after the <tt>llvm.stacksave</tt> was executed.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_stackrestore">'<tt>llvm.stackrestore</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.stackrestore(i8 * %ptr)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.stackrestore</tt>' intrinsic is used to restore the state of
|
|
the function stack to the state it was in when the
|
|
corresponding <a href="#int_stacksave"><tt>llvm.stacksave</tt></a> intrinsic
|
|
executed. This is useful for implementing language features like scoped
|
|
automatic variable sized arrays in C99.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>See the description
|
|
for <a href="#int_stacksave"><tt>llvm.stacksave</tt></a>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_prefetch">'<tt>llvm.prefetch</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.prefetch(i8* <address>, i32 <rw>, i32 <locality>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.prefetch</tt>' intrinsic is a hint to the code generator to
|
|
insert a prefetch instruction if supported; otherwise, it is a noop.
|
|
Prefetches have no effect on the behavior of the program but can change its
|
|
performance characteristics.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p><tt>address</tt> is the address to be prefetched, <tt>rw</tt> is the
|
|
specifier determining if the fetch should be for a read (0) or write (1),
|
|
and <tt>locality</tt> is a temporal locality specifier ranging from (0) - no
|
|
locality, to (3) - extremely local keep in cache. The <tt>rw</tt>
|
|
and <tt>locality</tt> arguments must be constant integers.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic does not modify the behavior of the program. In particular,
|
|
prefetches cannot trap and do not produce a value. On targets that support
|
|
this intrinsic, the prefetch can provide hints to the processor cache for
|
|
better performance.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_pcmarker">'<tt>llvm.pcmarker</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.pcmarker(i32 <id>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.pcmarker</tt>' intrinsic is a method to export a Program
|
|
Counter (PC) in a region of code to simulators and other tools. The method
|
|
is target specific, but it is expected that the marker will use exported
|
|
symbols to transmit the PC of the marker. The marker makes no guarantees
|
|
that it will remain with any specific instruction after optimizations. It is
|
|
possible that the presence of a marker will inhibit optimizations. The
|
|
intended use is to be inserted after optimizations to allow correlations of
|
|
simulation runs.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p><tt>id</tt> is a numerical id identifying the marker.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic does not modify the behavior of the program. Backends that do
|
|
not support this intrinisic may ignore it.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_readcyclecounter">'<tt>llvm.readcyclecounter</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i64 @llvm.readcyclecounter( )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.readcyclecounter</tt>' intrinsic provides access to the cycle
|
|
counter register (or similar low latency, high accuracy clocks) on those
|
|
targets that support it. On X86, it should map to RDTSC. On Alpha, it
|
|
should map to RPCC. As the backing counters overflow quickly (on the order
|
|
of 9 seconds on alpha), this should only be used for small timings.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>When directly supported, reading the cycle counter should not modify any
|
|
memory. Implementations are allowed to either return a application specific
|
|
value or a system wide value. On backends without support, this is lowered
|
|
to a constant 0.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_libc">Standard C Library Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM provides intrinsics for a few important standard C library functions.
|
|
These intrinsics allow source-language front-ends to pass information about
|
|
the alignment of the pointer arguments to the code generator, providing
|
|
opportunity for more efficient code generation.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_memcpy">'<tt>llvm.memcpy</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.memcpy</tt> on any
|
|
integer bit width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare void @llvm.memcpy.i8(i8 * <dest>, i8 * <src>,
|
|
i8 <len>, i32 <align>)
|
|
declare void @llvm.memcpy.i16(i8 * <dest>, i8 * <src>,
|
|
i16 <len>, i32 <align>)
|
|
declare void @llvm.memcpy.i32(i8 * <dest>, i8 * <src>,
|
|
i32 <len>, i32 <align>)
|
|
declare void @llvm.memcpy.i64(i8 * <dest>, i8 * <src>,
|
|
i64 <len>, i32 <align>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.memcpy.*</tt>' intrinsics copy a block of memory from the
|
|
source location to the destination location.</p>
|
|
|
|
<p>Note that, unlike the standard libc function, the <tt>llvm.memcpy.*</tt>
|
|
intrinsics do not return a value, and takes an extra alignment argument.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a pointer to the destination, the second is a pointer
|
|
to the source. The third argument is an integer argument specifying the
|
|
number of bytes to copy, and the fourth argument is the alignment of the
|
|
source and destination locations.</p>
|
|
|
|
<p>If the call to this intrinisic has an alignment value that is not 0 or 1,
|
|
then the caller guarantees that both the source and destination pointers are
|
|
aligned to that boundary.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.memcpy.*</tt>' intrinsics copy a block of memory from the
|
|
source location to the destination location, which are not allowed to
|
|
overlap. It copies "len" bytes of memory over. If the argument is known to
|
|
be aligned to some boundary, this can be specified as the fourth argument,
|
|
otherwise it should be set to 0 or 1.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_memmove">'<tt>llvm.memmove</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use llvm.memmove on any integer bit
|
|
width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare void @llvm.memmove.i8(i8 * <dest>, i8 * <src>,
|
|
i8 <len>, i32 <align>)
|
|
declare void @llvm.memmove.i16(i8 * <dest>, i8 * <src>,
|
|
i16 <len>, i32 <align>)
|
|
declare void @llvm.memmove.i32(i8 * <dest>, i8 * <src>,
|
|
i32 <len>, i32 <align>)
|
|
declare void @llvm.memmove.i64(i8 * <dest>, i8 * <src>,
|
|
i64 <len>, i32 <align>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.memmove.*</tt>' intrinsics move a block of memory from the
|
|
source location to the destination location. It is similar to the
|
|
'<tt>llvm.memcpy</tt>' intrinsic but allows the two memory locations to
|
|
overlap.</p>
|
|
|
|
<p>Note that, unlike the standard libc function, the <tt>llvm.memmove.*</tt>
|
|
intrinsics do not return a value, and takes an extra alignment argument.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a pointer to the destination, the second is a pointer
|
|
to the source. The third argument is an integer argument specifying the
|
|
number of bytes to copy, and the fourth argument is the alignment of the
|
|
source and destination locations.</p>
|
|
|
|
<p>If the call to this intrinisic has an alignment value that is not 0 or 1,
|
|
then the caller guarantees that the source and destination pointers are
|
|
aligned to that boundary.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.memmove.*</tt>' intrinsics copy a block of memory from the
|
|
source location to the destination location, which may overlap. It copies
|
|
"len" bytes of memory over. If the argument is known to be aligned to some
|
|
boundary, this can be specified as the fourth argument, otherwise it should
|
|
be set to 0 or 1.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_memset">'<tt>llvm.memset.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use llvm.memset on any integer bit
|
|
width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare void @llvm.memset.i8(i8 * <dest>, i8 <val>,
|
|
i8 <len>, i32 <align>)
|
|
declare void @llvm.memset.i16(i8 * <dest>, i8 <val>,
|
|
i16 <len>, i32 <align>)
|
|
declare void @llvm.memset.i32(i8 * <dest>, i8 <val>,
|
|
i32 <len>, i32 <align>)
|
|
declare void @llvm.memset.i64(i8 * <dest>, i8 <val>,
|
|
i64 <len>, i32 <align>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.memset.*</tt>' intrinsics fill a block of memory with a
|
|
particular byte value.</p>
|
|
|
|
<p>Note that, unlike the standard libc function, the <tt>llvm.memset</tt>
|
|
intrinsic does not return a value, and takes an extra alignment argument.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a pointer to the destination to fill, the second is the
|
|
byte value to fill it with, the third argument is an integer argument
|
|
specifying the number of bytes to fill, and the fourth argument is the known
|
|
alignment of destination location.</p>
|
|
|
|
<p>If the call to this intrinisic has an alignment value that is not 0 or 1,
|
|
then the caller guarantees that the destination pointer is aligned to that
|
|
boundary.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.memset.*</tt>' intrinsics fill "len" bytes of memory starting
|
|
at the destination location. If the argument is known to be aligned to some
|
|
boundary, this can be specified as the fourth argument, otherwise it should
|
|
be set to 0 or 1.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_sqrt">'<tt>llvm.sqrt.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.sqrt</tt> on any
|
|
floating point or vector of floating point type. Not all targets support all
|
|
types however.</p>
|
|
|
|
<pre>
|
|
declare float @llvm.sqrt.f32(float %Val)
|
|
declare double @llvm.sqrt.f64(double %Val)
|
|
declare x86_fp80 @llvm.sqrt.f80(x86_fp80 %Val)
|
|
declare fp128 @llvm.sqrt.f128(fp128 %Val)
|
|
declare ppc_fp128 @llvm.sqrt.ppcf128(ppc_fp128 %Val)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.sqrt</tt>' intrinsics return the sqrt of the specified operand,
|
|
returning the same value as the libm '<tt>sqrt</tt>' functions would.
|
|
Unlike <tt>sqrt</tt> in libm, however, <tt>llvm.sqrt</tt> has undefined
|
|
behavior for negative numbers other than -0.0 (which allows for better
|
|
optimization, because there is no need to worry about errno being
|
|
set). <tt>llvm.sqrt(-0.0)</tt> is defined to return -0.0 like IEEE sqrt.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument and return value are floating point numbers of the same
|
|
type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This function returns the sqrt of the specified operand if it is a
|
|
nonnegative floating point number.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_powi">'<tt>llvm.powi.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.powi</tt> on any
|
|
floating point or vector of floating point type. Not all targets support all
|
|
types however.</p>
|
|
|
|
<pre>
|
|
declare float @llvm.powi.f32(float %Val, i32 %power)
|
|
declare double @llvm.powi.f64(double %Val, i32 %power)
|
|
declare x86_fp80 @llvm.powi.f80(x86_fp80 %Val, i32 %power)
|
|
declare fp128 @llvm.powi.f128(fp128 %Val, i32 %power)
|
|
declare ppc_fp128 @llvm.powi.ppcf128(ppc_fp128 %Val, i32 %power)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.powi.*</tt>' intrinsics return the first operand raised to the
|
|
specified (positive or negative) power. The order of evaluation of
|
|
multiplications is not defined. When a vector of floating point type is
|
|
used, the second argument remains a scalar integer value.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The second argument is an integer power, and the first is a value to raise to
|
|
that power.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This function returns the first value raised to the second power with an
|
|
unspecified sequence of rounding operations.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_sin">'<tt>llvm.sin.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.sin</tt> on any
|
|
floating point or vector of floating point type. Not all targets support all
|
|
types however.</p>
|
|
|
|
<pre>
|
|
declare float @llvm.sin.f32(float %Val)
|
|
declare double @llvm.sin.f64(double %Val)
|
|
declare x86_fp80 @llvm.sin.f80(x86_fp80 %Val)
|
|
declare fp128 @llvm.sin.f128(fp128 %Val)
|
|
declare ppc_fp128 @llvm.sin.ppcf128(ppc_fp128 %Val)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.sin.*</tt>' intrinsics return the sine of the operand.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument and return value are floating point numbers of the same
|
|
type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This function returns the sine of the specified operand, returning the same
|
|
values as the libm <tt>sin</tt> functions would, and handles error conditions
|
|
in the same way.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_cos">'<tt>llvm.cos.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.cos</tt> on any
|
|
floating point or vector of floating point type. Not all targets support all
|
|
types however.</p>
|
|
|
|
<pre>
|
|
declare float @llvm.cos.f32(float %Val)
|
|
declare double @llvm.cos.f64(double %Val)
|
|
declare x86_fp80 @llvm.cos.f80(x86_fp80 %Val)
|
|
declare fp128 @llvm.cos.f128(fp128 %Val)
|
|
declare ppc_fp128 @llvm.cos.ppcf128(ppc_fp128 %Val)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.cos.*</tt>' intrinsics return the cosine of the operand.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The argument and return value are floating point numbers of the same
|
|
type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This function returns the cosine of the specified operand, returning the same
|
|
values as the libm <tt>cos</tt> functions would, and handles error conditions
|
|
in the same way.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_pow">'<tt>llvm.pow.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.pow</tt> on any
|
|
floating point or vector of floating point type. Not all targets support all
|
|
types however.</p>
|
|
|
|
<pre>
|
|
declare float @llvm.pow.f32(float %Val, float %Power)
|
|
declare double @llvm.pow.f64(double %Val, double %Power)
|
|
declare x86_fp80 @llvm.pow.f80(x86_fp80 %Val, x86_fp80 %Power)
|
|
declare fp128 @llvm.pow.f128(fp128 %Val, fp128 %Power)
|
|
declare ppc_fp128 @llvm.pow.ppcf128(ppc_fp128 %Val, ppc_fp128 Power)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.pow.*</tt>' intrinsics return the first operand raised to the
|
|
specified (positive or negative) power.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The second argument is a floating point power, and the first is a value to
|
|
raise to that power.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This function returns the first value raised to the second power, returning
|
|
the same values as the libm <tt>pow</tt> functions would, and handles error
|
|
conditions in the same way.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_manip">Bit Manipulation Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM provides intrinsics for a few important bit manipulation operations.
|
|
These allow efficient code generation for some algorithms.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_bswap">'<tt>llvm.bswap.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic function. You can use bswap on any integer
|
|
type that is an even number of bytes (i.e. BitWidth % 16 == 0).</p>
|
|
|
|
<pre>
|
|
declare i16 @llvm.bswap.i16(i16 <id>)
|
|
declare i32 @llvm.bswap.i32(i32 <id>)
|
|
declare i64 @llvm.bswap.i64(i64 <id>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.bswap</tt>' family of intrinsics is used to byte swap integer
|
|
values with an even number of bytes (positive multiple of 16 bits). These
|
|
are useful for performing operations on data that is not in the target's
|
|
native byte order.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The <tt>llvm.bswap.i16</tt> intrinsic returns an i16 value that has the high
|
|
and low byte of the input i16 swapped. Similarly,
|
|
the <tt>llvm.bswap.i32</tt> intrinsic returns an i32 value that has the four
|
|
bytes of the input i32 swapped, so that if the input bytes are numbered 0, 1,
|
|
2, 3 then the returned i32 will have its bytes in 3, 2, 1, 0 order.
|
|
The <tt>llvm.bswap.i48</tt>, <tt>llvm.bswap.i64</tt> and other intrinsics
|
|
extend this concept to additional even-byte lengths (6 bytes, 8 bytes and
|
|
more, respectively).</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_ctpop">'<tt>llvm.ctpop.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use llvm.ctpop on any integer bit
|
|
width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.ctpop.i8(i8 <src>)
|
|
declare i16 @llvm.ctpop.i16(i16 <src>)
|
|
declare i32 @llvm.ctpop.i32(i32 <src>)
|
|
declare i64 @llvm.ctpop.i64(i64 <src>)
|
|
declare i256 @llvm.ctpop.i256(i256 <src>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.ctpop</tt>' family of intrinsics counts the number of bits set
|
|
in a value.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The only argument is the value to be counted. The argument may be of any
|
|
integer type. The return type must match the argument type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.ctpop</tt>' intrinsic counts the 1's in a variable.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_ctlz">'<tt>llvm.ctlz.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.ctlz</tt> on any
|
|
integer bit width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.ctlz.i8 (i8 <src>)
|
|
declare i16 @llvm.ctlz.i16(i16 <src>)
|
|
declare i32 @llvm.ctlz.i32(i32 <src>)
|
|
declare i64 @llvm.ctlz.i64(i64 <src>)
|
|
declare i256 @llvm.ctlz.i256(i256 <src>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.ctlz</tt>' family of intrinsic functions counts the number of
|
|
leading zeros in a variable.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The only argument is the value to be counted. The argument may be of any
|
|
integer type. The return type must match the argument type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.ctlz</tt>' intrinsic counts the leading (most significant)
|
|
zeros in a variable. If the src == 0 then the result is the size in bits of
|
|
the type of src. For example, <tt>llvm.ctlz(i32 2) = 30</tt>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_cttz">'<tt>llvm.cttz.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.cttz</tt> on any
|
|
integer bit width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.cttz.i8 (i8 <src>)
|
|
declare i16 @llvm.cttz.i16(i16 <src>)
|
|
declare i32 @llvm.cttz.i32(i32 <src>)
|
|
declare i64 @llvm.cttz.i64(i64 <src>)
|
|
declare i256 @llvm.cttz.i256(i256 <src>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.cttz</tt>' family of intrinsic functions counts the number of
|
|
trailing zeros.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The only argument is the value to be counted. The argument may be of any
|
|
integer type. The return type must match the argument type.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.cttz</tt>' intrinsic counts the trailing (least significant)
|
|
zeros in a variable. If the src == 0 then the result is the size in bits of
|
|
the type of src. For example, <tt>llvm.cttz(2) = 1</tt>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_overflow">Arithmetic with Overflow Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>LLVM provides intrinsics for some arithmetic with overflow operations.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_sadd_overflow">'<tt>llvm.sadd.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.sadd.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.sadd.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.sadd.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.sadd.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.sadd.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed addition of the two arguments, and indicate whether an overflow
|
|
occurred during the signed summation.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo signed addition.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.sadd.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed addition of the two variables. They return a structure — the
|
|
first element of which is the signed summation, and the second element of
|
|
which is a bit specifying if the signed summation resulted in an
|
|
overflow.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %overflow, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_uadd_overflow">'<tt>llvm.uadd.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.uadd.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.uadd.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.uadd.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.uadd.with.overflow</tt>' family of intrinsic functions perform
|
|
an unsigned addition of the two arguments, and indicate whether a carry
|
|
occurred during the unsigned summation.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo unsigned addition.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.uadd.with.overflow</tt>' family of intrinsic functions perform
|
|
an unsigned addition of the two arguments. They return a structure —
|
|
the first element of which is the sum, and the second element of which is a
|
|
bit specifying if the unsigned summation resulted in a carry.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %carry, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_ssub_overflow">'<tt>llvm.ssub.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.ssub.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.ssub.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.ssub.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.ssub.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.ssub.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed subtraction of the two arguments, and indicate whether an overflow
|
|
occurred during the signed subtraction.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo signed subtraction.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.ssub.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed subtraction of the two arguments. They return a structure —
|
|
the first element of which is the subtraction, and the second element of
|
|
which is a bit specifying if the signed subtraction resulted in an
|
|
overflow.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %overflow, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_usub_overflow">'<tt>llvm.usub.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.usub.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.usub.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.usub.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.usub.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.usub.with.overflow</tt>' family of intrinsic functions perform
|
|
an unsigned subtraction of the two arguments, and indicate whether an
|
|
overflow occurred during the unsigned subtraction.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo unsigned subtraction.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.usub.with.overflow</tt>' family of intrinsic functions perform
|
|
an unsigned subtraction of the two arguments. They return a structure —
|
|
the first element of which is the subtraction, and the second element of
|
|
which is a bit specifying if the unsigned subtraction resulted in an
|
|
overflow.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %overflow, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_smul_overflow">'<tt>llvm.smul.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.smul.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.smul.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.smul.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.smul.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
|
|
<p>The '<tt>llvm.smul.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed multiplication of the two arguments, and indicate whether an
|
|
overflow occurred during the signed multiplication.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo signed multiplication.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.smul.with.overflow</tt>' family of intrinsic functions perform
|
|
a signed multiplication of the two arguments. They return a structure —
|
|
the first element of which is the multiplication, and the second element of
|
|
which is a bit specifying if the signed multiplication resulted in an
|
|
overflow.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.smul.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %overflow, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_umul_overflow">'<tt>llvm.umul.with.overflow.*</tt>' Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.umul.with.overflow</tt>
|
|
on any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare {i16, i1} @llvm.umul.with.overflow.i16(i16 %a, i16 %b)
|
|
declare {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b)
|
|
declare {i64, i1} @llvm.umul.with.overflow.i64(i64 %a, i64 %b)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.umul.with.overflow</tt>' family of intrinsic functions perform
|
|
a unsigned multiplication of the two arguments, and indicate whether an
|
|
overflow occurred during the unsigned multiplication.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The arguments (%a and %b) and the first element of the result structure may
|
|
be of integer types of any bit width, but they must have the same bit
|
|
width. The second element of the result structure must be of
|
|
type <tt>i1</tt>. <tt>%a</tt> and <tt>%b</tt> are the two values that will
|
|
undergo unsigned multiplication.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The '<tt>llvm.umul.with.overflow</tt>' family of intrinsic functions perform
|
|
an unsigned multiplication of the two arguments. They return a structure
|
|
— the first element of which is the multiplication, and the second
|
|
element of which is a bit specifying if the unsigned multiplication resulted
|
|
in an overflow.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%res = call {i32, i1} @llvm.umul.with.overflow.i32(i32 %a, i32 %b)
|
|
%sum = extractvalue {i32, i1} %res, 0
|
|
%obit = extractvalue {i32, i1} %res, 1
|
|
br i1 %obit, label %overflow, label %normal
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_debugger">Debugger Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The LLVM debugger intrinsics (which all start with <tt>llvm.dbg.</tt>
|
|
prefix), are described in
|
|
the <a href="SourceLevelDebugging.html#format_common_intrinsics">LLVM Source
|
|
Level Debugging</a> document.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_eh">Exception Handling Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>The LLVM exception handling intrinsics (which all start with
|
|
<tt>llvm.eh.</tt> prefix), are described in
|
|
the <a href="ExceptionHandling.html#format_common_intrinsics">LLVM Exception
|
|
Handling</a> document.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_trampoline">Trampoline Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>This intrinsic makes it possible to excise one parameter, marked with
|
|
the <tt>nest</tt> attribute, from a function. The result is a callable
|
|
function pointer lacking the nest parameter - the caller does not need to
|
|
provide a value for it. Instead, the value to use is stored in advance in a
|
|
"trampoline", a block of memory usually allocated on the stack, which also
|
|
contains code to splice the nest value into the argument list. This is used
|
|
to implement the GCC nested function address extension.</p>
|
|
|
|
<p>For example, if the function is
|
|
<tt>i32 f(i8* nest %c, i32 %x, i32 %y)</tt> then the resulting function
|
|
pointer has signature <tt>i32 (i32, i32)*</tt>. It can be created as
|
|
follows:</p>
|
|
|
|
<div class="doc_code">
|
|
<pre>
|
|
%tramp = alloca [10 x i8], align 4 ; size and alignment only correct for X86
|
|
%tramp1 = getelementptr [10 x i8]* %tramp, i32 0, i32 0
|
|
%p = call i8* @llvm.init.trampoline( i8* %tramp1, i8* bitcast (i32 (i8* nest , i32, i32)* @f to i8*), i8* %nval )
|
|
%fp = bitcast i8* %p to i32 (i32, i32)*
|
|
</pre>
|
|
</div>
|
|
|
|
<p>The call <tt>%val = call i32 %fp( i32 %x, i32 %y )</tt> is then equivalent
|
|
to <tt>%val = call i32 %f( i8* %nval, i32 %x, i32 %y )</tt>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_it">'<tt>llvm.init.trampoline</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i8* @llvm.init.trampoline(i8* <tramp>, i8* <func>, i8* <nval>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>This fills the memory pointed to by <tt>tramp</tt> with code and returns a
|
|
function pointer suitable for executing it.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.init.trampoline</tt> intrinsic takes three arguments, all
|
|
pointers. The <tt>tramp</tt> argument must point to a sufficiently large and
|
|
sufficiently aligned block of memory; this memory is written to by the
|
|
intrinsic. Note that the size and the alignment are target-specific - LLVM
|
|
currently provides no portable way of determining them, so a front-end that
|
|
generates this intrinsic needs to have some target-specific knowledge.
|
|
The <tt>func</tt> argument must hold a function bitcast to
|
|
an <tt>i8*</tt>.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The block of memory pointed to by <tt>tramp</tt> is filled with target
|
|
dependent code, turning it into a function. A pointer to this function is
|
|
returned, but needs to be bitcast to an <a href="#int_trampoline">appropriate
|
|
function pointer type</a> before being called. The new function's signature
|
|
is the same as that of <tt>func</tt> with any arguments marked with
|
|
the <tt>nest</tt> attribute removed. At most one such <tt>nest</tt> argument
|
|
is allowed, and it must be of pointer type. Calling the new function is
|
|
equivalent to calling <tt>func</tt> with the same argument list, but
|
|
with <tt>nval</tt> used for the missing <tt>nest</tt> argument. If, after
|
|
calling <tt>llvm.init.trampoline</tt>, the memory pointed to
|
|
by <tt>tramp</tt> is modified, then the effect of any later call to the
|
|
returned function pointer is undefined.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_atomics">Atomic Operations and Synchronization Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>These intrinsic functions expand the "universal IR" of LLVM to represent
|
|
hardware constructs for atomic operations and memory synchronization. This
|
|
provides an interface to the hardware, not an interface to the programmer. It
|
|
is aimed at a low enough level to allow any programming models or APIs
|
|
(Application Programming Interfaces) which need atomic behaviors to map
|
|
cleanly onto it. It is also modeled primarily on hardware behavior. Just as
|
|
hardware provides a "universal IR" for source languages, it also provides a
|
|
starting point for developing a "universal" atomic operation and
|
|
synchronization IR.</p>
|
|
|
|
<p>These do <em>not</em> form an API such as high-level threading libraries,
|
|
software transaction memory systems, atomic primitives, and intrinsic
|
|
functions as found in BSD, GNU libc, atomic_ops, APR, and other system and
|
|
application libraries. The hardware interface provided by LLVM should allow
|
|
a clean implementation of all of these APIs and parallel programming models.
|
|
No one model or paradigm should be selected above others unless the hardware
|
|
itself ubiquitously does so.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_memory_barrier">'<tt>llvm.memory.barrier</tt>' Intrinsic</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.memory.barrier( i1 <ll>, i1 <ls>, i1 <sl>, i1 <ss>, i1 <device> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The <tt>llvm.memory.barrier</tt> intrinsic guarantees ordering between
|
|
specific pairs of memory access types.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.memory.barrier</tt> intrinsic requires five boolean arguments.
|
|
The first four arguments enables a specific barrier as listed below. The
|
|
fith argument specifies that the barrier applies to io or device or uncached
|
|
memory.</p>
|
|
|
|
<ul>
|
|
<li><tt>ll</tt>: load-load barrier</li>
|
|
<li><tt>ls</tt>: load-store barrier</li>
|
|
<li><tt>sl</tt>: store-load barrier</li>
|
|
<li><tt>ss</tt>: store-store barrier</li>
|
|
<li><tt>device</tt>: barrier applies to device and uncached memory also.</li>
|
|
</ul>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic causes the system to enforce some ordering constraints upon
|
|
the loads and stores of the program. This barrier does not
|
|
indicate <em>when</em> any events will occur, it only enforces
|
|
an <em>order</em> in which they occur. For any of the specified pairs of load
|
|
and store operations (f.ex. load-load, or store-load), all of the first
|
|
operations preceding the barrier will complete before any of the second
|
|
operations succeeding the barrier begin. Specifically the semantics for each
|
|
pairing is as follows:</p>
|
|
|
|
<ul>
|
|
<li><tt>ll</tt>: All loads before the barrier must complete before any load
|
|
after the barrier begins.</li>
|
|
<li><tt>ls</tt>: All loads before the barrier must complete before any
|
|
store after the barrier begins.</li>
|
|
<li><tt>ss</tt>: All stores before the barrier must complete before any
|
|
store after the barrier begins.</li>
|
|
<li><tt>sl</tt>: All stores before the barrier must complete before any
|
|
load after the barrier begins.</li>
|
|
</ul>
|
|
|
|
<p>These semantics are applied with a logical "and" behavior when more than one
|
|
is enabled in a single memory barrier intrinsic.</p>
|
|
|
|
<p>Backends may implement stronger barriers than those requested when they do
|
|
not support as fine grained a barrier as requested. Some architectures do
|
|
not need all types of barriers and on such architectures, these become
|
|
noops.</p>
|
|
|
|
<h5>Example:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 4, %ptr
|
|
|
|
%result1 = load i32* %ptr <i>; yields {i32}:result1 = 4</i>
|
|
call void @llvm.memory.barrier( i1 false, i1 true, i1 false, i1 false )
|
|
<i>; guarantee the above finishes</i>
|
|
store i32 8, %ptr <i>; before this begins</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_cmp_swap">'<tt>llvm.atomic.cmp.swap.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.atomic.cmp.swap</tt> on
|
|
any integer bit width and for different address spaces. Not all targets
|
|
support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.cmp.swap.i8.p0i8( i8* <ptr>, i8 <cmp>, i8 <val> )
|
|
declare i16 @llvm.atomic.cmp.swap.i16.p0i16( i16* <ptr>, i16 <cmp>, i16 <val> )
|
|
declare i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* <ptr>, i32 <cmp>, i32 <val> )
|
|
declare i64 @llvm.atomic.cmp.swap.i64.p0i64( i64* <ptr>, i64 <cmp>, i64 <val> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>This loads a value in memory and compares it to a given value. If they are
|
|
equal, it stores a new value into the memory.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.atomic.cmp.swap</tt> intrinsic takes three arguments. The result
|
|
as well as both <tt>cmp</tt> and <tt>val</tt> must be integer values with the
|
|
same bit width. The <tt>ptr</tt> argument must be a pointer to a value of
|
|
this integer type. While any bit width integer may be used, targets may only
|
|
lower representations they support in hardware.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This entire intrinsic must be executed atomically. It first loads the value
|
|
in memory pointed to by <tt>ptr</tt> and compares it with the
|
|
value <tt>cmp</tt>. If they are equal, <tt>val</tt> is stored into the
|
|
memory. The loaded value is yielded in all cases. This provides the
|
|
equivalent of an atomic compare-and-swap operation within the SSA
|
|
framework.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 4, %ptr
|
|
|
|
%val1 = add i32 4, 4
|
|
%result1 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 4, %val1 )
|
|
<i>; yields {i32}:result1 = 4</i>
|
|
%stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i>
|
|
|
|
%val2 = add i32 1, 1
|
|
%result2 = call i32 @llvm.atomic.cmp.swap.i32.p0i32( i32* %ptr, i32 5, %val2 )
|
|
<i>; yields {i32}:result2 = 8</i>
|
|
%stored2 = icmp eq i32 %result2, 5 <i>; yields {i1}:stored2 = false</i>
|
|
|
|
%memval2 = load i32* %ptr <i>; yields {i32}:memval2 = 8</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_swap">'<tt>llvm.atomic.swap.*</tt>' Intrinsic</a>
|
|
</div>
|
|
<div class="doc_text">
|
|
<h5>Syntax:</h5>
|
|
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.atomic.swap</tt> on any
|
|
integer bit width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.swap.i8.p0i8( i8* <ptr>, i8 <val> )
|
|
declare i16 @llvm.atomic.swap.i16.p0i16( i16* <ptr>, i16 <val> )
|
|
declare i32 @llvm.atomic.swap.i32.p0i32( i32* <ptr>, i32 <val> )
|
|
declare i64 @llvm.atomic.swap.i64.p0i64( i64* <ptr>, i64 <val> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>This intrinsic loads the value stored in memory at <tt>ptr</tt> and yields
|
|
the value from memory. It then stores the value in <tt>val</tt> in the memory
|
|
at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.atomic.swap</tt> intrinsic takes two arguments. Both
|
|
the <tt>val</tt> argument and the result must be integers of the same bit
|
|
width. The first argument, <tt>ptr</tt>, must be a pointer to a value of this
|
|
integer type. The targets may only lower integer representations they
|
|
support.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic loads the value pointed to by <tt>ptr</tt>, yields it, and
|
|
stores <tt>val</tt> back into <tt>ptr</tt> atomically. This provides the
|
|
equivalent of an atomic swap operation within the SSA framework.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 4, %ptr
|
|
|
|
%val1 = add i32 4, 4
|
|
%result1 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val1 )
|
|
<i>; yields {i32}:result1 = 4</i>
|
|
%stored1 = icmp eq i32 %result1, 4 <i>; yields {i1}:stored1 = true</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 8</i>
|
|
|
|
%val2 = add i32 1, 1
|
|
%result2 = call i32 @llvm.atomic.swap.i32.p0i32( i32* %ptr, i32 %val2 )
|
|
<i>; yields {i32}:result2 = 8</i>
|
|
|
|
%stored2 = icmp eq i32 %result2, 8 <i>; yields {i1}:stored2 = true</i>
|
|
%memval2 = load i32* %ptr <i>; yields {i32}:memval2 = 2</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_load_add">'<tt>llvm.atomic.load.add.*</tt>' Intrinsic</a>
|
|
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.atomic.load.add</tt> on
|
|
any integer bit width. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.add.i8..p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.add.i16..p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.add.i32..p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.add.i64..p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>This intrinsic adds <tt>delta</tt> to the value stored in memory
|
|
at <tt>ptr</tt>. It yields the original value at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The intrinsic takes two arguments, the first a pointer to an integer value
|
|
and the second an integer value. The result is also an integer value. These
|
|
integer types can have any bit width, but they must all have the same bit
|
|
width. The targets may only lower integer representations they support.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic does a series of operations atomically. It first loads the
|
|
value stored at <tt>ptr</tt>. It then adds <tt>delta</tt>, stores the result
|
|
to <tt>ptr</tt>. It yields the original value stored at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 4, %ptr
|
|
%result1 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 4 )
|
|
<i>; yields {i32}:result1 = 4</i>
|
|
%result2 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 2 )
|
|
<i>; yields {i32}:result2 = 8</i>
|
|
%result3 = call i32 @llvm.atomic.load.add.i32.p0i32( i32* %ptr, i32 5 )
|
|
<i>; yields {i32}:result3 = 10</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 15</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_load_sub">'<tt>llvm.atomic.load.sub.*</tt>' Intrinsic</a>
|
|
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use <tt>llvm.atomic.load.sub</tt> on
|
|
any integer bit width and for different address spaces. Not all targets
|
|
support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.sub.i8.p0i32( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.sub.i16.p0i32( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.sub.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.sub.i64.p0i32( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>This intrinsic subtracts <tt>delta</tt> to the value stored in memory at
|
|
<tt>ptr</tt>. It yields the original value at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The intrinsic takes two arguments, the first a pointer to an integer value
|
|
and the second an integer value. The result is also an integer value. These
|
|
integer types can have any bit width, but they must all have the same bit
|
|
width. The targets may only lower integer representations they support.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic does a series of operations atomically. It first loads the
|
|
value stored at <tt>ptr</tt>. It then subtracts <tt>delta</tt>, stores the
|
|
result to <tt>ptr</tt>. It yields the original value stored
|
|
at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 8, %ptr
|
|
%result1 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 4 )
|
|
<i>; yields {i32}:result1 = 8</i>
|
|
%result2 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 2 )
|
|
<i>; yields {i32}:result2 = 4</i>
|
|
%result3 = call i32 @llvm.atomic.load.sub.i32.p0i32( i32* %ptr, i32 5 )
|
|
<i>; yields {i32}:result3 = 2</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = -3</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_load_and">'<tt>llvm.atomic.load.and.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_nand">'<tt>llvm.atomic.load.nand.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_or">'<tt>llvm.atomic.load.or.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_xor">'<tt>llvm.atomic.load.xor.*</tt>' Intrinsic</a><br>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>These are overloaded intrinsics. You can
|
|
use <tt>llvm.atomic.load_and</tt>, <tt>llvm.atomic.load_nand</tt>,
|
|
<tt>llvm.atomic.load_or</tt>, and <tt>llvm.atomic.load_xor</tt> on any integer
|
|
bit width and for different address spaces. Not all targets support all bit
|
|
widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.and.i8.p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.and.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.and.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.and.i64.p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.or.i8.p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.or.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.or.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.or.i64.p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.nand.i8.p0i32( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.nand.i16.p0i32( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.nand.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.nand.i64.p0i32( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.xor.i8.p0i32( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.xor.i16.p0i32( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.xor.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.xor.i64.p0i32( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>These intrinsics bitwise the operation (and, nand, or, xor) <tt>delta</tt> to
|
|
the value stored in memory at <tt>ptr</tt>. It yields the original value
|
|
at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>These intrinsics take two arguments, the first a pointer to an integer value
|
|
and the second an integer value. The result is also an integer value. These
|
|
integer types can have any bit width, but they must all have the same bit
|
|
width. The targets may only lower integer representations they support.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>These intrinsics does a series of operations atomically. They first load the
|
|
value stored at <tt>ptr</tt>. They then do the bitwise
|
|
operation <tt>delta</tt>, store the result to <tt>ptr</tt>. They yield the
|
|
original value stored at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 0x0F0F, %ptr
|
|
%result0 = call i32 @llvm.atomic.load.nand.i32.p0i32( i32* %ptr, i32 0xFF )
|
|
<i>; yields {i32}:result0 = 0x0F0F</i>
|
|
%result1 = call i32 @llvm.atomic.load.and.i32.p0i32( i32* %ptr, i32 0xFF )
|
|
<i>; yields {i32}:result1 = 0xFFFFFFF0</i>
|
|
%result2 = call i32 @llvm.atomic.load.or.i32.p0i32( i32* %ptr, i32 0F )
|
|
<i>; yields {i32}:result2 = 0xF0</i>
|
|
%result3 = call i32 @llvm.atomic.load.xor.i32.p0i32( i32* %ptr, i32 0F )
|
|
<i>; yields {i32}:result3 = FF</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = F0</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_atomic_load_max">'<tt>llvm.atomic.load.max.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_min">'<tt>llvm.atomic.load.min.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_umax">'<tt>llvm.atomic.load.umax.*</tt>' Intrinsic</a><br>
|
|
<a name="int_atomic_load_umin">'<tt>llvm.atomic.load.umin.*</tt>' Intrinsic</a><br>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>These are overloaded intrinsics. You can use <tt>llvm.atomic.load_max</tt>,
|
|
<tt>llvm.atomic.load_min</tt>, <tt>llvm.atomic.load_umax</tt>, and
|
|
<tt>llvm.atomic.load_umin</tt> on any integer bit width and for different
|
|
address spaces. Not all targets support all bit widths however.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.max.i8.p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.max.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.max.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.max.i64.p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.min.i8.p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.min.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.min.i32..p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.min.i64..p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.umax.i8.p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.umax.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.umax.i32.p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.umax.i64.p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<pre>
|
|
declare i8 @llvm.atomic.load.umin.i8..p0i8( i8* <ptr>, i8 <delta> )
|
|
declare i16 @llvm.atomic.load.umin.i16.p0i16( i16* <ptr>, i16 <delta> )
|
|
declare i32 @llvm.atomic.load.umin.i32..p0i32( i32* <ptr>, i32 <delta> )
|
|
declare i64 @llvm.atomic.load.umin.i64..p0i64( i64* <ptr>, i64 <delta> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>These intrinsics takes the signed or unsigned minimum or maximum of
|
|
<tt>delta</tt> and the value stored in memory at <tt>ptr</tt>. It yields the
|
|
original value at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>These intrinsics take two arguments, the first a pointer to an integer value
|
|
and the second an integer value. The result is also an integer value. These
|
|
integer types can have any bit width, but they must all have the same bit
|
|
width. The targets may only lower integer representations they support.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>These intrinsics does a series of operations atomically. They first load the
|
|
value stored at <tt>ptr</tt>. They then do the signed or unsigned min or
|
|
max <tt>delta</tt> and the value, store the result to <tt>ptr</tt>. They
|
|
yield the original value stored at <tt>ptr</tt>.</p>
|
|
|
|
<h5>Examples:</h5>
|
|
<pre>
|
|
%mallocP = tail call i8* @malloc(i32 ptrtoint (i32* getelementptr (i32* null, i32 1) to i32))
|
|
%ptr = bitcast i8* %mallocP to i32*
|
|
store i32 7, %ptr
|
|
%result0 = call i32 @llvm.atomic.load.min.i32.p0i32( i32* %ptr, i32 -2 )
|
|
<i>; yields {i32}:result0 = 7</i>
|
|
%result1 = call i32 @llvm.atomic.load.max.i32.p0i32( i32* %ptr, i32 8 )
|
|
<i>; yields {i32}:result1 = -2</i>
|
|
%result2 = call i32 @llvm.atomic.load.umin.i32.p0i32( i32* %ptr, i32 10 )
|
|
<i>; yields {i32}:result2 = 8</i>
|
|
%result3 = call i32 @llvm.atomic.load.umax.i32.p0i32( i32* %ptr, i32 30 )
|
|
<i>; yields {i32}:result3 = 8</i>
|
|
%memval1 = load i32* %ptr <i>; yields {i32}:memval1 = 30</i>
|
|
</pre>
|
|
|
|
</div>
|
|
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_memorymarkers">Memory Use Markers</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>This class of intrinsics exists to information about the lifetime of memory
|
|
objects and ranges where variables are immutable.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_lifetime_start">'<tt>llvm.lifetime.start</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.lifetime.start(i64 <size>, i8* nocapture <ptr>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.lifetime.start</tt>' intrinsic specifies the start of a memory
|
|
object's lifetime.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a constant integer representing the size of the
|
|
object, or -1 if it is variable sized. The second argument is a pointer to
|
|
the object.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic indicates that before this point in the code, the value of the
|
|
memory pointed to by <tt>ptr</tt> is dead. This means that it is known to
|
|
never be used and has an undefined value. A load from the pointer that
|
|
precedes this intrinsic can be replaced with
|
|
<tt>'<a href="#undefvalues">undef</a>'</tt>.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_lifetime_end">'<tt>llvm.lifetime.end</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.lifetime.end(i64 <size>, i8* nocapture <ptr>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.lifetime.end</tt>' intrinsic specifies the end of a memory
|
|
object's lifetime.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a constant integer representing the size of the
|
|
object, or -1 if it is variable sized. The second argument is a pointer to
|
|
the object.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic indicates that after this point in the code, the value of the
|
|
memory pointed to by <tt>ptr</tt> is dead. This means that it is known to
|
|
never be used and has an undefined value. Any stores into the memory object
|
|
following this intrinsic may be removed as dead.
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_invariant_start">'<tt>llvm.invariant.start</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare {}* @llvm.invariant.start(i64 <size>, i8* nocapture <ptr>) readonly
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.invariant.start</tt>' intrinsic specifies that the contents of
|
|
a memory object will not change.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a constant integer representing the size of the
|
|
object, or -1 if it is variable sized. The second argument is a pointer to
|
|
the object.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic indicates that until an <tt>llvm.invariant.end</tt> that uses
|
|
the return value, the referenced memory location is constant and
|
|
unchanging.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_invariant_end">'<tt>llvm.invariant.end</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.invariant.end({}* <start>, i64 <size>, i8* nocapture <ptr>)
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.invariant.end</tt>' intrinsic specifies that the contents of
|
|
a memory object are mutable.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is the matching <tt>llvm.invariant.start</tt> intrinsic.
|
|
The second argument is a constant integer representing the size of the
|
|
object, or -1 if it is variable sized and the third argument is a pointer
|
|
to the object.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic indicates that the memory is mutable again.</p>
|
|
|
|
</div>
|
|
|
|
<!-- ======================================================================= -->
|
|
<div class="doc_subsection">
|
|
<a name="int_general">General Intrinsics</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<p>This class of intrinsics is designed to be generic and has no specific
|
|
purpose.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_var_annotation">'<tt>llvm.var.annotation</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.var.annotation(i8* <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.var.annotation</tt>' intrinsic.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is a pointer to a value, the second is a pointer to a
|
|
global string, the third is a pointer to a global string which is the source
|
|
file name, and the last argument is the line number.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic allows annotation of local variables with arbitrary strings.
|
|
This can be useful for special purpose optimizations that want to look for
|
|
these annotations. These have no other defined use, they are ignored by code
|
|
generation and optimization.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_annotation">'<tt>llvm.annotation.*</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<p>This is an overloaded intrinsic. You can use '<tt>llvm.annotation</tt>' on
|
|
any integer bit width.</p>
|
|
|
|
<pre>
|
|
declare i8 @llvm.annotation.i8(i8 <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
declare i16 @llvm.annotation.i16(i16 <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
declare i32 @llvm.annotation.i32(i32 <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
declare i64 @llvm.annotation.i64(i64 <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
declare i256 @llvm.annotation.i256(i256 <val>, i8* <str>, i8* <str>, i32 <int> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.annotation</tt>' intrinsic.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The first argument is an integer value (result of some expression), the
|
|
second is a pointer to a global string, the third is a pointer to a global
|
|
string which is the source file name, and the last argument is the line
|
|
number. It returns the value of the first argument.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic allows annotations to be put on arbitrary expressions with
|
|
arbitrary strings. This can be useful for special purpose optimizations that
|
|
want to look for these annotations. These have no other defined use, they
|
|
are ignored by code generation and optimization.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_trap">'<tt>llvm.trap</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.trap()
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The '<tt>llvm.trap</tt>' intrinsic.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>None.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsics is lowered to the target dependent trap instruction. If the
|
|
target does not have a trap instruction, this intrinsic will be lowered to
|
|
the call of the <tt>abort()</tt> function.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_stackprotector">'<tt>llvm.stackprotector</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare void @llvm.stackprotector( i8* <guard>, i8** <slot> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The <tt>llvm.stackprotector</tt> intrinsic takes the <tt>guard</tt> and
|
|
stores it onto the stack at <tt>slot</tt>. The stack slot is adjusted to
|
|
ensure that it is placed on the stack before local variables.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.stackprotector</tt> intrinsic requires two pointer
|
|
arguments. The first argument is the value loaded from the stack
|
|
guard <tt>@__stack_chk_guard</tt>. The second variable is an <tt>alloca</tt>
|
|
that has enough space to hold the value of the guard.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>This intrinsic causes the prologue/epilogue inserter to force the position of
|
|
the <tt>AllocaInst</tt> stack slot to be before local variables on the
|
|
stack. This is to ensure that if a local variable on the stack is
|
|
overwritten, it will destroy the value of the guard. When the function exits,
|
|
the guard on the stack is checked against the original guard. If they're
|
|
different, then the program aborts by calling the <tt>__stack_chk_fail()</tt>
|
|
function.</p>
|
|
|
|
</div>
|
|
|
|
<!-- _______________________________________________________________________ -->
|
|
<div class="doc_subsubsection">
|
|
<a name="int_objectsize">'<tt>llvm.objectsize</tt>' Intrinsic</a>
|
|
</div>
|
|
|
|
<div class="doc_text">
|
|
|
|
<h5>Syntax:</h5>
|
|
<pre>
|
|
declare i32 @llvm.objectsize.i32( i8* <object>, i1 <type> )
|
|
declare i64 @llvm.objectsize.i64( i8* <object>, i1 <type> )
|
|
</pre>
|
|
|
|
<h5>Overview:</h5>
|
|
<p>The <tt>llvm.objectsize</tt> intrinsic is designed to provide information
|
|
to the optimizers to discover at compile time either a) when an
|
|
operation like memcpy will either overflow a buffer that corresponds to
|
|
an object, or b) to determine that a runtime check for overflow isn't
|
|
necessary. An object in this context means an allocation of a
|
|
specific class, structure, array, or other object.</p>
|
|
|
|
<h5>Arguments:</h5>
|
|
<p>The <tt>llvm.objectsize</tt> intrinsic takes two arguments. The first
|
|
argument is a pointer to or into the <tt>object</tt>. The second argument
|
|
is a boolean 0 or 1. This argument determines whether you want the
|
|
maximum (0) or minimum (1) bytes remaining. This needs to be a literal 0 or
|
|
1, variables are not allowed.</p>
|
|
|
|
<h5>Semantics:</h5>
|
|
<p>The <tt>llvm.objectsize</tt> intrinsic is lowered to either a constant
|
|
representing the size of the object concerned or <tt>i32/i64 -1 or 0</tt>
|
|
(depending on the <tt>type</tt> argument if the size cannot be determined
|
|
at compile time.</p>
|
|
|
|
</div>
|
|
|
|
<!-- *********************************************************************** -->
|
|
<hr>
|
|
<address>
|
|
<a href="http://jigsaw.w3.org/css-validator/check/referer"><img
|
|
src="http://jigsaw.w3.org/css-validator/images/vcss-blue" alt="Valid CSS"></a>
|
|
<a href="http://validator.w3.org/check/referer"><img
|
|
src="http://www.w3.org/Icons/valid-html401-blue" alt="Valid HTML 4.01"></a>
|
|
|
|
<a href="mailto:sabre@nondot.org">Chris Lattner</a><br>
|
|
<a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br>
|
|
Last modified: $Date$
|
|
</address>
|
|
|
|
</body>
|
|
</html>
|