Skip to content
  1. Jan 28, 2008
  2. Jan 27, 2008
  3. Jan 26, 2008
    • Bill Wendling's avatar
      If there are no machine instructions emitted for a function, then insert · 50794839
      Bill Wendling authored
      a "nop" instruction so that we don't have the function's label associated
      with something that it's not supposed to be associated with.
      
      llvm-svn: 46394
      50794839
    • Bill Wendling's avatar
      If we have a function like this: · 0862e342
      Bill Wendling authored
      void bork() {
        int *address = 0;
        *address = 0;
      }
      
      It's compiled into LLVM code that looks like this:
      
      define void @bork() noreturn nounwind  {
      entry:
              unreachable
      }
      
      This is bad on some platforms (like PPC) because it will generate the label for
      the function but no body. The label could end up being associated with some
      non-code related stuff, like a section. This places a "trap" instruction if the
      SimplifyCFG pass removed all code from the function leaving only one
      "unreachable" instruction.
      
      llvm-svn: 46387
      0862e342
  4. Jan 25, 2008
  5. Jan 22, 2008
  6. Jan 20, 2008
  7. Jan 14, 2008
  8. Jan 13, 2008
  9. Jan 08, 2008
  10. Jan 07, 2008
    • Duncan Sands's avatar
      Small cleanup for handling of type/parameter attribute · b18c30ac
      Duncan Sands authored
      incompatibility.
      
      llvm-svn: 45704
      b18c30ac
    • Gordon Henriksen's avatar
      Deleting an empty file. Thanks, /usr/bin/patch! · efb08802
      Gordon Henriksen authored
      llvm-svn: 45675
      efb08802
    • Gordon Henriksen's avatar
      With this patch, the LowerGC transformation becomes the · 6047b6e1
      Gordon Henriksen authored
      ShadowStackCollector, which additionally has reduced overhead with
      no sacrifice in portability.
      
      Considering a function @fun with 8 loop-local roots,
      ShadowStackCollector introduces the following overhead
      (x86):
      
      ; shadowstack prologue
              movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
              movl    (%eax), %ecx
              movl    $___gc_fun, 20(%esp)
              movl    $0, 24(%esp)
              movl    $0, 28(%esp)
              movl    $0, 32(%esp)
              movl    $0, 36(%esp)
              movl    $0, 40(%esp)
              movl    $0, 44(%esp)
              movl    $0, 48(%esp)
              movl    $0, 52(%esp)
              movl    %ecx, 16(%esp)
              leal    16(%esp), %ecx
              movl    %ecx, (%eax)
      
      ; shadowstack loop overhead
              (none)
      
      ; shadowstack epilogue
              movl    48(%esp), %edx
              movl    %edx, (%ecx)
      
      ; shadowstack metadata
              .align  3
      ___gc_fun:                              # __gc_fun
              .long   8
              .space  4
      
      In comparison to LowerGC:
      
      ; lowergc prologue
              movl    L_llvm_gc_root_chain$non_lazy_ptr, %eax
              movl    (%eax), %ecx
              movl    %ecx, 48(%esp)
              movl    $8, 52(%esp)
              movl    $0, 60(%esp)
              movl    $0, 56(%esp)
              movl    $0, 68(%esp)
              movl    $0, 64(%esp)
              movl    $0, 76(%esp)
              movl    $0, 72(%esp)
              movl    $0, 84(%esp)
              movl    $0, 80(%esp)
              movl    $0, 92(%esp)
              movl    $0, 88(%esp)
              movl    $0, 100(%esp)
              movl    $0, 96(%esp)
              movl    $0, 108(%esp)
              movl    $0, 104(%esp)
              movl    $0, 116(%esp)
              movl    $0, 112(%esp)
      
      ; lowergc loop overhead
              leal    44(%esp), %eax
              movl    %eax, 56(%esp)
              leal    40(%esp), %eax
              movl    %eax, 64(%esp)
              leal    36(%esp), %eax
              movl    %eax, 72(%esp)
              leal    32(%esp), %eax
              movl    %eax, 80(%esp)
              leal    28(%esp), %eax
              movl    %eax, 88(%esp)
              leal    24(%esp), %eax
              movl    %eax, 96(%esp)
              leal    20(%esp), %eax
              movl    %eax, 104(%esp)
              leal    16(%esp), %eax
              movl    %eax, 112(%esp)
      
      ; lowergc epilogue
              movl    48(%esp), %edx
              movl    %edx, (%ecx)
      
      ; lowergc metadata
              (none)
      
      llvm-svn: 45670
      6047b6e1
  11. Jan 06, 2008
    • Duncan Sands's avatar
      The transform that tries to turn calls to bitcast functions into · 404eb052
      Duncan Sands authored
      direct calls bails out unless caller and callee have essentially
      equivalent parameter attributes.  This is illogical - the callee's
      attributes should be of no relevance here.  Rework the logic, which
      incidentally fixes a crash when removed arguments have attributes.
      
      llvm-svn: 45658
      404eb052
    • Duncan Sands's avatar
      When transforming a call to a bitcast function into · 55e5090f
      Duncan Sands authored
      a direct call with cast parameters and cast return
      value (if any), instcombine was prepared to cast any
      non-void return value into any other, whether castable
      or not.  Add a new predicate for testing whether casting
      is valid, and check it both for the return value and
      (as a cleanup) for the parameters.
      
      llvm-svn: 45657
      55e5090f
  12. Jan 05, 2008
  13. Jan 04, 2008
  14. Dec 29, 2007
  15. Dec 28, 2007
    • Owen Anderson's avatar
      Repair a transform that Chris noticed a bug in. Thanks to Nicholas for... · 7363914e
      Owen Anderson authored
      Repair a transform that Chris noticed a bug in.  Thanks to Nicholas for pointing out my stupid mistakes when writing this patch. :-)
      
      llvm-svn: 45384
      7363914e
    • Chris Lattner's avatar
      disable this instcombine xform, it miscompiles: · 5179819b
      Chris Lattner authored
      define i32 @main() {
      entry:
      	%z = alloca i32		; <i32*> [#uses=2]
      	store i32 0, i32* %z
      	%tmp = load i32* %z		; <i32> [#uses=1]
      	%sub = sub i32 %tmp, 1		; <i32> [#uses=1]
      	%cmp = icmp ult i32 %sub, 0		; <i1> [#uses=1]
      	%retval = select i1 %cmp, i32 1, i32 0		; <i32> [#uses=1]
      	ret i32 %retval
      }
      
      into ret 1, instead of ret 0.
      
      Christopher, please investigate.
      
      llvm-svn: 45383
      5179819b
  16. Dec 25, 2007
  17. Dec 24, 2007
  18. Dec 22, 2007
  19. Dec 20, 2007
  20. Dec 19, 2007
Loading