As disscussed in https://reviews.llvm.org/D65148#1606412,
extractvalue don't actually generate any code,
so we should treat them as free.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
LGTM, though are we sure this is true for all targets? The comments in the referenced patch only consider X86. I'm pretty sure it is true for common architectures like AArch64 but I'm not as sure for more exotic things.
I have asked the exact same question before:
So it seems to be the right thing to do..
Well, my point is that thread only considers X86. Are we sure this is true for all targets?
Can anyone from non-X86 comment if this assumption still holds for those arches?
I suspect it does, but would be good to confirm.
That is reassuring, and in-line with other comments.
Does anyone feel confident-enough about it to review/stamp?
I think I'm happy to stamp. I can't think of why this patch might be wrong, and it's easy to back out if someone finds a counterexample. LGTM.
I ran some ARM and AArch64 tests, which agreed that this is OK for those architectures (although they are probably already covered by what James said above).