3 ms·
How you'd answer depends very much on what you're doing -- which is the point of asking. You might be able to remove the memory copying by fiddling with alignme
by pjscott 12y ago
How you'd answer depends very much on what you're doing -- which is the point of asking. You might be able to remove the memory copying by fiddling with alignment somewhere in calling code and adding an annotation saying you did that. Bam, problem solved. Or you might not be able to do that, in which case it would still be nice to know what tradeoffs you're making.
- nomel 12y agoIf you can identify and apply these decisions, why can't the compiler? Everything about this seems to be saying, "We're stagnant with our current compiler/optimization paradigm...screw it."
- nitwit005 12y agoBut consider, for it to be worth asking, it's got to be something that's very difficult to infer, or the compiler wouldn't need to ask. That means it will probably be difficult for you to infer as well. In practice, you might have to profile all possible options, which would quickly turn into a major project if you're asked more than a handful of questions. And, of course, even if you can figure it out, that alignment annotation you just made is only optimal on the one target. Even on x86 it will depend on what instructions are available.