Skip to content
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

[llvm-exegesis][RISCV] computeAliasingInstructions in SerialSnipperGenerate generates instructions that can't be assembled #122974

Closed
topperc opened this issue Jan 14, 2025 · 4 comments · Fixed by #122986

Comments

@topperc
Copy link
Collaborator

topperc commented Jan 14, 2025

I tried to run through all RISC-V opcodes available on my SiFive P550 system using -opcode-index=-1. I got some crashes trying to assemble pseudo instructions.

Should llvm-exegesis be filtering pseudos and custom insertion instructions in this function?

CC: @boomanaiden154 @mshockwave

@llvmbot
Copy link
Member

llvmbot commented Jan 14, 2025

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

Author: Craig Topper (topperc)

I tried to run through all RISC-V opcodes available on my SiFive P550 system using -opcode-index=-1. I got some crashes trying to assemble pseudo instructions.

Should llvm-exegesis be filtering pseudos and custom insertion instructions in this function?

CC: @boomanaiden154 @mshockwave

@llvmbot
Copy link
Member

llvmbot commented Jan 14, 2025

@llvm/issue-subscribers-tools-llvm-exegesis

Author: Craig Topper (topperc)

I tried to run through all RISC-V opcodes available on my SiFive P550 system using -opcode-index=-1. I got some crashes trying to assemble pseudo instructions.

Should llvm-exegesis be filtering pseudos and custom insertion instructions in this function?

CC: @boomanaiden154 @mshockwave

@boomanaiden154
Copy link
Contributor

Probably. llvm/tools/llvm-exegesis/lib/X86/Target.cpp excludes a bunch of opcodes for various reasons, mostly a lack of support for benchmarking with memory I think. Given benchmarking pseudo instructions is probably not super meaningful, just excluding them probably makes the most sense.

@topperc
Copy link
Collaborator Author

topperc commented Jan 14, 2025

Probably. llvm/tools/llvm-exegesis/lib/X86/Target.cpp excludes a bunch of opcodes for various reasons, mostly a lack of support for benchmarking with memory I think. Given benchmarking pseudo instructions is probably not super meaningful, just excluding them probably makes the most sense.

Is that this code and the isInvalidOpcode function?

  bool allowAsBackToBack(const Instruction &Instr) const override {              
    const unsigned Opcode = Instr.Description.Opcode;                            
    return !isInvalidOpcode(Instr) && Opcode != X86::LEA64r &&                   
           Opcode != X86::LEA64_32r && Opcode != X86::LEA16r;                    
  }

topperc added a commit that referenced this issue Jan 15, 2025
…ck. (#122986)

Prevents crashes trying to encode pseudo instuctions. Tested on HiFive
Premier P550.

Fixes #122974
paulhuggett pushed a commit to paulhuggett/llvm-project that referenced this issue Jan 16, 2025
…ck. (llvm#122986)

Prevents crashes trying to encode pseudo instuctions. Tested on HiFive
Premier P550.

Fixes llvm#122974
DKLoehr pushed a commit to DKLoehr/llvm-project that referenced this issue Jan 17, 2025
…ck. (llvm#122986)

Prevents crashes trying to encode pseudo instuctions. Tested on HiFive
Premier P550.

Fixes llvm#122974
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants