On Tue, Mar 28, 2017 at 02:57:01PM -0700, Linus Torvalds wrote: > On Tue, Mar 28, 2017 at 1:27 PM, Luc Van Oostenryck > <luc.vanoostenryck@xxxxxxxxx> wrote: > > On Tue, Mar 28, 2017 at 11:02:32AM -0700, Linus Torvalds wrote: > >> > >> The single-store shortcut is actually pretty important, because it is > >> what turns a *lot* of local variables from stack memory things into > >> pseudos. That's partly because the sparse optimizations aren't all > >> that smart. > > > > Everytime I look at this part of the code, I think the same: > > why turn all vars into stack memory to have to turn them later > > into pseudos? > > Oh, you absolutely *cannot* turn them into pseudo's directly. No no, of course. I was just thinking loud about how easy it would be to simplify the case of simple local variables whose address is not taken. > A pseudo is a "register", and in SSA format. Local variables are not > registers, and do not honor SSA. > > So local variables are very much *not* pseudos at any time. Local > variables can have their address taken, local variables can be > assigned multiple times, local variables can have complex types, none > of which is pseudo-like behavior. > > Now, some *very* limited cases of local variables end up being > trivially very similar to pseudos, and those simple cases get turned > into pseudos. But that only happens for the simple cases - when their > address is not taken or used, and when they only have a single > assignment to them. > > But local variables do not start out as pseudos, exactly because the > pseudo case is a very very very limited case of the full local > variable case. I was not thinking to turn them directly into pseudos, just to recognize that they will turn into pseudo and this is useless to turn them into stack memory. So multiple assignmement would be OK, but having its address taken would not and being an array would also not be OK. I have no idea if it would simplify or speedup things though. -- Luc -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html