1. Aug 01, 2018
  2. Jul 31, 2018
    • Jakub Kuderski's avatar
      [Dominators] Make slow walks shorter · 3ae770aa
      Jakub Kuderski authored
      Summary:
      When DFS numbers are not yet calculated for a dominator tree, we have to walk it up to say whether one node dominates some other.
      
      This patch makes the slow walks shorter by only walking until the level of the node we check against is reached. This is because a node cannot possibly dominate something higher in its tree.
      
      When running opt with -O3, the patch results in:
      * 25% fewer loop iterations for `opt` (fullLTO)
      * 30% fewer loop iterations for sqlite
      
      Reviewers: brzycki, asbirlea, chandlerc, NutshellySima, grosser
      
      Reviewed By: NutshellySima
      
      Subscribers: mehdi_amini, dexonsmith, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49955
      
      llvm-svn: 338396
      3ae770aa
    • Ewan Crawford's avatar
      Fix InstCombine address space assert · d83beb80
      Ewan Crawford authored
      Workaround bug where the InstCombine pass was asserting on the IR added in lit
      test, where we have a bitcast instruction after a GEP from an addrspace cast.
      
      The second bitcast in the test was getting combined into
      `bitcast <16 x i32>* %0 to <16 x i32> addrspace(3)*`, which looks like it should
      be an addrspace cast instruction instead. Otherwise if control flow is allowed
      to continue as it is now we create a GEP instruction
      `<badref> = getelementptr inbounds <16 x i32>, <16 x i32>* %0, i32 0`. However
      because the type of this instruction doesn't match the address space we hit an
      assert when replacing the bitcast with that GEP.
      
      ```
      void llvm::Value::doRAUW(llvm::Value*, bool): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
      ```
      
      Differential Revision: https://reviews.llvm.org/D50058
      
      llvm-svn: 338395
      d83beb80