Pavel Kopyl 8913b35f08 [NVPTX] Enforce minumum alignment of 4 for byval parametrs in a function prototype
As a result, we have identical alignment calculation of byval
parameters for:

  - LowerCall() - getting alignment of an argument (.param)

  - emitFunctionParamList() - getting alignment of a
    parameter (.param) in a function declaration

  - getPrototype() - getting alignment of a parameter (.param) in a
    function prototypes that is used for indirect calls

This change is required to avoid ptxas error: 'Alignment of argument
does not match formal parameter'. This error happens even in cases
where it logically shouldn't.

For instance:

  .param .align 4 .b8 param0[4];
  ...
  callprototype ()_ (.param .align 2 .b8 _[4]);
  ...

Here we allocate 'param0' with alignment of 4 and it should be fine to
pass it to a function that requires minimum alignment of 2.

At least ptxas v12.0 rejects this code.

Differential Revision: https://reviews.llvm.org/D140581
2023-01-10 15:22:40 +03:00
..
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-12-28 21:45:51 +03:00
2022-07-12 07:58:13 -07:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00
2022-04-28 14:59:45 +03:00