Skip to content

Simplify scalar GEPs into Private vectors into vector extract/insert - #1703

Merged
dneto0 merged 2 commits into
google:mainfrom
rjodinchr:simplify-private-gep
Oct 24, 2026
Merged

dneto0 merged 2 commits into
google:mainfrom
rjodinchr:simplify-private-gep

Conversation

@rjodinchr

Copy link
Copy Markdown
Collaborator

Add SimplifyPointerBitcastPass::runOnGEPToVector to rewrite scalar loads and stores through a Private GEP into a vector (<= 4 elements, e.g. from ((type*)&vec)[idx] after DestructurizeGEPPass and runOnImplicitGEP) into vector load + extractelement / insertelement + vector store, and run SROA after SimplifyPointerBitcastPass so that the underlying vector alloca is promoted to registers just like vec[idx].

Add SimplifyPointerBitcastPass::runOnGEPToVector to rewrite scalar loads and stores through a Private GEP into a vector (<= 4 elements, e.g. from ((type*)&vec)[idx] after DestructurizeGEPPass and runOnImplicitGEP) into vector load + extractelement / insertelement + vector store, and run SROA after SimplifyPointerBitcastPass so that the underlying vector alloca is promoted to registers just like vec[idx].
Comment thread lib/SimplifyPointerBitcastPass.cpp
@rjodinchr
rjodinchr requested a review from dneto0 October 23, 2026 17:20

@dneto0 dneto0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks!

@dneto0
dneto0 merged commit e602d42 into google:main Oct 24, 2026
18 checks passed
@rjodinchr
rjodinchr deleted the simplify-private-gep branch October 26, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants