>>> Other thoughts? >> >> The docs seem to hint TARGET_SCHED_CAN_SPECULATE_INSN is meant for stuff >> we can't/don't model in the pipeline, but I have no idea how to model >> the VL=0 case there. > Maybe so, but what Edwin is doing looks sensible enough. It wouldn't be > the first time a hook got (ab)used in ways that weren't part of the > original intent.
I don't fully understand what's happening. So the hoisting is being done speculatively here? And it just happens to be "bad" because that might cause a VL=0 case. But are we sure a lack of speculation cannot cause such cases? Also, why doesn't the vsetvl pass fix the situation? IMHO we need to understand the problem more thoroughly before changing things. In the end LCM minimizes the number of vsetvls and inserts them at the "earliest" point. If that is not sufficient I'd say we need modify the constraints (maybe on a per-uarch basis)? On a separate note: How about we move the vsetvl pass after sched2? Then we could at least rely on LCM doing its work uninhibited and wouldn't reorder vsetvls afterwards. Or do we somehow rely on rtl_dce and BB reorder to run afterwards? That won't help with the problem here but might with others. -- Regards Robin