- Jun 02, 2021
-
-
Ben Shi authored
These tests will show how (and r i) will be optimized to (BCLRI (BCLRI r, i0), i1) or (BCLRI (ANDI r, i0), i1) by future commits. Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D103359
-
- May 25, 2021
-
-
Ben Shi authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D102893
-
- May 18, 2021
-
-
Ben Shi authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D102625
-
- May 17, 2021
-
-
Ben Shi authored
Reviewed By: craig.topper Differential Revision: https://reviews.llvm.org/D102398
-
Ben Shi authored
Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D102396
-
- Apr 29, 2021
-
-
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
-
- Mar 23, 2021
-
-
Craig Topper authored
As discussed in D99009
-
- Jan 22, 2021
-
-
Craig Topper authored
Also renamed Zbe instructions to resolve name conflict even though that change is in the 0.94 draft. Reviewed By: asb, frasercrmck Differential Revision: https://reviews.llvm.org/D94653
-
- Jan 21, 2021
-
-
Michael Munday authored
This recommits 71ed4b6c with the polarity of some of the pattern corrected. Original commit message: The custom expansion of select operations in the RISC-V backend interferes with the matching of cmov instructions. Legalizing select when the Zbt extension is available solves that problem. Reviewed By: luismarques, craig.topper Differential Revision: https://reviews.llvm.org/D93767
-
- Jan 14, 2021
-
-
Sam Elliott authored
We found issues with this patch in additional testing. Backing out while we work on a fix. This reverts commit 71ed4b6c.
-
- Jan 12, 2021
-
-
Michael Munday authored
The custom expansion of select operations in the RISC-V backend interferes with the matching of cmov instructions. Legalizing select when the Zbt extension is available solves that problem. Reviewed By: lenary, craig.topper Differential Revision: https://reviews.llvm.org/D93767
-
- Dec 08, 2020
-
-
Craig Topper authored
We can use these instructions for single bit immediates that are too large for ANDI/ORI/CLRI. The _10 test cases are to make sure that we still use ANDI/ORI/CLRI for small immediates. Differential Revision: https://reviews.llvm.org/D92262
-
- Nov 27, 2020
-
-
Craig Topper authored
-
- Nov 09, 2020
-
-
Craig Topper authored
This uses the shiftop PatFrags to handle the masked shift amount and unmasked shift amount cases. That also checks XLen as part of the masked amount check so we don't need separate RV32 and RV64 patterns. Differential Revision: https://reviews.llvm.org/D91016
-
- Nov 07, 2020
-
-
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.
-
- Jul 15, 2020
-
-
lewis-revill authored
This patch provides optimization of bit manipulation operations by enabling the +experimental-b target feature. It adds matching of single block patterns of instructions to specific bit-manip instructions from the single-bit subset (zbs subextension) of the experimental B extension of RISC-V. It adds also the correspondent codegen tests. This patch is based on Claire Wolf's proposal for the bit manipulation extension of RISCV: https://github.com/riscv/riscv-bitmanip/blob/master/bitmanip-0.92.pdf Differential Revision: https://reviews.llvm.org/D79874
-