Compiler Explorer has a small example.
Basically, the local variable x
remains stack allocated; caller passes x
by const reference so callee shouldn’t modify x
.
My question is, is it an legitimate optimization to SROA x
?
Compiler Explorer has a small example.
Basically, the local variable x
remains stack allocated; caller passes x
by const reference so callee shouldn’t modify x
.
My question is, is it an legitimate optimization to SROA x
?
Two-fold answer:
nocapture
attribute)Roman