[AsmParser] Remove some redundant checks for align attributes
authorNikita Popov <npopov@redhat.com>
Tue, 11 Oct 2022 07:53:08 +0000 (09:53 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 11 Oct 2022 07:53:08 +0000 (09:53 +0200)
The verifier already has a more general check that the attribute is
legal for the position it is used in.

llvm/lib/AsmParser/LLParser.cpp
llvm/test/Assembler/call-invalid-1.ll

index db848f4..9b6c6d8 100644 (file)
@@ -6506,9 +6506,6 @@ bool LLParser::parseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
   if (I != E)
     return error(CallLoc, "not enough parameters specified for call");
 
-  if (FnAttrs.hasAlignmentAttr())
-    return error(CallLoc, "invoke instructions may not have an alignment");
-
   // Finish off the Attribute and check them
   AttributeList PAL =
       AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),
@@ -6822,9 +6819,6 @@ bool LLParser::parseCallBr(Instruction *&Inst, PerFunctionState &PFS) {
   if (I != E)
     return error(CallLoc, "not enough parameters specified for call");
 
-  if (FnAttrs.hasAlignmentAttr())
-    return error(CallLoc, "callbr instructions may not have an alignment");
-
   // Finish off the Attribute and check them
   AttributeList PAL =
       AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),
@@ -7220,9 +7214,6 @@ bool LLParser::parseCall(Instruction *&Inst, PerFunctionState &PFS,
   if (I != E)
     return error(CallLoc, "not enough parameters specified for call");
 
-  if (FnAttrs.hasAlignmentAttr())
-    return error(CallLoc, "call instructions may not have an alignment");
-
   // Finish off the Attribute and check them
   AttributeList PAL =
       AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),
index 4a12b14..1d48bf6 100644 (file)
@@ -4,6 +4,6 @@ declare void @f()
 
 define void @g() {
   call void @f() align 8
-; CHECK: error: call instructions may not have an alignment
+; CHECK: Attribute 'align 8' does not apply to functions!
   ret void
 }