Skip to main content
6 events
when toggle format what by license comment
Aug 7, 2014 at 19:16 comment added InformedA You might be right, this might be loaded only from cache. I am reading more into this, it has been a while. Wikipage seems to contain lot of info that I have misread.
Aug 7, 2014 at 14:10 history edited Useless CC BY-SA 3.0
added 264 characters in body
Aug 7, 2014 at 13:57 comment added Useless I suspect it will turn into a successful load from cache in that case, which still isn't the same as direct access to the register file. And a function call which is semantically guaranteed not to write to an argument (which probably should be marked const, but isn't) can easily be both too big for that icache, and trivial for a programmer to reason about.
Aug 7, 2014 at 13:52 comment added InformedA Correct me if I am wrong, but a typical CPU like Intel Core i5 has about 1.5K to use as cache for micro-instructions (the instructions that are lower-level than machine/assembly instructions). The cache is about 6Kb in size. So even the case you mentioned above when pointer alias is hard to prove, the CPU will still be able to figure out the same mem address and optimize to use registers. Of course, if the variables are too far apart in the code, the micro-instruction cache will not be enough. But then I doubt that, human can see a potential optimization that is more than 300 lines apart.
Aug 7, 2014 at 13:22 history edited Useless CC BY-SA 3.0
added 976 characters in body
Aug 7, 2014 at 11:44 history answered Useless CC BY-SA 3.0