[PATCH] D28372: Revert "Reapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")"
Evgeniy Stepanov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 5 12:02:06 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL291168: Revert "Reapply r291025 ("AMDGPU: Remove unneccessary intermediate vector")" (authored by eugenis).
Changed prior to commit:
https://reviews.llvm.org/D28372?vs=83282&id=83284#toc
Repository:
rL LLVM
https://reviews.llvm.org/D28372
Files:
llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Index: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
@@ -822,7 +822,6 @@
bool isForcedVOP3() const { return ForcedEncodingSize == 64; }
bool isForcedDPP() const { return ForcedDPP; }
bool isForcedSDWA() const { return ForcedSDWA; }
- ArrayRef<unsigned> getMatchedVariants() const;
std::unique_ptr<AMDGPUOperand> parseRegister();
bool ParseRegister(unsigned &RegNo, SMLoc &StartLoc, SMLoc &EndLoc) override;
@@ -1631,44 +1630,31 @@
return Match_Success;
}
-// What asm variants we should check
-ArrayRef<unsigned> AMDGPUAsmParser::getMatchedVariants() const {
- if (getForcedEncodingSize() == 32) {
- static const unsigned Variants[] = {AMDGPUAsmVariants::DEFAULT};
- return Variants;
- }
-
- if (isForcedVOP3()) {
- static const unsigned Variants[] = {AMDGPUAsmVariants::VOP3};
- return Variants;
- }
-
- if (isForcedSDWA()) {
- static const unsigned Variants[] = {AMDGPUAsmVariants::SDWA};
- return Variants;
- }
-
- if (isForcedDPP()) {
- static const unsigned Variants[] = {AMDGPUAsmVariants::DPP};
- return Variants;
- }
-
- static const unsigned Variants[] = {
- AMDGPUAsmVariants::DEFAULT, AMDGPUAsmVariants::VOP3,
- AMDGPUAsmVariants::SDWA, AMDGPUAsmVariants::DPP
- };
-
- return Variants;
-}
-
bool AMDGPUAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands,
MCStreamer &Out,
uint64_t &ErrorInfo,
bool MatchingInlineAsm) {
+ // What asm variants we should check
+ std::vector<unsigned> MatchedVariants;
+ if (getForcedEncodingSize() == 32) {
+ MatchedVariants = {AMDGPUAsmVariants::DEFAULT};
+ } else if (isForcedVOP3()) {
+ MatchedVariants = {AMDGPUAsmVariants::VOP3};
+ } else if (isForcedSDWA()) {
+ MatchedVariants = {AMDGPUAsmVariants::SDWA};
+ } else if (isForcedDPP()) {
+ MatchedVariants = {AMDGPUAsmVariants::DPP};
+ } else {
+ MatchedVariants = {AMDGPUAsmVariants::DEFAULT,
+ AMDGPUAsmVariants::VOP3,
+ AMDGPUAsmVariants::SDWA,
+ AMDGPUAsmVariants::DPP};
+ }
+
MCInst Inst;
unsigned Result = Match_Success;
- for (auto Variant : getMatchedVariants()) {
+ for (auto Variant : MatchedVariants) {
uint64_t EI;
auto R = MatchInstructionImpl(Operands, Inst, EI, MatchingInlineAsm,
Variant);
@@ -3500,7 +3486,7 @@
for (unsigned E = Operands.size(); I != E; ++I) {
AMDGPUOperand &Op = ((AMDGPUOperand &)*Operands[I]);
// Add the register arguments
- if ((BasicInstType == SIInstrFlags::VOPC ||
+ if ((BasicInstType == SIInstrFlags::VOPC ||
BasicInstType == SIInstrFlags::VOP2)&&
Op.isReg() &&
Op.Reg.RegNo == AMDGPU::VCC) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28372.83284.patch
Type: text/x-patch
Size: 3121 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170105/90f700dd/attachment.bin>
More information about the llvm-commits
mailing list