Skip to content
  1. Jun 13, 2010
  2. May 09, 2010
    • Chris Lattner's avatar
      make simplifycfg insert an llvm.trap before the 'unreachable' it introduces · 84d46186
      Chris Lattner authored
      when it detects undefined behavior.  llvm.trap generally codegens into some
      thing really small (e.g. a 2 byte ud2 instruction on x86) and debugging this
      sort of thing is "nontrivial".  For example, we now compile:
      
      void foo() { *(int*)0 = 42; }
      
      into:
      
      _foo:
      	pushl	%ebp
      	movl	%esp, %ebp
      	ud2
      
      Some may even claim that this is a security hole, though that seems dubious
      to me.  This addresses rdar://7958343 - Optimizing away null dereference 
      potentially allows arbitrary code execution
      
      llvm-svn: 103356
      84d46186
  3. Mar 24, 2010
    • Gabor Greif's avatar
      Finally land the InvokeInst operand reordering. · a2fbc0ae
      Gabor Greif authored
      I have audited all getOperandNo calls now, fixing
      hidden assumptions. CallSite related uglyness will
      be eliminated successively.
      
      Note this patch has a long and griveous history,
      for all the back-and-forths have a look at
      CallSite.h's log.
      
      llvm-svn: 99399
      a2fbc0ae
  4. Mar 22, 2010
  5. Mar 19, 2010
  6. Mar 15, 2010
  7. Mar 14, 2010
  8. Feb 05, 2010
    • Jakob Stoklund Olesen's avatar
      Teach SimplifyCFG about magic pointer constants. · 916f48a0
      Jakob Stoklund Olesen authored
      Weird code sometimes uses pointer constants other than null. This patch
      teaches SimplifyCFG to build switch instructions in those cases.
      
      Code like this:
      
      void f(const char *x) {
        if (!x)
          puts("null");
        else if ((uintptr_t)x == 1)
          puts("one");
        else if (x == (char*)2 || x == (char*)3)
          puts("two");
        else if ((intptr_t)x == 4)
          puts("four");
        else
          puts(x);
      }
      
      Now becomes a switch:
      
      define void @f(i8* %x) nounwind ssp {
      entry:
        %magicptr23 = ptrtoint i8* %x to i64            ; <i64> [#uses=1]
        switch i64 %magicptr23, label %if.else16 [
          i64 0, label %if.then
          i64 1, label %if.then2
          i64 2, label %if.then9
          i64 3, label %if.then9
          i64 4, label %if.then14
        ]
      
      Note that LLVM's own DenseMap uses magic pointers.
      
      llvm-svn: 95439
      916f48a0
  9. Jan 05, 2010
  10. Dec 22, 2009
  11. Nov 23, 2009
  12. Nov 01, 2009
  13. Sep 03, 2009
  14. Sep 02, 2009
  15. Aug 30, 2009
  16. Aug 13, 2009
  17. Jul 31, 2009
  18. Jul 22, 2009
  19. Jul 14, 2009
  20. Jul 07, 2009
  21. Jul 03, 2009
  22. Jun 12, 2009
  23. Mar 13, 2009
    • Bill Wendling's avatar
      Revert r66920. It was causing failures in the self-hosting buildbot (in release · 4bb96e9a
      Bill Wendling authored
      mode).
      
      Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      6   bugpoint          0x00000004 start + 18446744073709543220
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes 
      
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      6   bugpoint          0x00000006 start + 18446744073709543222
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 
      
      FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
      Failed with signal(SIGBUS) at line 1
      while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll  -bugpoint-crashcalls -silence-passes
      0   bugpoint          0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
      1   bugpoint          0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
      2   libSystem.B.dylib 0x92f112bb _sigtramp + 43
      3   libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
      4   bugpoint          0x00021d1c main + 92
      5   bugpoint          0x00002106 start + 54
      Stack dump:
      0.    Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 
      
      --- Reverse-merging (from foreign repository) r66920 into '.':
      U    include/llvm/Support/CallSite.h
      U    include/llvm/Instructions.h
      U    lib/Analysis/IPA/GlobalsModRef.cpp
      U    lib/Analysis/IPA/Andersens.cpp
      U    lib/Bitcode/Writer/BitcodeWriter.cpp
      U    lib/VMCore/Instructions.cpp
      U    lib/VMCore/Verifier.cpp
      U    lib/VMCore/AsmWriter.cpp
      U    lib/Transforms/Utils/LowerInvoke.cpp
      U    lib/Transforms/Scalar/SimplifyCFGPass.cpp
      U    lib/Transforms/IPO/PruneEH.cpp
      U    lib/Transforms/IPO/DeadArgumentElimination.cpp
      
      llvm-svn: 66953
      4bb96e9a
    • Gabor Greif's avatar
      Second installment of "BasicBlock operands to the back" · 258232fb
      Gabor Greif authored
      changes.
      
      For InvokeInst now all arguments begin at op_begin().
      The Callee, Cont and Fail are now faster to get by
      access relative to op_end().
      
      This patch introduces some temporary uglyness in CallSite.
      Next I'll bring CallInst up to a similar scheme and then
      the uglyness will magically vanish.
      
      This patch also exposes all the reliance of the libraries
      on InvokeInst's operand ordering. I am thinking of taking
      care of that too.
      
      llvm-svn: 66920
      258232fb
  24. Sep 25, 2008
    • Devang Patel's avatar
      Large mechanical patch. · 4c758ea3
      Devang Patel authored
      s/ParamAttr/Attribute/g
      s/PAList/AttrList/g
      s/FnAttributeWithIndex/AttributeWithIndex/g
      s/FnAttr/Attribute/g
      
      This sets the stage 
      - to implement function notes as function attributes and 
      - to distinguish between function attributes and return value attributes.
      
      This requires corresponding changes in llvm-gcc and clang.
      
      llvm-svn: 56622
      4c758ea3
  25. Sep 24, 2008
  26. Sep 09, 2008
  27. Sep 04, 2008
  28. May 14, 2008
  29. May 13, 2008
  30. Apr 06, 2008
  31. Feb 14, 2008
  32. 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
  33. Dec 29, 2007
  34. Dec 18, 2007
Loading