News for hackers. Stuff that matters.
Re:Avoid character-by-character processing when performance ... by ridiculous_fish on Saturday July 25, 2020 @02:02AM (#23947177)
IMO this is one of those fragile optimizations. If the optimization is important, it should be explicit (hand-rolled asm) or else you risk breaking it. If it's not important, then nobody cares.

Emitting OoB reads dependent on optimization level? Think about ASAN, debugger watchpoints...can't be worth it!

clang has a cool feature that highlights missed vectorization opportunities:

    > clang++ -O3 -c  test.cpp -Rpass-analysis=loop-vectorize
    test.cpp:5:4: remark: loop not vectorized: loop control flow is not understood by vectorizer [-Rpass-analysis=loop-vectorize]
love it!
Re:Avoid character-by-character processing when performance ... by BeeOnRope on Saturday July 25, 2020 @09:41AM (#23949085)
In practice this type of over-read is not uncommon in library code (even for standard routines), but I haven't seen compilers generate it. False positives with memory-sanitizers is definitely a problem: the hand-rolled library uses can be whitelisted, but that's not feasible once the compiler starts generating it in arbitrary code.