Skip to content
  1. Jul 15, 2011
  2. Jun 03, 2011
  3. May 22, 2011
    • Frits van Bommel's avatar
      Add a parameter to ConstantFoldTerminator() that callers can use to ask it to... · ad964559
      Frits van Bommel authored
      Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.
      
      I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.
      
      llvm-svn: 131855
      ad964559
  4. Apr 27, 2011
  5. Mar 30, 2011
  6. Oct 19, 2010
    • Owen Anderson's avatar
      Get rid of static constructors for pass registration. Instead, every pass... · 6c18d1aa
      Owen Anderson authored
      Get rid of static constructors for pass registration.  Instead, every pass exposes an initializeMyPassFunction(), which
      must be called in the pass's constructor.  This function uses static dependency declarations to recursively initialize
      the pass's dependencies.
      
      Clients that only create passes through the createFooPass() APIs will require no changes.  Clients that want to use the
      CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
      before parsing commandline arguments.
      
      I have tested this with all standard configurations of clang and llvm-gcc on Darwin.  It is possible that there are problems
      with the static dependencies that will only be visible with non-standard options.  If you encounter any crash in pass
      registration/creation, please send the testcase to me directly.
      
      llvm-svn: 116820
      6c18d1aa
  7. Oct 08, 2010
  8. Aug 14, 2010
    • Dan Gohman's avatar
      Teach SimplifyCFG how to simplify indirectbr instructions. · 4a63fad9
      Dan Gohman authored
       - Eliminate redundant successors.
       - Convert an indirectbr with one successor into a direct branch.
      
      Also, generalize SimplifyCFG to be able to be run on a function entry block.
      It knows quite a few simplifications which are applicable to the entry
      block, and it only needs a few checks to avoid trouble with the entry block.
      
      llvm-svn: 111060
      4a63fad9
  9. Aug 06, 2010
  10. Jul 22, 2010
  11. Jun 13, 2010
  12. 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
  13. 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
  14. Mar 22, 2010
  15. Mar 19, 2010
  16. Mar 15, 2010
  17. Mar 14, 2010
  18. 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
  19. Jan 05, 2010
  20. Dec 22, 2009
  21. Nov 23, 2009
  22. Nov 01, 2009
  23. Sep 03, 2009
  24. Sep 02, 2009
  25. Aug 30, 2009
  26. Aug 13, 2009
  27. Jul 31, 2009
  28. Jul 22, 2009
  29. Jul 14, 2009
  30. Jul 07, 2009
  31. Jul 03, 2009
  32. Jun 12, 2009
  33. 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
Loading