[llvm] [RISCV] Add ORC_B to SimplifyDemandedBitsForTargetNode. (PR #141975)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 09:32:36 PDT 2025


================
@@ -20728,19 +20729,24 @@ bool RISCVTargetLowering::SimplifyDemandedBitsForTargetNode(
   unsigned BitWidth = OriginalDemandedBits.getBitWidth();
 
   switch (Op.getOpcode()) {
-  case RISCVISD::BREV8: {
+  case RISCVISD::BREV8:
+  case RISCVISD::ORC_B: {
     KnownBits Known2;
+    bool IsGORC = Op.getOpcode() == RISCVISD::ORC_B;
+    // For BREV8, we need to do BREV8 on the demanded bits.
+    // For ORC_B, any bit in the output demandeds all bits from the same byte.
+    // So we need to do ORC_B on the demanded ibts.
----------------
lenary wrote:

```suggestion
    // So we need to do ORC_B on the demanded bits.
```


https://github.com/llvm/llvm-project/pull/141975


More information about the llvm-commits mailing list