[llvm] r363039 - [ARM] Add the non-MVE instructions in Arm v8.1-M.

Mikael Holmén via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 12 06:55:52 PDT 2019



On 2019-06-12 15:24, Simon Tatham wrote:
>> From: Mikael Holmén <mikael.holmen at ericsson.com>
>> Sent: 12 June 2019 06:58
>>
>> Are all possible cases handled in the if/else if/else if branches?
>>
>> Perhaps we should add an else branch containing an llvm_unreachable to
>> make sure? Or change the last else if to else and then assert that we
>> indeed get an MI->getOperand(1).isSymbol() there?
> 
> I wasn't the original author of that code (it had to have someone's name on it going out of the door, but it was a team effort), but  I just spoke to the person who was (Andre Vieira). He said that _he_ doesn't know of any other case that can reach that code, and that if he'd seen the same warning then he would have added the llvm_unreachable. (And if it later fails, then we'll know what else *can* reach that code :-)
> 
> Will you add it (since you've got a compiler that gives the warning, to test against), or shall I?
> 

I can add it.

I'll verify that

@@ -1472,11 +1472,12 @@ void ARMAsmPrinter::EmitInstruction(const 
MachineInstr *MI) {
              GetARMGVSymbol(GV, MI->getOperand(1).getTargetFlags()), 
OutContext);
        } else if (MI->getOperand(1).isSymbol()) {
          BranchTarget = MCSymbolRefExpr::create(
              GetExternalSymbolSymbol(MI->getOperand(1).getSymbolName()),
              OutContext);
-      }
+      } else
+        llvm_unreachable("Unhandled operand kind in Branch Future 
instruction");

silences the warning then, and commit that.

Thanks,
Mikael


> Cheers,
> Simon
> 



More information about the llvm-commits mailing list