BR 2781900: handle common labels while optimizing