Skip to content

Commit 7eb193b

Browse files
Revert "[AMDGPU][True16][MC] validate op_sel and .l/.h syntax (#123250)"
This reverts commit fabe747. Multiple buildbots are failing. See: #123250
1 parent 6a05bee commit 7eb193b

File tree

2 files changed

+0
-55
lines changed

2 files changed

+0
-55
lines changed

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#include "llvm/MC/MCParser/MCAsmParser.h"
3434
#include "llvm/MC/MCParser/MCParsedAsmOperand.h"
3535
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
36-
#include "llvm/MC/MCRegisterInfo.h"
3736
#include "llvm/MC/MCSymbol.h"
3837
#include "llvm/MC/TargetRegistry.h"
3938
#include "llvm/Support/AMDGPUMetadata.h"
@@ -1537,10 +1536,6 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
15371536
return getFeatureBits()[AMDGPU::FeatureFlatInstOffsets];
15381537
}
15391538

1540-
bool hasTrue16Insts() const {
1541-
return getFeatureBits()[AMDGPU::FeatureTrue16BitInsts];
1542-
}
1543-
15441539
bool hasArchitectedFlatScratch() const {
15451540
return getFeatureBits()[AMDGPU::FeatureArchitectedFlatScratch];
15461541
}
@@ -1782,7 +1777,6 @@ class AMDGPUAsmParser : public MCTargetAsmParser {
17821777
bool validateMIMGDim(const MCInst &Inst, const OperandVector &Operands);
17831778
bool validateMIMGMSAA(const MCInst &Inst);
17841779
bool validateOpSel(const MCInst &Inst);
1785-
bool validateTrue16OpSel(const MCInst &Inst);
17861780
bool validateNeg(const MCInst &Inst, int OpName);
17871781
bool validateDPP(const MCInst &Inst, const OperandVector &Operands);
17881782
bool validateVccOperand(MCRegister Reg) const;
@@ -4657,39 +4651,6 @@ bool AMDGPUAsmParser::validateOpSel(const MCInst &Inst) {
46574651
return true;
46584652
}
46594653

4660-
bool AMDGPUAsmParser::validateTrue16OpSel(const MCInst &Inst) {
4661-
if (!hasTrue16Insts())
4662-
return true;
4663-
const MCRegisterInfo *MRI = getMRI();
4664-
const unsigned Opc = Inst.getOpcode();
4665-
int OpSelIdx = AMDGPU::getNamedOperandIdx(Opc, AMDGPU::OpName::op_sel);
4666-
if (OpSelIdx == -1)
4667-
return true;
4668-
unsigned OpSelOpValue = Inst.getOperand(OpSelIdx).getImm();
4669-
// If the value is 0 we could have a default OpSel Operand, so conservatively
4670-
// allow it.
4671-
if (OpSelOpValue == 0)
4672-
return true;
4673-
unsigned OpCount = 0;
4674-
for (int OpName : {AMDGPU::OpName::src0, AMDGPU::OpName::src1,
4675-
AMDGPU::OpName::src2, AMDGPU::OpName::vdst}) {
4676-
int OpIdx = AMDGPU::getNamedOperandIdx(Inst.getOpcode(), OpName);
4677-
if (OpIdx == -1)
4678-
continue;
4679-
const MCOperand &Op = Inst.getOperand(OpIdx);
4680-
if (Op.isReg() &&
4681-
MRI->getRegClass(AMDGPU::VGPR_16RegClassID).contains(Op.getReg())) {
4682-
bool VGPRSuffixIsHi = AMDGPU::isHi16Reg(Op.getReg(), *MRI);
4683-
bool OpSelOpIsHi = ((OpSelOpValue & (1 << OpCount)) != 0);
4684-
if (OpSelOpIsHi != VGPRSuffixIsHi)
4685-
return false;
4686-
}
4687-
++OpCount;
4688-
}
4689-
4690-
return true;
4691-
}
4692-
46934654
bool AMDGPUAsmParser::validateNeg(const MCInst &Inst, int OpName) {
46944655
assert(OpName == AMDGPU::OpName::neg_lo || OpName == AMDGPU::OpName::neg_hi);
46954656

@@ -5171,11 +5132,6 @@ bool AMDGPUAsmParser::validateInstruction(const MCInst &Inst,
51715132
Error(getRegLoc(LDS_DIRECT, Operands), *ErrMsg);
51725133
return false;
51735134
}
5174-
if (!validateTrue16OpSel(Inst)) {
5175-
Error(getImmLoc(AMDGPUOperand::ImmTyOpSel, Operands),
5176-
"op_sel operand conflicts with 16-bit operand suffix");
5177-
return false;
5178-
}
51795135
if (!validateSOPLiteral(Inst)) {
51805136
Error(getLitLoc(Operands),
51815137
"only one unique literal operand is allowed");

llvm/test/MC/AMDGPU/gfx11_asm_opsel_err.s

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)