llvm.org GIT mirror llvm / 3ea0adc
[NVPTXAsmPrinter] do not print .align on function headers Summary: PTX does not allow .align directives on function headers. Fixes PR21551. Test Plan: test/Codegen/NVPTX/function-align.ll Reviewers: eliben, jholewinski Reviewed By: eliben, jholewinski Subscribers: llvm-commits, eliben, jpienaar, jholewinski Differential Revision: http://reviews.llvm.org/D8274 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232004 91177308-0d34-0410-b5e6-96231b3b80d8 Jingyue Wu 5 years ago
5 changed file(s) with 17 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
255255 /// argument and how it is interpreted. Defaults to NoAlignment.
256256 LCOMM::LCOMMType LCOMMDirectiveAlignmentType;
257257
258 // True if the target allows .align directives on funtions. This is true for
259 // most targets, so defaults to true.
260 bool HasFunctionAlignment;
261
258262 /// True if the target has .type and .size directives, this is true for most
259263 /// ELF targets. Defaults to true.
260264 bool HasDotTypeDotSizeDirective;
466470 LCOMM::LCOMMType getLCOMMDirectiveAlignmentType() const {
467471 return LCOMMDirectiveAlignmentType;
468472 }
473 bool hasFunctionAlignment() const { return HasFunctionAlignment; }
469474 bool hasDotTypeDotSizeDirective() const { return HasDotTypeDotSizeDirective; }
470475 bool hasSingleParameterDotFile() const { return HasSingleParameterDotFile; }
471476 bool hasIdentDirective() const { return HasIdentDirective; }
526526 EmitVisibility(CurrentFnSym, F->getVisibility());
527527
528528 EmitLinkage(F, CurrentFnSym);
529 EmitAlignment(MF->getAlignment(), F);
529 if (MAI->hasFunctionAlignment())
530 EmitAlignment(MF->getAlignment(), F);
530531
531532 if (MAI->hasDotTypeDotSizeDirective())
532533 OutStreamer.EmitSymbolAttribute(CurrentFnSym, MCSA_ELF_TypeFunction);
6868 HasAggressiveSymbolFolding = true;
6969 COMMDirectiveAlignmentIsInBytes = true;
7070 LCOMMDirectiveAlignmentType = LCOMM::NoAlignment;
71 HasFunctionAlignment = true;
7172 HasDotTypeDotSizeDirective = true;
7273 HasSingleParameterDotFile = true;
7374 HasIdentDirective = false;
3838 InlineAsmEnd = " inline asm";
3939
4040 SupportsDebugInformation = CompileForDebugging;
41 // PTX does not allow .align on functions.
42 HasFunctionAlignment = false;
4143 HasDotTypeDotSizeDirective = false;
4244
4345 Data8bitsDirective = " .b8 ";
0 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
1
2 ; CHECK-NOT: .align 2
3 define ptx_device void @foo() align 2 {
4 ; CHECK-LABEL: .func foo
5 ret void
6 }