One step further getting aggregate loads and store being optimized properly. This will only handle struct with one element at this point.
Depends on D7780
Differential D8339
Update InstCombine to transform aggregate loads into scalar loads. deadalnix on Mar 13 2015, 7:12 PM. Authored by
Details One step further getting aggregate loads and store being optimized properly. This will only handle struct with one element at this point. Depends on D7780
Diff Detail Event TimelineComment Actions It's been 3 weeks folk. Can we make something happen here, before we all die from old age ?
Comment Actions Can you provide a more complete description of what this is achieving in the commit message?
Comment Actions Looks functionally correct to me. I do have some style comments that need addressed though.
Comment Actions You probably need to wait for some of the other commenters to give the final ok on this, but FWIW it LGTM with the changes I pointed out. Cheers,
Comment Actions With Pete's comments addressed and the missing setPointerOperand(gep struct, 0) added, LGTM.
|
The naming here is confusing to the point where I'm having a hard time telling what you intend. If I'm reading this right, by Value you mean address loaded from? You're changing both the type loaded and the pointer operand in one go?
If so, I might suggest the following:
You might also consider changing the type loaded and the pointer operand in two distinct steps.
NewLI = combineLoadToType(*this, OldLI, ElementType);
NewLI->setPointerOperand(ElementPtr);
The intermediate state (load type X from a pointer of type Y using a bitcast) is entirely legal.