[PATCH] D87844: [CodeGen] Fixing inconsistent ABI mangling of vlaues in SelectionDAGBuilder

Lucas Prates via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 18 07:27:57 PDT 2020


pratlucas added a comment.

This seemed weird to me as well, specially as removing it had no impact on any of the regression tests.

>From what I could check, though, the ABI mangling from the legal register types is already being performed by `getCopyFromParts` when collecting the return value inside `SelectionDAGBuilder::LowerCallTo`.
With that, when getting the return value afterwards, the ABI mangling was applied twice.

In the example from the commit message, what happened was the following:

  %arg2 = call fastcc half @someFunc()                             ; Here, the return value of @sumeFunc went through ABI mangling properly inside SelectionDAGBuilder::LowerCallTo
  call fastcc void @otherFunc(half %arg1, half %arg2)              ; When getting the value for the lowering of the %arg2 actual argument, the ABI mangling would happen again over the same value in `RegsForValue::getCopyFromRegs`

I've also noted that the calling convention argument is only being used for `RegsForValue::getCopyToRegs` in `SelectionDAGBuilder::LowerStatepoint`. All its other usages set the calling convention to `None`.

This inconsistency in the ABI mangling apparently caused no harm before, but after the introduction of the target-dependent splitting/joining of value parts by D75169 <https://reviews.llvm.org/D75169> a difference in the final results can be observed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87844/new/

https://reviews.llvm.org/D87844



More information about the llvm-commits mailing list