Skip to content

Commit 7b7d3b2

Browse files
committed
[AsmParser] Remove some redundant checks for align attributes
The verifier already has a more general check that the attribute is legal for the position it is used in.
1 parent 15c1ab2 commit 7b7d3b2

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

llvm/lib/AsmParser/LLParser.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6506,9 +6506,6 @@ bool LLParser::parseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
65066506
if (I != E)
65076507
return error(CallLoc, "not enough parameters specified for call");
65086508

6509-
if (FnAttrs.hasAlignmentAttr())
6510-
return error(CallLoc, "invoke instructions may not have an alignment");
6511-
65126509
// Finish off the Attribute and check them
65136510
AttributeList PAL =
65146511
AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),
@@ -6822,9 +6819,6 @@ bool LLParser::parseCallBr(Instruction *&Inst, PerFunctionState &PFS) {
68226819
if (I != E)
68236820
return error(CallLoc, "not enough parameters specified for call");
68246821

6825-
if (FnAttrs.hasAlignmentAttr())
6826-
return error(CallLoc, "callbr instructions may not have an alignment");
6827-
68286822
// Finish off the Attribute and check them
68296823
AttributeList PAL =
68306824
AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),
@@ -7220,9 +7214,6 @@ bool LLParser::parseCall(Instruction *&Inst, PerFunctionState &PFS,
72207214
if (I != E)
72217215
return error(CallLoc, "not enough parameters specified for call");
72227216

7223-
if (FnAttrs.hasAlignmentAttr())
7224-
return error(CallLoc, "call instructions may not have an alignment");
7225-
72267217
// Finish off the Attribute and check them
72277218
AttributeList PAL =
72287219
AttributeList::get(Context, AttributeSet::get(Context, FnAttrs),

llvm/test/Assembler/call-invalid-1.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ declare void @f()
44

55
define void @g() {
66
call void @f() align 8
7-
; CHECK: error: call instructions may not have an alignment
7+
; CHECK: Attribute 'align 8' does not apply to functions!
88
ret void
99
}

0 commit comments

Comments
 (0)