[Scheduler][NFC] Don't use set to track visited nodes (#190480)
The visited set can grow rather large and we can use an unused field in
SDNode to store the same information without the use of a hash set.
This improves compile times: stage2-O3 -0.14%.