This is an archive of the discontinued LLVM Phabricator instance.

DAGCombiner: Fix broken size check in isAlias
ClosedPublic

Authored by arsenm on May 31 2016, 5:14 PM.

Details

Reviewers
hfinkel
Summary

This should have been converting the size to bytes, but wasn't really.
These should probably all be using getStoreSize instead.

I haven't been able to come up with a meaningful testcase for this.
I can trigger it using combinations of struct loads and stores,
but can't observe a difference in non-broken testcases.

isAlias is only really used during store merging, so I'm not sure how
to get into the vector splitting situation the comment describes
since store merging is only done before type legalization.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 59159.May 31 2016, 5:14 PM
arsenm retitled this revision from to DAGCombiner: Fix broken check in isAlias.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
arsenm retitled this revision from DAGCombiner: Fix broken check in isAlias to DAGCombiner: Fix broken size check in isAlias.May 31 2016, 5:16 PM
hfinkel accepted this revision.May 31 2016, 5:22 PM
hfinkel added a reviewer: hfinkel.
hfinkel added a subscriber: hfinkel.

LGTM

Can you open a PR against Clang here? We should warn on this, the term (the boolean, 1 or 0, shifted right by three) is always zero. I assume the general warning here is considering the boolean to be a byte in size for some reason.

This revision is now accepted and ready to land.May 31 2016, 5:22 PM

LGTM

Can you open a PR against Clang here? We should warn on this, the term (the boolean, 1 or 0, shifted right by three) is always zero. I assume the general warning here is considering the boolean to be a byte in size for some reason.

Specifically, I would have expected this warning:

/tmp/f.c:2:12: warning: shift count >= width of type [-Wshift-count-overflow]
  return a >> 48;
           ^  ~~
1 warning generated.

$ cat /tmp/f.c 
int test(int a) {
  return a >> 48;
}