[PATCH] D80249: CodeGen: Don't lazily construct MachineFunctionInfo
Scott Linder via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 16 13:19:43 PDT 2020
scott.linder added a comment.
In D80249#2156869 <https://reviews.llvm.org/D80249#2156869>, @nhaehnle wrote:
> Do you really need to change the signature of `MachineFunctionInfo::create`? That seems orthogonal to the problem you're trying to solve, or perhaps a redundant solution.
>
> The problem is: due to lazy construction and being able to refer to the MachineFunction, the state of the MachineFunctionInfo can have surprising accidental differences depending on when exactly it was created. There are two possible solutions:
>
> 1. Prevent the MachineFunctionInfo from accessing the MachineFunction.
> 2. Always create the MachineFunctionInfo in the same place.
>
> This change does both, but either solution should be sufficient, and I personally find #1 counter-intuitive: it seems to me that the additional target-specific info about an object should be allowed to access that object.
What state in the MF is valid for the MFI to rely on at that well-defined point? If the MF is mutable, isn't the MFI potentially stale the moment the MF is mutated?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80249/new/
https://reviews.llvm.org/D80249
More information about the llvm-commits
mailing list