Skip to content
  1. Jun 30, 2009
    • Evan Cheng's avatar
      Add a bit IsUndef to MachineOperand. This indicates the def / use register... · 0dc101b8
      Evan Cheng authored
      Add a bit IsUndef to MachineOperand. This indicates the def / use register operand is defined by an implicit_def. That means it can def / use any register and passes (e.g. register scavenger) can feel free to ignore them.
      
      The register allocator, when it allocates a register to a virtual register defined by an implicit_def, can allocate any physical register without worrying about overlapping live ranges. It should mark all of operands of the said virtual register so later passes will do the right thing.
      
      This is not the best solution. But it should be a lot less fragile to having the scavenger try to track what is defined by implicit_def.
      
      llvm-svn: 74518
      0dc101b8
  2. Jun 27, 2009
    • Chris Lattner's avatar
      factor some logic out into a helper function, allow remat of loads from constant · 9876bd82
      Chris Lattner authored
      globals.  This implements remat-constant.ll even without aggressive-remat.
      
      llvm-svn: 74373
      9876bd82
    • Chris Lattner's avatar
      Reimplement rip-relative addressing in the X86-64 backend. The new · fea81da4
      Chris Lattner authored
      implementation primarily differs from the former in that the asmprinter
      doesn't make a zillion decisions about whether or not something will be
      RIP relative or not.  Instead, those decisions are made by isel lowering
      and propagated through to the asm printer.  To achieve this, we:
      
      1. Represent RIP relative addresses by setting the base of the X86 addr
         mode to X86::RIP.
      2. When ISel Lowering decides that it is safe to use RIP, it lowers to
         X86ISD::WrapperRIP.  When it is unsafe to use RIP, it lowers to
         X86ISD::Wrapper as before.
      3. This removes isRIPRel from X86ISelAddressMode, representing it with
         a basereg of RIP instead.
      4. The addressing mode matching logic in isel is greatly simplified.
      5. The asmprinter is greatly simplified, notably the "NotRIPRel" predicate
         passed through various printoperand routines is gone now.
      6. The various symbol printing routines in asmprinter now no longer infer
         when to emit (%rip), they just print the symbol.
      
      I think this is a big improvement over the previous situation.  It does have
      two small caveats though: 1. I implemented a horrible "no-rip" modifier for
      the inline asm "P" constraint modifier.  This is a short term hack, there is
      a much better, but more involved, solution.  2. I had to xfail an 
      -aggressive-remat testcase because it isn't handling the use of RIP in the
      constant-pool reading instruction.  This specific test is easy to fix without
      -aggressive-remat, which I intend to do next.
      
      llvm-svn: 74372
      fea81da4
  3. Jun 25, 2009
  4. Jun 04, 2009
  5. May 29, 2009
    • Bill Wendling's avatar
      The MONITOR and MWAIT instructions have insufficient information for · 2e09bd3d
      Bill Wendling authored
      decoding. Essentially, they both map to the same column in the "opcode
      extensions for one- and two-byte opcodes" table in the x86 manual. The RawFrm
      complicates decoding this.
      
      Instead, use opcode 0x01, prefix 0x01, and form MRM1r. Then have the code
      emitter special case these, a la [SML]FENCE.
      
      llvm-svn: 72556
      2e09bd3d
  6. May 13, 2009
    • Bill Wendling's avatar
      Change MachineInstrBuilder::addReg() to take a flag instead of a list of · f7b83c7a
      Bill Wendling authored
      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
      f7b83c7a
  7. May 12, 2009
  8. May 08, 2009
    • Evan Cheng's avatar
      Optimize code placement in loop to eliminate unconditional branches or move... · 2fa28110
      Evan Cheng authored
      Optimize code placement in loop to eliminate unconditional branches or move unconditional branch to the outside of the loop. e.g.
      
      ///       A:                                                                                                                                                                 
      ///       ...                                                                                                                                                                
      ///       <fallthrough to B>                                                                                                                                                 
      ///                                                                                                                                                                          
      ///       B:  --> loop header                                                                                                                                                
      ///       ...                                                                                                                                                                
      ///       jcc <cond> C, [exit]                                                                                                                                               
      ///                                                                                                                                                                          
      ///       C:                                                                                                                                                                 
      ///       ...                                                                                                                                                                
      ///       jmp B                                                                                                                                                              
      ///                                                                                                                                                                          
      /// ==>                                                                                                                                                                      
      ///                                                                                                                                                                          
      ///       A:                                                                                                                                                                 
      ///       ...                                                                                                                                                                
      ///       jmp B                                                                                                                                                              
      ///                                                                                                                                                                          
      ///       C:  --> new loop header                                                                                                                                            
      ///       ...                                                                                                                                                                
      ///       <fallthough to B>                                                                                                                                                  
      ///                                                                                                                                                                          
      ///       B:                                                                                                                                                                 
      ///       ...                                                                                                                                                                
      ///       jcc <cond> C, [exit] 
      
      llvm-svn: 71209
      2fa28110
  9. May 05, 2009
  10. Apr 27, 2009
  11. Apr 21, 2009
  12. Apr 18, 2009
  13. Apr 17, 2009
  14. Apr 15, 2009
  15. Apr 13, 2009
    • Dan Gohman's avatar
      Implement x86 h-register extract support. · 57d6bd36
      Dan Gohman authored
       - Add patterns for h-register extract, which avoids a shift and mask,
         and in some cases a temporary register.
       - Add address-mode matching for turning (X>>(8-n))&(255<<n), where
         n is a valid address-mode scale value, into an h-register extract
         and a scaled-offset address.
       - Replace X86's MOV32to32_ and related instructions with the new
         target-independent COPY_TO_SUBREG instruction.
      
      On x86-64 there are complicated constraints on h registers, and
      CodeGen doesn't currently provide a high-level way to express all of them,
      so they are handled with a bunch of special code. This code currently only
      supports extracts where the result is used by a zero-extend or a store,
      though these are fairly common.
      
      These transformations are not always beneficial; since there are only
      4 h registers, they sometimes require extra move instructions, and
      this sometimes increases register pressure because it can force out
      values that would otherwise be in one of those registers. However,
      this appears to be relatively uncommon.
      
      llvm-svn: 68962
      57d6bd36
    • Dan Gohman's avatar
      Fix another hard-coded constant to use X86AddrNumOperands. · 39aa13a4
      Dan Gohman authored
      This unbreaks the JIT on x86-64.
      
      llvm-svn: 68948
      39aa13a4
  16. Apr 09, 2009
  17. Apr 08, 2009
    • Rafael Espindola's avatar
      Re-apply 68552. · 3b2df10c
      Rafael Espindola authored
      Tested by bootstrapping llvm-gcc and using that to build llvm.
      
      llvm-svn: 68645
      3b2df10c
    • Bill Wendling's avatar
      Temporarily revert r68552. This was causing a failure in the self-hosting LLVM · 4aa25b79
      Bill Wendling authored
      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
      4aa25b79
  18. Apr 07, 2009
  19. Mar 28, 2009
  20. Mar 27, 2009
  21. Mar 13, 2009
    • Evan Cheng's avatar
      Fix some significant problems with constant pools that resulted in unnecessary... · 1fb8aedd
      Evan Cheng authored
      Fix some significant problems with constant pools that resulted in unnecessary paddings between constant pool entries, larger than necessary alignments (e.g. 8 byte alignment for .literal4 sections), and potentially other issues.
      
      1. ConstantPoolSDNode alignment field is log2 value of the alignment requirement. This is not consistent with other SDNode variants.
      2. MachineConstantPool alignment field is also a log2 value.
      3. However, some places are creating ConstantPoolSDNode with alignment value rather than log2 values. This creates entries with artificially large alignments, e.g. 256 for SSE vector values.
      4. Constant pool entry offsets are computed when they are created. However, asm printer group them by sections. That means the offsets are no longer valid. However, asm printer uses them to determine size of padding between entries.
      5. Asm printer uses expensive data structure multimap to track constant pool entries by sections.
      6. Asm printer iterate over SmallPtrSet when it's emitting constant pool entries. This is non-deterministic.
      
      
      Solutions:
      1. ConstantPoolSDNode alignment field is changed to keep non-log2 value.
      2. MachineConstantPool alignment field is also changed to keep non-log2 value.
      3. Functions that create ConstantPool nodes are passing in non-log2 alignments.
      4. MachineConstantPoolEntry no longer keeps an offset field. It's replaced with an alignment field. Offsets are not computed when constant pool entries are created. They are computed on the fly in asm printer and JIT.
      5. Asm printer uses cheaper data structure to group constant pool entries.
      6. Asm printer compute entry offsets after grouping is done.
      7. Change JIT code to compute entry offsets on the fly.
      
      llvm-svn: 66875
      1fb8aedd
  22. Mar 04, 2009
  23. Feb 22, 2009
  24. Feb 18, 2009
  25. Feb 13, 2009
  26. Feb 11, 2009
Loading