The for range loop in function LowerFMINIMUM_FMAXIMUM, it enumerate Op->op_values() with copy instead of ref, every element here is a SDValue which contains 1 pointer SDNode and an unsigned value, it's better to use ref here as what the author did in SelectionDAGNodes.h.
Details
- Reviewers
- None
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
We pass SDValue by value all over the SelectionD
AG code. And it looks pretty easy for a compiler to see the unsigned field is unused. Does this change really make a difference?
I don't know about if compiler will do this opt to ignore the unused field for a class obj. Previously I mistook the enumerated element with SDUse which has more fields, but now the SDValue only has two fields, I also think this will make big difference. And if compiler would do the opt you said, maybe the program will go worse.
Thanks for pointing! I'm interested in where the info '16 byte' from, actually I searched for some while but didn't get useful info. I used to think that 8 byte could be reasonable because it can be fit in internal type.
I would expect SROA to break up the memcpy into scalar stores after that dead store elimination should be able to remove it.
For the pointer, I expect store to load forwarding should make it we don’t have to load from the stored copy. Then the store also becomes eligible for dead store elimination.