Skip to content
  1. Jun 02, 2021
  2. May 25, 2021
  3. May 18, 2021
  4. May 17, 2021
  5. Apr 29, 2021
    • Craig Topper's avatar
      [RISCV] Teach DAG combine to fold (and (select_cc lhs, rhs, cc, -1, c), x) ->... · dcdda2bd
      Craig Topper authored
      [RISCV] Teach DAG combine to fold (and (select_cc lhs, rhs, cc, -1, c), x) -> (select_cc lhs, rhs, cc, x, (and, x, c))
      
      Similar for or/xor with 0 in place of -1.
      
      This is the canonical form produced by InstCombine for something like `c ? x & y : x;` Since we have to use control flow to expand select we'll usually end up with a mv in basic block. By folding this we may be able to pull the and/or/xor into the block instead and avoid a mv instruction.
      
      The code here is based on code from ARM that uses this to create predicated instructions. I'm doing it on SELECT_CC so it happens late, but we could do it on select earlier which is what ARM does. I'm not sure if we lose any combine opportunities if we do it earlier.
      
      I left out add and sub because this can separate sext.w from the add/sub. It also made a conditional i64 addition/subtraction on RV32 worse. I guess both of those would be fixed by doing this earlier on select.
      
      The select-binop-identity.ll test has not been commited yet, but I made the diff show the changes to it.
      
      Reviewed By: luismarques
      
      Differential Revision: https://reviews.llvm.org/D101485
      dcdda2bd
  6. Mar 23, 2021
  7. Jan 22, 2021
  8. Jan 21, 2021
  9. Jan 14, 2021
  10. Jan 12, 2021
  11. Dec 08, 2020
  12. Nov 27, 2020
  13. Nov 09, 2020
  14. Nov 07, 2020
    • Craig Topper's avatar
      [RISCV] Add test cases showing missed opportunities to use... · b94763d5
      Craig Topper authored
      [RISCV] Add test cases showing missed opportunities to use sbset/sbclr/sbinv/sbext when the shift amount isn't masked to log2(xlen) bits. NFC
      
      Out of bounds shifts are undefined and these instructions mask
      their shift amount before use. So we don't need to see a mask
      in order to select the instructions.
      b94763d5
  15. Jul 15, 2020
Loading