-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[llvm-exegesis] [AArch64] Resolving "not all operands are initialized by snippet generator" #142529
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
base: main
Are you sure you want to change the base?
Changes from all commits
b1919dd
af68e0f
5697760
75c2e65
9d425dc
9a1feb2
f567870
66fdd39
59452e5
1726bea
c26aa00
f43b8e2
c26beda
ef67b17
aea8861
0f09343
5a56401
cd435fb
9ae23af
b0b4a5d
555ddf7
aa60946
6b593fe
ab92f0f
dbbed99
bda8043
2d7fc2f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
# REQUIRES: aarch64-registered-target | ||
|
||
|
||
|
||
// Test for omitting OperandType::OPERAND_UNKNOWN | ||
|
||
// ADDXri: ADD Xd, Xn, #imm{, shift} | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=latency --benchmark-phase=prepare-and-assemble-snippet --opcode-name=ADDXri 2>&1 | FileCheck %s --check-prefix=ADDXri_latency | ||
# ADDXri_latency-NOT: Not all operands were initialized by the snippet generator for ADDXri opcode | ||
# ADDXri_latency: --- | ||
# ADDXri_latency-NEXT: mode: latency | ||
# ADDXri_latency-NEXT: key: | ||
# ADDXri_latency-NEXT: instructions: | ||
# ADDXri_latency-NEXT: ADDXri [[REG1:X[0-9]+|LR]] [[REG2:X[0-9]+|LR]] i_0x0 i_0x0 | ||
# ADDXri_latency: ... | ||
|
||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=inverse_throughput --benchmark-phase=prepare-and-assemble-snippet --opcode-name=ADDXri 2>&1 | FileCheck %s --check-prefix=ADDXri_throughput | ||
# ADDXri_throughput-NOT: Not all operands were initialized by the snippet generator for ADDXri opcode | ||
# ADDXri_throughput: --- | ||
# ADDXri_throughput-NEXT: mode: inverse_throughput | ||
# ADDXri_throughput-NEXT: key: | ||
# ADDXri_throughput-NEXT: instructions: | ||
# ADDXri_throughput-NEXT: ADDXri [[REG1:X[0-9]+|LR]] [[REG2:X[0-9]+|LR]] i_0x0 i_0x0 | ||
# ADDXri_throughput: ... | ||
|
||
|
||
|
||
// Test for omitting OperandType::OPERAND_MSL_SHIFT_4S | ||
|
||
// MOVIv2s_msl: MOVI vd, #imm{, shift} | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=latency --benchmark-phase=prepare-and-assemble-snippet --opcode-name=MOVIv4s_msl 2>&1 | FileCheck %s --check-prefix=MOVIv4s_msl_latency | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=inverse_throughput --benchmark-phase=prepare-and-assemble-snippet --opcode-name=MOVIv4s_msl 2>&1 | FileCheck %s --check-prefix=MOVIv4s_msl_throughput | ||
# MOVIv4s_msl_latency-NOT: Not all operands were initialized by the snippet generator for MOVIv4s_msl opcode | ||
|
||
// TODO: Add test to check if the immediate value is correct when serial execution strategy is added for MOVIv4s_msl | ||
|
||
|
||
# MOVIv4s_msl_throughput-NOT: Not all operands were initialized by the snippet generator for MOVIv4s_msl opcode | ||
# MOVIv4s_msl_throughput: --- | ||
# MOVIv4s_msl_throughput-NEXT: mode: inverse_throughput | ||
# MOVIv4s_msl_throughput-NEXT: key: | ||
# MOVIv4s_msl_throughput-NEXT: instructions: | ||
# MOVIv4s_msl_throughput-NEXT: MOVIv4s_msl [[REG1:Q[0-9]+|LR]] i_0x1 i_0x108 | ||
# MOVIv4s_msl_throughput: ... | ||
|
||
|
||
|
||
// Test for omitting OperandType::OPERAND_MSL_SHIFT_2S | ||
|
||
// MOVIv2s_msl: MOVI vd, #imm{, shift} | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=latency --benchmark-phase=prepare-and-assemble-snippet --opcode-name=MOVIv2s_msl 2>&1 | FileCheck %s --check-prefix=MOVIv2s_msl_latency | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=inverse_throughput --benchmark-phase=prepare-and-assemble-snippet --opcode-name=MOVIv2s_msl 2>&1 | FileCheck %s --check-prefix=MOVIv2s_msl_throughput | ||
# MOVIv2s_msl_latency-NOT: Not all operands were initialized by the snippet generator for MOVIv2s_msl opcode | ||
|
||
// TODO: Add test to check if the immediate value is correct when serial execution strategy is added for MOVIv2s_msl | ||
|
||
|
||
# MOVIv2s_msl_throughput-NOT: Not all operands were initialized by the snippet generator for MOVIv2s_msl opcode | ||
# MOVIv2s_msl_throughput: --- | ||
# MOVIv2s_msl_throughput-NEXT: mode: inverse_throughput | ||
# MOVIv2s_msl_throughput-NEXT: key: | ||
# MOVIv2s_msl_throughput-NEXT: instructions: | ||
# MOVIv2s_msl_throughput-NEXT: MOVIv2s_msl [[REG1:D[0-9]+|LR]] i_0x1 i_0x108 | ||
# MOVIv2s_msl_throughput: ... | ||
|
||
|
||
|
||
// Test for omitting OperandType::OPERAND_PCREL | ||
// LDRDl: LDRD ldr1, ldr2, [pc, #imm] | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=latency --benchmark-phase=prepare-and-assemble-snippet --opcode-name=LDRDl 2>&1 | FileCheck %s --check-prefix=LDRDl_latency | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=inverse_throughput --benchmark-phase=prepare-and-assemble-snippet --opcode-name=LDRDl 2>&1 | FileCheck %s --check-prefix=LDRDl_throughput | ||
|
||
# LDRDl_latency-NOT: Not all operands were initialized by the snippet generator for LDRDl opcodes | ||
# LDRDl_throughput-NOT: Not all operands were initialized by the snippet generator for LDRDl opcodes | ||
|
||
# LDRDl_throughput: --- | ||
# LDRDl_throughput-NEXT: mode: inverse_throughput | ||
# LDRDl_throughput-NEXT: key: | ||
# LDRDl_throughput-NEXT: instructions: | ||
# LDRDl_throughput-NEXT: LDRDl [[REG1:D[0-9]+|LR]] i_0x0 | ||
# LDRDl_throughput: ... | ||
|
||
|
||
|
||
// Test for omitting OperandType::OPERAND_FIRST_TARGET | ||
|
||
// UMOVvi16_idx0: UMOV wd, vn.h[index] | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=latency --benchmark-phase=prepare-and-assemble-snippet --opcode-name=UMOVvi16_idx0 2>&1 | FileCheck %s --check-prefix=UMOVvi16_idx0_latency | ||
# RUN: llvm-exegesis --mtriple=aarch64 --mcpu=neoverse-v2 --mode=inverse_throughput --benchmark-phase=prepare-and-assemble-snippet --opcode-name=UMOVvi16_idx0 2>&1 | FileCheck %s --check-prefix=UMOVvi16_idx0_throughput | ||
|
||
# UMOVvi16_idx0_latency-NOT: Not all operands were initialized by the snippet generator for UMOVvi16_idx0 opcode | ||
# UMOVvi16_idx0_latency: --- | ||
# UMOVvi16_idx0_latency-NEXT: mode: latency | ||
# UMOVvi16_idx0_latency-NEXT: key: | ||
# UMOVvi16_idx0_latency-NEXT: instructions: | ||
# UMOVvi16_idx0_latency-NEXT: UMOVvi16_idx0 [[REG1:W[0-9]+|LR]] [[REG2:Q[0-9]+|LR]] i_0x0 | ||
# UMOVvi16_idx0_latency: ... | ||
|
||
# UMOVvi16_idx0_throughput-NOT: Not all operands were initialized by the snippet generator for UMOVvi16_idx0 opcode | ||
# UMOVvi16_idx0_throughput: --- | ||
# UMOVvi16_idx0_throughput-NEXT: mode: inverse_throughput | ||
# UMOVvi16_idx0_throughput-NEXT: key: | ||
# UMOVvi16_idx0_throughput-NEXT: instructions: | ||
# UMOVvi16_idx0_throughput-NEXT: UMOVvi16_idx0 [[REG1:W[0-9]+|LR]] [[REG2:Q[0-9]+|LR]] i_0x0 | ||
# UMOVvi16_idx0_throughput: ... |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -276,6 +276,12 @@ static Error randomizeMCOperand(const LLVMState &State, | |
AssignedValue = MCOperand::createReg(randomBit(AllowedRegs)); | ||
break; | ||
} | ||
/// Omit unknown and pc-relative operands to imm value based on the | ||
/// instruction | ||
case MCOI::OperandType::OPERAND_UNKNOWN: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be removed too I think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is helps us to get measurement values for 1000+ opcode. We have sanity checked this by comparing the measurements values reported by exegesis and (latency and inverse-throughput) for them. And there are few opcodes for which omitting immediate with value 0 is incorrect, They are documented in code and this PR (like |
||
case MCOI::OperandType::OPERAND_PCREL: | ||
return State.getExegesisTarget().randomizeTargetMCOperand( | ||
Instr, Var, AssignedValue, ForbiddenRegs); | ||
default: | ||
break; | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.