[#llvm-legalizeMachineFunction] = xref:llvm.adoc[llvm]::legalizeMachineFunction :relfileprefix: ../ :mrdocs: Legalize generic instructions in `MF` according to `LI.` == Synopsis Declared in `<llvm/CodeGen/GlobalISel/Legalizer.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:llvm/LegalizerMFResult.adoc[LegalizerMFResult] legalizeMachineFunction( xref:llvm/MachineFunction.adoc[MachineFunction]& MF, xref:llvm/LegalizerInfo.adoc[LegalizerInfo] const& LI, xref:llvm/ArrayRef-08.adoc[ArrayRef<GISelChangeObserver*>] AuxObservers, xref:llvm/LostDebugLocObserver.adoc[LostDebugLocObserver]& LocObserver, xref:llvm/MachineIRBuilder.adoc[MachineIRBuilder]& MIRBuilder, xref:llvm/LibcallLoweringInfo.adoc[LibcallLoweringInfo] const* Libcalls, xref:llvm/GISelValueTracking.adoc[GISelValueTracking]* VT); ---- == Description Walks the function, legalizes pre‐ISel generic opcodes, and updates observers as instructions are created, changed, or erased. == Return Value Whether the function changed and, on failure, the illegal instr. == Parameters [cols="1,4"] |=== | Name| Description | *MF* | Machine function whose instructions are legalized. | *LI* | Target legalization rules to apply. | *AuxObservers* | Additional change observers (for example CSE). | *LocObserver* | Observer that tracks lost debug locations. | *MIRBuilder* | Builder used to create replacement instructions. | *Libcalls* | Optional libcall lowering info; may be null. | *VT* | Optional value‐tracking analysis; may be null. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#