aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target
diff options
context:
space:
mode:
authorLakshay Kumar <lakshayk@nvidia.com>2025-09-03 18:32:30 +0530
committerGitHub <noreply@github.com>2025-09-03 14:02:30 +0100
commitee71af4fc7e62981da3d73a917ef1919e6d4c2d8 (patch)
tree1d2a3b5692d414521694bb02b2a3f1f97a811a61 /llvm/lib/Target
parent71641049a91253f7547f792ec2fcb6609794ea4f (diff)
downloadllvm-ee71af4fc7e62981da3d73a917ef1919e6d4c2d8.zip
llvm-ee71af4fc7e62981da3d73a917ef1919e6d4c2d8.tar.gz
llvm-ee71af4fc7e62981da3d73a917ef1919e6d4c2d8.tar.bz2
[llvm-exegesis] [AArch64] Reland Resolving "not all operands are initialized by snippet generator" (#156423)
### Reland #142529 (Resolving "not all operands are initialized by snippet generator") Introduced changes in implementation of `randomizeTargetMCOperand()` for AArch64 that omitting `OPERAND_SHIFT_MSL`, `OPERAND_PCREL` to an immediate value of 264 and 8 respectively. PS: Omitting `MCOI::OPERAND_FIRST_TARGET/llvm:AArch64:OPERAND_IMPLICIT_IMM_0` similarly, to value 0. It was low hanging change thus added in this PR only. For any future operand type of AArch64 if not initialised will exit with error "`Unimplemented operand type: MCOI::OperandType:<#Number>`". #### [Reland Updates] Updated `tools/llvm-exegesis/AArch64/error-resolution.s` which caused problem. Test case was failing when there is uninitialised operands error coming from secondary/consumer instruction used by exegesis in latency mode required to chain up the assembly to ensure serial execution. i.e. We get error message like `UMOVvi16_idx0: Not all operands were initialized by the snippet generator for <<<any opcode other than UMOVvi16_idx0>>> opcode.` but test case want to check like `# UMOVvi16_idx0_latency: ---`. Thus the testcase fails. ```+ /llvm-project/build/bin/FileCheck /llvm-project/llvm/test/tools/llvm-exegesis/AArch64/error-resolution.s --check-prefix=UMOVvi16_idx0_latency /llvm-project/llvm/test/tools/llvm-exegesis/AArch64/error-resolution.s:65:26: error: UMOVvi16_idx0_latency: expected string not found in input # UMOVvi16_idx0_latency: --- ^ <stdin>:1:1: note: scanning from here UMOVvi16_idx0: Not all operands were initialized by the snippet generator for LD1W_D_IMM opcode. ^ Input file: <stdin> Check file: /llvm-project/llvm/test/tools/llvm-exegesis/AArch64/error-resolution.s -dump-input=help explains the following input dump. Input was: <<<<<< 1: UMOVvi16_idx0: Not all operands were initialized by the snippet generator for LD1W_D_IMM opcode. check:65 X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found >>>>>> -- ******************** ******************** Failed Tests (1): LLVM :: tools/llvm-exegesis/AArch64/error-resolution.s ``` #### [Why it fails (only sometimes)] Exegesis in latency mode require the generated assembly to be chained to ensure serial execution, For this exegesis add an additional consumer instruction for some instruction, which is chosen via a random seed. Thus, it randomly fails whenever there is secondary consumer instruction (which is unsupported/throws error) added in generated assembly.
Diffstat (limited to 'llvm/lib/Target')
-rw-r--r--llvm/lib/Target/AArch64/AArch64InstrFormats.td2
-rw-r--r--llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h5
2 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/Target/AArch64/AArch64InstrFormats.td b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
index feff590..8958ad1 100644
--- a/llvm/lib/Target/AArch64/AArch64InstrFormats.td
+++ b/llvm/lib/Target/AArch64/AArch64InstrFormats.td
@@ -1327,6 +1327,8 @@ def move_vec_shift : Operand<i32> {
let PrintMethod = "printShifter";
let EncoderMethod = "getMoveVecShifterOpValue";
let ParserMatchClass = MoveVecShifterOperand;
+ let OperandType = "OPERAND_SHIFT_MSL";
+ let OperandNamespace = "AArch64";
}
let DiagnosticType = "AddSubSecondSource" in {
diff --git a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h
index 91bdc88..7774d07 100644
--- a/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h
+++ b/llvm/lib/Target/AArch64/MCTargetDesc/AArch64MCTargetDesc.h
@@ -65,15 +65,16 @@ void initLLVMToCVRegMapping(MCRegisterInfo *MRI);
bool isHForm(const MCInst &MI, const MCInstrInfo *MCII);
bool isQForm(const MCInst &MI, const MCInstrInfo *MCII);
bool isFpOrNEON(const MCInst &MI, const MCInstrInfo *MCII);
-}
+} // namespace AArch64_MC
namespace AArch64 {
enum OperandType {
OPERAND_IMPLICIT_IMM_0 = MCOI::OPERAND_FIRST_TARGET,
+ OPERAND_SHIFT_MSL,
};
} // namespace AArch64
-} // End llvm namespace
+} // namespace llvm
// Defines symbolic names for AArch64 registers. This defines a mapping from
// register name to register number.