This is an archive of the discontinued LLVM Phabricator instance.

[InstSimplify] fold extracting from std::pair (2/2)
ClosedPublic

Authored by inouehrs on Jul 30 2018, 5:18 AM.

Details

Summary

This is the second patch in a series of patches to enable jump threading with a method whose return type is std::pair<int, bool> or std::pair<bool, int>. Originally, this patch is included in D48828, but re-submitted as a separate patch.

This second patch in the series handles code sequences that merges two values using shl and or, then extracts one value using and.

Diff Detail

Repository
rL LLVM

Event Timeline

inouehrs created this revision.Jul 30 2018, 5:18 AM
inouehrs updated this revision to Diff 157949.Jul 30 2018, 5:20 AM
lebedev.ri accepted this revision.Jul 30 2018, 5:32 AM

Tentative LG as with D48828, but the questions raised in D48828 need to be resolved first.

This revision is now accepted and ready to land.Jul 30 2018, 5:32 AM
inouehrs updated this revision to Diff 158706.Aug 2 2018, 2:24 AM

@spatel @lebedev.ri Do you have any further comments before committing this?

lebedev.ri added a subscriber: hans.Aug 2 2018, 2:37 AM

Just one: test/Transforms/NewGVN/pair_jumpthread.ll can now be un-XFAIL'ed i think?

I wonder if this still can be merged into 7.0, given that it is the second half of D48828/rL338485, which made it into the 7.0.
@hans ?

hans added a comment.Aug 2 2018, 2:41 AM

Just one: test/Transforms/NewGVN/pair_jumpthread.ll can now be un-XFAIL'ed i think?

I wonder if this still can be merged into 7.0, given that it is the second half of D48828/rL338485, which made it into the 7.0.
@hans ?

Sounds good to me.

spatel accepted this revision.Aug 2 2018, 5:33 AM

LGTM - see inline for some typo fixes.

lib/Analysis/InstructionSimplify.cpp
1874–1875 ↗(On Diff #158706)

optimization -> optimize the
optimizers -> passes

test/Transforms/InstSimplify/AndOrXor.ll
995 ↗(On Diff #158706)

Here and below: concatinate -> concatenate

This revision was automatically updated to reflect the committed changes.

Just one: test/Transforms/NewGVN/pair_jumpthread.ll can now be un-XFAIL'ed i think?

I wonder if this still can be merged into 7.0, given that it is the second half of D48828/rL338485, which made it into the 7.0.
@hans ?

Sounds good to me.

@hans , I appreciate if you can merge this patch to 7.0. Thanks!

hans added a comment.Aug 6 2018, 11:21 PM

Just one: test/Transforms/NewGVN/pair_jumpthread.ll can now be un-XFAIL'ed i think?

I wonder if this still can be merged into 7.0, given that it is the second half of D48828/rL338485, which made it into the 7.0.
@hans ?

Sounds good to me.

@hans , I appreciate if you can merge this patch to 7.0. Thanks!

Merged in r339097.

Cheers,
Hans