Fix #1226: Store minimal info in IR to construct hierarchy