llvm.org GIT mirror llvm / 09080a9
[NVPTX] Make sure we adjust alignment at all call sites .. including calls from kernel functions that were ignored by mistake before. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@275920 91177308-0d34-0410-b5e6-96231b3b80d8 Artem Belevich 3 years ago
2 changed file(s) with 12 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
10711071 MachineFunction &MF = DAG.getMachineFunction();
10721072 const Function *F = MF.getFunction();
10731073 auto &DL = MF.getDataLayout();
1074 bool isKernel = llvm::isKernelFunction(*F);
10751074
10761075 SDValue tempChain = Chain;
10771076 Chain = DAG.getCALLSEQ_START(Chain,
13411340 // Enforce minumum alignment of 4 to work around ptxas miscompile
13421341 // for sm_50+. See corresponding alignment adjustment in
13431342 // emitFunctionParamList() for details.
1344 if (!isKernel && ArgAlign < 4)
1343 if (ArgAlign < 4)
13451344 ArgAlign = 4;
13461345 SDValue DeclareParamOps[] = {Chain, DAG.getConstant(ArgAlign, dl, MVT::i32),
13471346 DAG.getConstant(paramCount, dl, MVT::i32),
3030 ; CHECK: .param .align 4 .b8 t4_param_0[1]
3131 ret void
3232 }
33
34 ;;; Make sure we adjust alignment at the call site as well.
35 define ptx_device void @t5(i8* align 2 byval %x) {
36 ; CHECK: .func t5
37 ; CHECK: .param .align 4 .b8 t5_param_0[1]
38 ; CHECK: {
39 ; CHECK: .param .align 4 .b8 param0[1];
40 ; CHECK: call.uni
41 call void @t4(i8* byval %x)
42 ret void
43 }