This is an archive of the discontinued LLVM Phabricator instance.

[MemDep] NFC walk invariant.group graph only down
ClosedPublic

Authored by Prazek on Dec 30 2016, 11:39 AM.

Details

Summary

By using stripPointerCasts we can get to the root
value and then walk down the bitcast graph

Diff Detail

Repository
rL LLVM

Event Timeline

Prazek updated this revision to Diff 82738.Dec 30 2016, 11:39 AM
Prazek retitled this revision from to [MemDep] NFC walk invariant.group graph only down.
Prazek updated this object.
Prazek added a reviewer: reames.
Prazek added a subscriber: llvm-commits.
reames requested changes to this revision.Dec 30 2016, 12:22 PM
reames edited edge metadata.
reames added inline comments.
lib/Analysis/MemoryDependenceAnalysis.cpp
367 ↗(On Diff #82738)

Don't you need to check this before the loop? (i.e. why did this become an assert rather than a test?)

381 ↗(On Diff #82738)

Wasn't this comment in the other change you landed?

This revision now requires changes to proceed.Dec 30 2016, 12:22 PM
Prazek marked an inline comment as done.Dec 30 2016, 2:04 PM

BTW I think I also don't need SeenOperands set now because there is no way I could insert the same operand twice

lib/Analysis/MemoryDependenceAnalysis.cpp
367 ↗(On Diff #82738)

Good catch. There is check for GlobalValue on beginning of the function, but it check for pointerOperand.
So if I will check pointer after stripping, then this will be valid. I will write test for that.

381 ↗(On Diff #82738)

I just moved it from line 372

Prazek updated this revision to Diff 82747.Dec 30 2016, 3:00 PM
Prazek edited edge metadata.
Prazek marked an inline comment as done.
  • fixes
Prazek marked 3 inline comments as done.Jan 3 2017, 4:24 AM

ping

davide added a subscriber: davide.Jan 3 2017, 4:33 AM
davide added inline comments.
lib/Analysis/MemoryDependenceAnalysis.cpp
359 ↗(On Diff #82747)

Any reason why did you change the initial size of the SmallVector?

test/Transforms/GVN/invariant.group.ll
372–393 ↗(On Diff #82747)

ideally the checks should be auto-generated (many people, me included forget to do so)

Prazek added inline comments.Jan 3 2017, 5:18 AM
lib/Analysis/MemoryDependenceAnalysis.cpp
359 ↗(On Diff #82747)

I deleted SmallSet of 14 elements, so I thought I can be more lavish here :)

test/Transforms/GVN/invariant.group.ll
372–393 ↗(On Diff #82747)

Excuse me, but I don't understand your comment. Is there anything wrong with my patch, or is it just comment about the perfect world?

Prazek added inline comments.Jan 3 2017, 5:21 AM
lib/Analysis/MemoryDependenceAnalysis.cpp
359 ↗(On Diff #82747)

8 would be probably still enough, I never did any measurements, so if you would like, I can change it back to 8

davide added inline comments.Jan 3 2017, 6:10 AM
lib/Analysis/MemoryDependenceAnalysis.cpp
359 ↗(On Diff #82747)

I think we can leave it as is. In case the malloc traffic hints we should choose a larger value, fair enough, but I wouldn't change without backing data/real justification :)

test/Transforms/GVN/invariant.group.ll
372–393 ↗(On Diff #82747)

You may want to run utils/update_test_checks.py on this to autogenerate checks.

Prazek updated this revision to Diff 82878.Jan 3 2017, 6:28 AM
Prazek marked 4 inline comments as done.
Prazek edited edge metadata.
  • fixes
davide accepted this revision.Jan 3 2017, 6:30 AM
davide added a reviewer: davide.

LGTM, please wait if somebody has remaining comments.

Prazek added inline comments.Jan 3 2017, 6:31 AM
test/Transforms/GVN/invariant.group.ll
372–393 ↗(On Diff #82747)

I still don't understand what this script is doing. I runned it, and it only reformatted test (reduced indentation), but non of the check comments have been changed

Prazek added a comment.Jan 5 2017, 1:05 PM

Philip, do you want to check it last time?

This revision was automatically updated to reflect the committed changes.