Depends on how much current you need to draw from the reference, and how much power you are willing to waste in the regulator/series resistor. 6Vin to 5Vout is below the dropout voltage for a LM317.
You may get by only providing a fixed reference voltage of 2.495V (the natural LM431 output) to the input of your comparitor. There is no need to regulate the V+ for the regulator. Look up the Power Supply Rejection Ratio (PSRR) on the data sheet for the comparator you plan to use.