Skip to content
This repository was archived by the owner on Nov 1, 2021. It is now read-only.

More array splitting, handle select and phi #179

Merged
merged 4 commits into from
Apr 10, 2017
Merged

Conversation

kripken
Copy link
Member

@kripken kripken commented Apr 9, 2017

For #178

NewPhi->addIncoming(EV, IncomingBB);
}

// Reconstruct the original struct value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/struct/array

Value *NewStruct = UndefValue::get(ATy);

bool NeedsAnotherPass = false;
// Create a separate select instruction for each struct field.
Copy link
Contributor

@eddyb eddyb Apr 9, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/struct/array/

Select);
NeedsAnotherPass = NeedsAnotherPass || DoAnotherPass(NewSelect);

// Reconstruct the struct value.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/struct/array

@eddyb
Copy link
Contributor

eddyb commented Apr 9, 2017

I am a bit surprised that it's not easy to handle load/store/select/phi for both structs and arrays a bit more uniformly, but I suppose C++ and LLVM don't make it easy 😞.

@kripken
Copy link
Member Author

kripken commented Apr 9, 2017

Thanks, a bunch of places needed struct=>array renaming, fixed.

And yeah, it's a little sad we can't use a template for both. But we hit things like getElementType() needing an index for structs but not for arrays, so indeed C++ and LLVM make that tricky...

@kripken kripken merged commit 084a1d9 into incoming Apr 10, 2017
@kripken kripken deleted the more-array-splitting branch April 10, 2017 22:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants