abhi9u@lemmy.world to Technology@lemmy.worldEnglish · 3 个月前Hardware-Aware Coding: CPU Architecture Concepts Every Developer Should Knowblog.codingconfessions.comexternal-linkmessage-square7linkfedilinkarrow-up174arrow-down16
arrow-up168arrow-down1external-linkHardware-Aware Coding: CPU Architecture Concepts Every Developer Should Knowblog.codingconfessions.comabhi9u@lemmy.world to Technology@lemmy.worldEnglish · 3 个月前message-square7linkfedilink
minus-squarepixeltree@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up15·3 个月前TL:DR: minimize randomness, group variables by access frequency, and unroll loops if your compiler doesn’t do that already
minus-squarecall_me_xale@lemmy.ziplinkfedilinkEnglisharrow-up11·3 个月前tl;dr tl;dr: use a modern compiler.
minus-squarebejean@lemmy.worldlinkfedilinkEnglisharrow-up4·3 个月前Do any compilers NOT unroll loops in high optimization modes? I was under three impression this was usually unnecessary.
minus-squarepixeltree@lemmy.blahaj.zonelinkfedilinkEnglisharrow-up3·3 个月前No clue, I was just frustrated with how much useless extended metaphor was in the article and thought I’d save people some time
minus-squareInverseParallax@lemmy.worldlinkfedilinkEnglisharrow-up1·3 个月前Really depends on the target, llvm goes between unrollimg and vectorizing cleanly, to unrollimg to a ludicrous degree, to refusing to unroll period. Some of it is subtarget specific, but sometimes it’s just weird. Gcc is evil incarnate, all it’s passes are at war with each other, loop Canon form often broke vectorization and even unrolling period.
TL:DR: minimize randomness, group variables by access frequency, and unroll loops if your compiler doesn’t do that already
tl;dr tl;dr: use a modern compiler.
Do any compilers NOT unroll loops in high optimization modes? I was under three impression this was usually unnecessary.
No clue, I was just frustrated with how much useless extended metaphor was in the article and thought I’d save people some time
Really depends on the target, llvm goes between unrollimg and vectorizing cleanly, to unrollimg to a ludicrous degree, to refusing to unroll period.
Some of it is subtarget specific, but sometimes it’s just weird.
Gcc is evil incarnate, all it’s passes are at war with each other, loop Canon form often broke vectorization and even unrolling period.