The regalloc pass does that. It ensures that all the inputs and the output of a phi are all in the same register (or memory location), so the phi becomes a no-op. The regalloc pass doesn't actually remove the phi, though. Removal is actually in genssa in cmd/compile/internal/gc/ssa.go. Look for CheckLoweredPhi, which makes sure that the above statement is actually correct for all phis.
On Saturday, August 15, 2020 at 7:07:23 AM UTC-7 cuiw...@gmail.com wrote: > as we know, SSA has phi function, but the output of go tool compile -S > xxx.go which do not contains a phi instruction. so i am trying to find out > which SSA pass will transform a phi Op ssa.Value to normal ops? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/8eff0371-0e18-49ab-a8bb-e45fdf45926dn%40googlegroups.com.