[llvm] r287015 - AMDGPU: Fix return after else
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 15 11:58:55 PST 2016
Author: arsenm
Date: Tue Nov 15 13:58:54 2016
New Revision: 287015
URL: http://llvm.org/viewvc/llvm-project?rev=287015&view=rev
Log:
AMDGPU: Fix return after else
Modified:
llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp?rev=287015&r1=287014&r2=287015&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp Tue Nov 15 13:58:54 2016
@@ -2592,10 +2592,13 @@ static bool ConvertBoundCtrl(int64_t &Bo
if (BoundCtrl == 0) {
BoundCtrl = 1;
return true;
- } else if (BoundCtrl == -1) {
+ }
+
+ if (BoundCtrl == -1) {
BoundCtrl = 0;
return true;
}
+
return false;
}
@@ -2651,16 +2654,19 @@ OperandMatchResultTy AMDGPUAsmParser::pa
return MatchOperand_NoMatch;
}
-OperandMatchResultTy AMDGPUAsmParser::parseOModOperand(OperandVector &Operands)
-{
+OperandMatchResultTy AMDGPUAsmParser::parseOModOperand(OperandVector &Operands) {
StringRef Name = Parser.getTok().getString();
if (Name == "mul") {
- return parseIntWithPrefix("mul", Operands, AMDGPUOperand::ImmTyOModSI, ConvertOmodMul);
- } else if (Name == "div") {
- return parseIntWithPrefix("div", Operands, AMDGPUOperand::ImmTyOModSI, ConvertOmodDiv);
- } else {
- return MatchOperand_NoMatch;
+ return parseIntWithPrefix("mul", Operands,
+ AMDGPUOperand::ImmTyOModSI, ConvertOmodMul);
}
+
+ if (Name == "div") {
+ return parseIntWithPrefix("div", Operands,
+ AMDGPUOperand::ImmTyOModSI, ConvertOmodDiv);
+ }
+
+ return MatchOperand_NoMatch;
}
void AMDGPUAsmParser::cvtId(MCInst &Inst, const OperandVector &Operands) {
More information about the llvm-commits
mailing list