Is this a bug in std.typecons.Tuple.slice?

Ola Fosheim Grøstad via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 9 03:38:14 PST 2016


On Tuesday, 9 February 2016 at 10:54:42 UTC, Marc Schütz wrote:
> No need to restrict the language here, there's nothing stopping 
> a decent compiler from storing tuples (actually _anything_) in 
> registers, in some cases even if references are taken. I'm 
> pretty sure LLVM can handle this.

If you don't restrict the language people will write code that 
the optimizer will struggle with.  LLVM can only handle what goes 
on within a compilation unit, and not if there are stores, 
because those are visible in other threads.

Tuples should be considered immutable constants (think functional 
programming), not in-memory storage.

Tuple's can serve as a good approximation to SIMD registers.



More information about the Digitalmars-d-learn mailing list