summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86InstrBuilder.h
Commit message (Collapse)AuthorAgeFilesLines
* [X86] Fix latent bugs in 32-bit CMPXCHG8B inserterReid Kleckner2019-09-111-3/+3
| | | | | | | | | | | | | | | I found three issues: 1. the loop over E[ABCD]X copies run over BB start 2. the direct address of cmpxchg8b could be a frame index 3. the displacement of cmpxchg8b could be a global instead of an immediate These were all introduced together in r287875, and should be fixed with this change. Issue reported by Zachary Turner. llvm-svn: 371678
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [CodeGen] Rename MachineInstrBuilder::addOperand. NFCDiana Picus2017-01-131-1/+1
| | | | | | | | | | | Rename from addOperand to just add, to match the other method that has been added to MachineInstrBuilder for adding more than just 1 operand. See https://reviews.llvm.org/D28057 for the whole discussion. Differential Revision: https://reviews.llvm.org/D28556 llvm-svn: 291891
* [X86] Do not assume "ri" instructions always have an immediate operandMichael Kuperstein2016-12-071-0/+5
| | | | | | | | | | | The second operand of an "ri" instruction may be an immediate, but it may also be a globalvariable, so we should make any assumptions. This fixes PR31271. Differential Revision: https://reviews.llvm.org/D27481 llvm-svn: 288964
* [x86] Fixing PR28755 by precomputing the address used in CMPXCHG8BNikolai Bozhenov2016-11-241-0/+11
| | | | | | | | | | | | | | | | | | The bug arises during register allocation on i686 for CMPXCHG8B instruction when base pointer is needed. CMPXCHG8B needs 4 implicit registers (EAX, EBX, ECX, EDX) and a memory address, plus ESI is reserved as the base pointer. With such constraints the only way register allocator would do its job successfully is when the addressing mode of the instruction requires only one register. If that is not the case - we are emitting additional LEA instruction to compute the address. It fixes PR28755. Patch by Alexander Ivchenko <alexander.ivchenko@intel.com> Differential Revision: https://reviews.llvm.org/D25088 llvm-svn: 287875
* [x86] Rewrite getAddressFromInstr helper functionNikolai Bozhenov2016-11-241-17/+18
| | | | | | | | | | | | | - It does not modify the input instruction - Second operand of any address is always an Index Register, make sure we actually check for that, instead of a check for an immediate value Patch by Alexander Ivchenko <alexander.ivchenko@intel.com> Differential Revision: https://reviews.llvm.org/D24938 llvm-svn: 287873
* [LLVM] Fix some Clang-tidy modernize-use-using and Include What You Use warningsEugene Zelenko2016-08-181-8/+13
| | | | | | Differential revision: https://reviews.llvm.org/D23675 llvm-svn: 279102
* MachineFunction: Return reference for getFrameInfo(); NFCMatthias Braun2016-07-281-1/+1
| | | | | | | getFrameInfo() never returns nullptr so we should use a reference instead of a pointer. llvm-svn: 277017
* [CodeGen] Take a MachineMemOperand::Flags in ↵Justin Lebar2016-07-151-1/+1
| | | | | | | | | | | | | | | | | MachineFunction::getMachineMemOperand. Summary: Previously we took an unsigned. Hooray for type-safety. Reviewers: chandlerc Subscribers: dsanders, llvm-commits Differential Revision: http://reviews.llvm.org/D22282 llvm-svn: 275591
* [x86] Extract a helper function to compute the full addressing mode fromChandler Carruth2016-03-301-0/+28
| | | | | | | | | an x86 MachineInstr's operands. This will be super useful to fix some bad atomics code in my next commit. No functionality changed. llvm-svn: 264819
* PseudoSourceValue: Replace global manager with a manager in a machine function.Alex Lorenz2015-08-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | This commit removes the global manager variable which is responsible for storing and allocating pseudo source values and instead it introduces a new manager class named 'PseudoSourceValueManager'. Machine functions now own an instance of the pseudo source value manager class. This commit also modifies the 'get...' methods in the 'MachinePointerInfo' class to construct pseudo source values using the instance of the pseudo source value manager object from the machine function. This commit updates calls to the 'get...' methods from the 'MachinePointerInfo' class in a lot of different files because those calls now need to pass in a reference to a machine function to those methods. This change will make it easier to serialize pseudo source values as it will enable me to transform the mips specific MipsCallEntry PseudoSourceValue subclass into two target independent subclasses. Reviewers: Akira Hatanaka llvm-svn: 244693
* Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC)Alexander Kornienko2015-06-231-1/+1
| | | | | | Apparently, the style needs to be agreed upon first. llvm-svn: 240390
* Fixed/added namespace ending comments using clang-tidy. NFCAlexander Kornienko2015-06-191-1/+1
| | | | | | | | | | | | | The patch is generated using this command: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \ -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \ llvm/lib/ Thanks to Eugene Kosov for the original patch! llvm-svn: 240137
* Canonicalize header guards into a common format.Benjamin Kramer2014-08-131-2/+2
| | | | | | | | | | Add header guards to files that were missing guards. Remove #endif comments as they don't seem common in LLVM (we can easily add them back if we decide they're useful) Changes made by clang-tidy with minor tweaks. llvm-svn: 215558
* [C++] Use 'nullptr'.Craig Topper2014-04-281-1/+2
| | | | llvm-svn: 207394
* Whitespace.Chad Rosier2012-06-221-8/+8
| | | | llvm-svn: 159035
* Remove some unnecessary includes of PseudoSourceValue.h.Jay Foad2011-11-151-1/+0
| | | | llvm-svn: 144631
* - Rename TargetInstrDesc, TargetOperandInfo to MCInstrDesc and MCOperandInfo andEvan Cheng2011-06-281-3/+3
| | | | | | | | sink them into MC layer. - Added MCInstrInfo, which captures the tablegen generated static data. Chang TargetInstrInfo so it's based off MCInstrInfo. llvm-svn: 134021
* it's more elegant to put the "getConstantPool" andChris Lattner2010-09-211-2/+1
| | | | | | | | "getFixedStack" on the MachinePointerInfo class. While this isn't the problem I'm setting out to solve, it is the right way to eliminate PseudoSourceValue, so lets go with it. llvm-svn: 114406
* convert targets to the new MF.getMachineMemOperand interface.Chris Lattner2010-09-211-3/+3
| | | | llvm-svn: 114391
* implement rdar://6653118 - fastisel should fold loads where possible.Chris Lattner2010-09-051-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since mem2reg isn't run at -O0, we get a ton of reloads from the stack, for example, before, this code: int foo(int x, int y, int z) { return x+y+z; } used to compile into: _foo: ## @foo subq $12, %rsp movl %edi, 8(%rsp) movl %esi, 4(%rsp) movl %edx, (%rsp) movl 8(%rsp), %edx movl 4(%rsp), %esi addl %edx, %esi movl (%rsp), %edx addl %esi, %edx movl %edx, %eax addq $12, %rsp ret Now we produce: _foo: ## @foo subq $12, %rsp movl %edi, 8(%rsp) movl %esi, 4(%rsp) movl %edx, (%rsp) movl 8(%rsp), %edx addl 4(%rsp), %edx ## Folded load addl (%rsp), %edx ## Folded load movl %edx, %eax addq $12, %rsp ret Fewer instructions and less register use = faster compiles. llvm-svn: 113102
* Change LEA to have 5 operands for its memory operand, justChris Lattner2010-07-081-26/+13
| | | | | | | | | | | like all other instructions, even though a segment is not allowed. This resolves a bunch of gross hacks in the encoder and makes LEA more consistent with the rest of the instruction set. No functionality change. llvm-svn: 107934
* Add const qualifiers to CodeGen's use of LLVM IR constructs.Dan Gohman2010-04-151-1/+1
| | | | llvm-svn: 101334
* -Revert parts of 84326 and 84411. Distinquishing between fixed and non-fixedEvan Cheng2009-10-181-4/+1
| | | | | | | | | | | stack slots and giving them different PseudoSourceValue's did not fix the problem of post-alloc scheduling miscompiling llvm itself. - Apply Dan's conservative workaround by assuming any non fixed stack slots can alias other memory locations. This means a load from spill slot #1 cannot move above a store of spill slot #2. - Enable post-alloc scheduling for x86 at optimization leverl Default and above. llvm-svn: 84424
* Distinquish stack slots from other stack objects. They (and fixed objects) ↵Evan Cheng2009-10-171-1/+4
| | | | | | get FixedStack PseudoSourceValues. llvm-svn: 84326
* Revert 84315 for now. Re-thinking the patch.Evan Cheng2009-10-171-1/+1
| | | | llvm-svn: 84321
* Rename getFixedStack to getStackObject. The stack objects represented are notEvan Cheng2009-10-171-1/+1
| | | | | | necessarily fixed. Only those will negative frame indices are "fixed." llvm-svn: 84315
* Improve MachineMemOperand handling.Dan Gohman2009-09-251-5/+6
| | | | | | | | | | | | | | | | | | | | | - Allocate MachineMemOperands and MachineMemOperand lists in MachineFunctions. This eliminates MachineInstr's std::list member and allows the data to be created by isel and live for the remainder of codegen, avoiding a lot of copying and unnecessary translation. This also shrinks MemSDNode. - Delete MemOperandSDNode. Introduce MachineSDNode which has dedicated fields for MachineMemOperands. - Change MemSDNode to have a MachineMemOperand member instead of its own fields with the same information. This introduces some redundancy, but it's more consistent with what MachineInstr will eventually want. - Ignore alignment when searching for redundant loads for CSE, but remember the greatest alignment. Target-specific code which previously used MemOperandSDNodes with generic SDNodes now use MemIntrinsicSDNodes, with opcodes in a designated range so that the SelectionDAG framework knows that MachineMemOperand information is available. llvm-svn: 82794
* Fix the offset values for these memoperands. For frame objects, theDan Gohman2009-09-211-1/+1
| | | | | | | PseudoSourceValue already effectively represents the offset from the frame base, so the actual offset should not be added to it. llvm-svn: 82465
* fix PR4984 by ensuring that fastisel adds properly sign extended GEP ↵Chris Lattner2009-09-151-1/+1
| | | | | | | | displacement values to machineinstrs. llvm-svn: 81886
* Do not put bunch of target-specific stuff into common namespaceAnton Korobeynikov2009-07-161-19/+20
| | | | llvm-svn: 75971
* Fix some fast-isel problems selecting global variable addressing inChris Lattner2009-07-011-2/+4
| | | | | | pic mode. llvm-svn: 74582
* Fix PR4466 by making fastisel set operand flags correctly.Chris Lattner2009-06-271-2/+2
| | | | llvm-svn: 74366
* Change MachineInstrBuilder::addReg() to take a flag instead of a list ofBill Wendling2009-05-131-4/+4
| | | | | | | | | | | | booleans. This gives a better indication of what the "addReg()" is doing. Remembering what all of those booleans mean isn't easy, especially if you aren't spending all of your time in that code. I took Jakob's suggestion and made it illegal to pass in "true" for the flag. This should hopefully prevent any unintended misuse of this (by reverting to the old way of using addReg()). llvm-svn: 71722
* Re-apply 68552.Rafael Espindola2009-04-081-6/+27
| | | | | | Tested by bootstrapping llvm-gcc and using that to build llvm. llvm-svn: 68645
* Temporarily revert r68552. This was causing a failure in the self-hosting LLVMBill Wendling2009-04-071-24/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | builds. --- Reverse-merging (from foreign repository) r68552 into '.': U test/CodeGen/X86/tls8.ll U test/CodeGen/X86/tls10.ll U test/CodeGen/X86/tls2.ll U test/CodeGen/X86/tls6.ll U lib/Target/X86/X86Instr64bit.td U lib/Target/X86/X86InstrSSE.td U lib/Target/X86/X86InstrInfo.td U lib/Target/X86/X86RegisterInfo.cpp U lib/Target/X86/X86ISelLowering.cpp U lib/Target/X86/X86CodeEmitter.cpp U lib/Target/X86/X86FastISel.cpp U lib/Target/X86/X86InstrInfo.h U lib/Target/X86/X86ISelDAGToDAG.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp U lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.h U lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.h U lib/Target/X86/X86ISelLowering.h U lib/Target/X86/X86InstrInfo.cpp U lib/Target/X86/X86InstrBuilder.h U lib/Target/X86/X86RegisterInfo.td llvm-svn: 68560
* Reduce code duplication on the TLS implementation.Rafael Espindola2009-04-071-5/+24
| | | | | | | | | | This introduces a small regression on the generated code quality in the case we are just computing addresses, not loading values. Will work on it and on X86-64 support. llvm-svn: 68552
* Extend X86's addFrameReference to add a MachineMemOperand forDan Gohman2008-12-031-1/+18
| | | | | | | the frame reference. This will help post-RA scheduling determine that spills to distinct stack slots are independent. llvm-svn: 60486
* Fix X86FastISel's output for x86-32 PIC constant pool addresses.Dan Gohman2008-09-301-5/+7
| | | | llvm-svn: 56829
* Fix constant pool loads, and remove broken versions of addConstantPoolReference.Owen Anderson2008-09-061-3/+1
| | | | llvm-svn: 55868
* Fix the X86 addConstantPoolReference, which had the operands in the wrong order.Owen Anderson2008-09-061-1/+2
| | | | llvm-svn: 55867
* - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, ↵Evan Cheng2008-07-031-4/+8
| | | | | | | | propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc. - Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list. llvm-svn: 53097
* Remove attribution from file headers, per discussion on llvmdev.Chris Lattner2007-12-291-2/+2
| | | | llvm-svn: 45418
* Patches to make the LLVM sources more -pedantic clean. Patch providedChris Lattner2006-05-241-1/+1
| | | | | | by Anton Korobeynikov! This is a step towards closing PR786. llvm-svn: 28447
* Remove and simplify some more machineinstr/machineoperand stuff.Chris Lattner2006-05-041-6/+6
| | | | llvm-svn: 28105
* There shalt be only one "immediate" operand type!Chris Lattner2006-05-041-6/+6
| | | | llvm-svn: 28099
* Remove a bunch more SparcV9 specific stuffChris Lattner2006-05-041-1/+1
| | | | llvm-svn: 28093
* * Remove trailing whitespaceMisha Brukman2005-04-211-5/+5
| | | | | | * Convert tabs to spaces llvm-svn: 21426
* Fix indentation.Chris Lattner2005-01-171-19/+18
| | | | llvm-svn: 19649
* Add a new method.Chris Lattner2005-01-021-1/+10
| | | | llvm-svn: 19249
OpenPOWER on IntegriCloud