1. Oct 01, 2012
    • Craig Topper's avatar
    • Chandler Carruth's avatar
      Refactor the PartitionUse structure to actually use the Use* instead of · 54e8f0b4
      Chandler Carruth authored
      a pair of instructions, one for the used pointer and the second for the
      user. This simplifies the representation and also makes it more dense.
      
      This was noticed because of the miscompile in PR13926. In that case, we
      were running up against a fundamental "bad idea" in the speculation of
      PHI and select instructions: the speculation and rewriting are
      interleaved, which requires phi speculation to also perform load
      rewriting! This is bad, and causes us to miss opportunities to do (for
      example) vector rewriting only exposed after PHI speculation, etc etc.
      It also, in the old system, required us to insert *new* load uses into
      the current partition's use list, which would then be ignored during
      rewriting because we had already extracted an end iterator for the use
      list. The appending behavior (and much of the other oddities) stem from
      the strange de-duplication strategy in the PartitionUse builder.
      Amusingly, all this went without notice for so long because it could
      only be triggered by having *different* GEPs into the same partition of
      the same alloca, where both different GEPs were operands of a single
      PHI, and where the GEP which was not encountered first also had multiple
      uses within that same PHI node... Hence the insane steps required to
      reproduce.
      
      So, step one in fixing this fundamental bad idea is to make the
      PartitionUse actually contain a Use*, and to make the builder do proper
      deduplication instead of funky de-duplication. This is enough to remove
      the appending behavior, and fix the miscompile in PR13926, but there is
      more work to be done here. Subsequent commits will lift the speculation
      into its own visitor. It'll be a useful step toward potentially
      extracting all of the speculation logic into a generic utility
      transform.
      
      The existing PHI test case for repeated operands has been made more
      extreme to catch even these issues. This test case, run through the old
      pass, will exactly reproduce the miscompile from PR13926. ;] We were so
      close here!
      
      llvm-svn: 164925
      54e8f0b4
    • Jakub Staszak's avatar
      Use dyn_cast instead of isa and cast. · ec5a2f24
      Jakub Staszak authored
      No functionality change.
      
      llvm-svn: 164924
      ec5a2f24
    • Benjamin Kramer's avatar
      SimplifyCFG: Enumerating all predecessors of a BB can be expensive (switches),... · f064b65a
      Benjamin Kramer authored
      SimplifyCFG: Enumerating all predecessors of a BB can be expensive (switches), avoid it if possible.
      
      No functionality change.
      
      llvm-svn: 164923
      f064b65a
    • Dmitri Gribenko's avatar
      RST docs: convert HTML escapes to plain text in code examples. · 37f92c74
      Dmitri Gribenko authored
      llvm-svn: 164922
      37f92c74
    • Dmitri Gribenko's avatar
      Sphinx CSS: remove negative letter-spacing, it makes some fonts look really · 0fd5ce06
      Dmitri Gribenko authored
      bad.  Fonts already have appropriate tracking built-in.
      
      llvm-svn: 164921
      0fd5ce06
    • Jakub Staszak's avatar
      Fix && to && in Coding Standards. · 2e747e35
      Jakub Staszak authored
      llvm-svn: 164920
      2e747e35
    • Craig Topper's avatar
      Change getX86SubSuperRegister to take an MVT::SimpleValueType rather than an... · 4f1c8caf
      Craig Topper authored
      Change getX86SubSuperRegister to take an MVT::SimpleValueType rather than an EVT and add llvm_unreachable to the switches. Helps it compile to dramatically better code.
      
      llvm-svn: 164919
      4f1c8caf
    • Benjamin Kramer's avatar
      ArgumentPromotion: Remove ancient workaround for a bug in the C backend. · 84036251
      Benjamin Kramer authored
      Fun fact: The CBE learned how to deal with this situation before it was removed.
      
      llvm-svn: 164918
      84036251
  2. Sep 30, 2012
  3. Sep 29, 2012
    • Daniel Jasper's avatar
      Fix refersToDeclaration()-matcher and add missing test case. This was · 0c30337f
      Daniel Jasper authored
      broken as of r164656 as TemplateArgument::getAsDecl() now asserts
      instead of returning NULL for other template arugment kinds.
      
      llvm-svn: 164896
      0c30337f
    • Dmitri Gribenko's avatar
      Move the 'find macro by spelling' infrastructure to the Preprocessor class and · 6743e046
      Dmitri Gribenko authored
      use it to suggest appropriate macro for __attribute__((deprecated)) in
      -Wdocumentation-deprecated-sync.
      
      llvm-svn: 164892
      6743e046
    • Chandler Carruth's avatar
      Fix a somewhat surprising miscompile where code relying on an ABI · 903790ef
      Chandler Carruth authored
      alignment could lose it due to the alloca type moving down to a much
      smaller alignment guarantee.
      
      Now SROA will actively compute a proper alignment, factoring the target
      data, any explicit alignment, and the offset within the struct. This
      will in some cases lower the alignment requirements, but when we lower
      them below those of the type, we drop the alignment entirely to give
      freedom to the code generator to align it however is convenient.
      
      Thanks to Duncan for the lovely test case that pinned this down. =]
      
      llvm-svn: 164891
      903790ef
    • Duncan Sands's avatar
      Speculatively revert commit 164885 (nadav) in the hope of ressurecting a pile of · fb9d30dd
      Duncan Sands authored
      buildbots.  Original commit message:
      
      A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
      because moden processos can store multiple values in parallel, and preparing the consecutive store requires
      some work.  We only handle these cases:
      
      1. Consecutive stores where the values and consecutive loads. For example:
        int a = p->a;
        int b = p->b;
        q->a = a;
        q->b = b;
      
      2. Consecutive stores where the values are constants. Foe example:
        q->a = 4;
        q->b = 5;
      
      llvm-svn: 164890
      fb9d30dd
    • Dmitri Gribenko's avatar
      Comment XML schema: correct indentation. · 261c9683
      Dmitri Gribenko authored
      llvm-svn: 164889
      261c9683
    • Jason Molenda's avatar
      Add the RelocateOrLoadKernel and LoadKernel methods to ProcessGDBRemote::DoRemoteConnect(). · d1fae144
      Jason Molenda authored
      When attaching to a remote system that does not look like a typical vendor system, and no
      executable binary was specified to lldb, check a couple of fixed locations where kernels
      running in ASLR mode (slid in memory to a random address) store their load addr when booted
      in debug mode, and relocate the symbols or load the kernel wholesale from the host computer
      if we can find it.  
      
      <rdar://problem/7714201>
      
      llvm-svn: 164888
      d1fae144
    • Craig Topper's avatar
      Tidy up to match coding standards. Remove 'else' after 'return' and moving... · 5f9791fd
      Craig Topper authored
      Tidy up to match coding standards. Remove 'else' after 'return' and moving operators to end of preceding line. No functional change intended.
      
      llvm-svn: 164887
      5f9791fd
    • Craig Topper's avatar
      Replace a couple if/elses around similar calls with conditional operators on... · 65161fa4
      Craig Topper authored
      Replace a couple if/elses around similar calls with conditional operators on the varying arguments. No functional change.
      
      llvm-svn: 164886
      65161fa4
    • Nadav Rotem's avatar
      · a2e7ea2f
      Nadav Rotem authored
      A DAGCombine optimization for merging consecutive stores. This optimization is not profitable in many cases
      because moden processos can store multiple values in parallel, and preparing the consecutive store requires
      some work.  We only handle these cases:
      
      1. Consecutive stores where the values and consecutive loads. For example:
        int a = p->a;
        int b = p->b;
        q->a = a;
        q->b = b;
      
      2. Consecutive stores where the values are constants. Foe example:
        q->a = 4;
        q->b = 5;
      
      llvm-svn: 164885
      a2e7ea2f
    • Jason Molenda's avatar
      Add support for debugging KASLR kernels via kdp (the kernel being · 4bd4e7e3
      Jason Molenda authored
      loaded at a random offset).
      
      To get the kernel's UUID and load address I need to send a kdp
      packet so I had to implement the kernel relocation (and attempt to
      find the kernel if none was provided to lldb already) in ProcessKDP
      -- but this code really properly belongs in DynamicLoaderDarwinKernel.
      
      I also had to add an optional Stream to ConnectRemote so
      ProcessKDP::DoConnectRemote can print feedback about the remote kernel's
      UUID, load address, and notify the user if we auto-loaded the kernel via
      the UUID.
      
      <rdar://problem/7714201>
      
      llvm-svn: 164881
      4bd4e7e3
    • Craig Topper's avatar
    • NAKAMURA Takumi's avatar
      060cfdc8
    • Sean Callanan's avatar
      Now in the presence of an Objective-C version 2 · eb918cd7
      Sean Callanan authored
      runtime, we read method signatures for both class
      and instance methods out of the runtime data.
      
      (lldb) fr var str
      (NSString *) str = 0x0000000105000180 @"Hello from '/Volumes/Data/projects/lldb/test/lang/objc/foundation/a.out'"
      (lldb) expr str.length
      (unsigned long long) $0 = 72
      (lldb) expr [NSString stringWithCString:"Hello world!" encoding:1]
      (id) $1 = 0x0000000105100050
      (lldb) po $1
      $1 = 0x0000000105100050 Hello world!
      
      (lldb) fr var array1
      (NSArray *) array1 = 0x000000010010a6e0 @"3 objects"
      (lldb) expr array1.count
      (unsigned long long) $0 = 3
      (lldb) expr [array1 objectAtIndex:2]
      (id) $1 = 0x00000001000025d0
      (lldb) po $1
      $1 = 0x00000001000025d0 array1 object3
      
      Notice that both regular and property-style notation
      work.  I still need to add explicit support for
      properties with non-default setters/getters.
      
      This information is only queried if an Objective-C
      object does not have debug information for a complete
      type available.  Otherwise we query debug information
      as usual.
      
      llvm-svn: 164878
      eb918cd7