This is an archive of the discontinued LLVM Phabricator instance.

SROA: Check Total Bits of vector type
ClosedPublic

Authored by ssarda on Jul 31 2019, 10:03 AM.

Details

Summary

SROA: Check Total Bits of vector type

While Promoting alloca instruction of Vector Type, Check total size in bits of its slices too.
If they don't match, don't promote the alloca instruction.

Bug : https://bugs.llvm.org/show_bug.cgi?id=42585

Diff Detail

Repository
rL LLVM

Event Timeline

ssarda created this revision.Jul 31 2019, 10:03 AM
arsenm added inline comments.Aug 1 2019, 11:38 AM
llvm/test/Transforms/SROA/vector-promotion-different-size.ll
14

Can you add some more tests with mismatched element types?

ssarda updated this revision to Diff 213073.Aug 2 2019, 10:04 AM

Updated with 1 more test case.

ssarda marked an inline comment as done.Aug 2 2019, 10:05 AM
ssarda added inline comments.
llvm/test/Transforms/SROA/vector-promotion-different-size.ll
14

Added one more case

Gentle Ping!!

ssarda added a comment.Sep 3 2019, 7:54 AM

@arsenm
@t.p.northover
@reames

Gentle Ping !! I would be grateful if someone can review the updated patch.

arsenm accepted this revision.Sep 3 2019, 8:01 AM

This seems reasonable

llvm/lib/Transforms/Scalar/SROA.cpp
1892–1896

Can you add a comment that this is for bitcats to vectors with different numbers of elements?

This revision is now accepted and ready to land.Sep 3 2019, 8:01 AM
ssarda updated this revision to Diff 218460.Sep 3 2019, 8:20 AM

Added comment as suggested.

arsenm accepted this revision.Sep 3 2019, 8:31 AM
ssarda closed this revision.Sep 21 2019, 11:18 AM

Committed in https://llvm.org/viewvc/llvm-project?view=revision&revision=372480

I better take care to mention phab link of approval in commit message next time.