Skip to content

[RISCV] Remove unnecessary NoHasStdExtZicfiss Predicate from cmop.1 and cmop.5. NFC #88822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Apr 16, 2024

I'm not sure what this was supposed do. Maybe it was for the disassembler, but that should be managed through DecoderNamespace.

So let's remove it and simplify the code.

…nd cmop.5. NFC

I'm not sure what this was supposed do. Its on the instruction and
not a pattern so could only affect assembly and not codegen.
NoHasStdExtZicfiss doesn't have an AssemblerPredicate associated with
it so it doesn't affect the assembler either.

Remove it and simplify the code.
@llvmbot
Copy link
Member

llvmbot commented Apr 16, 2024

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

Changes

I'm not sure what this was supposed do. Maybe it was for the disassembler, but that should be managed through DecoderNamespace.

So let's remove it and simplify the code.


Full diff: https://github.com/llvm/llvm-project/pull/88822.diff

1 Files Affected:

  • (modified) llvm/lib/Target/RISCV/RISCVInstrInfoZcmop.td (+1-7)
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZcmop.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZcmop.td
index dd13a07d606d04..65091aad91003d 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZcmop.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZcmop.td
@@ -20,13 +20,7 @@ class CMOPInst<bits<3> imm3, string opcodestr>
   let Inst{12-11} = 0;
 }
 
-// CMOP1, CMOP5 is used by Zicfiss.
-let Predicates = [HasStdExtZcmop, NoHasStdExtZicfiss] in {
-  def CMOP1 : CMOPInst<0, "cmop.1">, Sched<[]>;
-  def CMOP5 : CMOPInst<2, "cmop.5">, Sched<[]>;
-}
-
-foreach n = [3, 7, 9, 11, 13, 15] in {
+foreach n = [1, 3, 5, 7, 9, 11, 13, 15] in {
   let Predicates = [HasStdExtZcmop] in
   def CMOP # n : CMOPInst<!srl(n, 1), "cmop." # n>, Sched<[]>;
 }

Copy link
Contributor

@wangpc-pp wangpc-pp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@topperc topperc merged commit 4e2d11f into llvm:main Apr 16, 2024
@topperc topperc deleted the pr/cmop-cfiss branch April 16, 2024 04:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants