MachineFunction &MF = DAG.getMachineFunction();
const Function *F = MF.getFunction();
auto &DL = MF.getDataLayout();
- bool isKernel = llvm::isKernelFunction(*F);
SDValue tempChain = Chain;
Chain = DAG.getCALLSEQ_START(Chain,
// Enforce minumum alignment of 4 to work around ptxas miscompile
// for sm_50+. See corresponding alignment adjustment in
// emitFunctionParamList() for details.
- if (!isKernel && ArgAlign < 4)
+ if (ArgAlign < 4)
ArgAlign = 4;
SDValue DeclareParamOps[] = {Chain, DAG.getConstant(ArgAlign, dl, MVT::i32),
DAG.getConstant(paramCount, dl, MVT::i32),
; CHECK: .param .align 4 .b8 t4_param_0[1]
ret void
}
+
+;;; Make sure we adjust alignment at the call site as well.
+define ptx_device void @t5(i8* align 2 byval %x) {
+; CHECK: .func t5
+; CHECK: .param .align 4 .b8 t5_param_0[1]
+; CHECK: {
+; CHECK: .param .align 4 .b8 param0[1];
+; CHECK: call.uni
+ call void @t4(i8* byval %x)
+ ret void
+}