This is an archive of the discontinued LLVM Phabricator instance.

[ubsan] Skip alignment checks which are folded away
ClosedPublic

Authored by vsk on Sep 6 2017, 5:27 PM.

Details

Summary

Don't emit alignment checks which the IR constant folder throws away.

I've tested this out on X86FastISel.cpp. While this doesn't decrease
end-to-end compile-time significantly, it results in 122 fewer type
checks (1% reduction) overall, without adding any real complexity.

Diff Detail

Repository
rL LLVM

Event Timeline

vsk created this revision.Sep 6 2017, 5:27 PM
arphaman edited edge metadata.Sep 18 2017, 3:44 AM

It looks like this test passes prior to the code change in this patch. Can you please change the test?

vsk updated this revision to Diff 115879.Sep 19 2017, 12:02 PM
  • Use a better test case. This one was lifted from an actual example in X86CallingConv.h:86.

This one passes for me too without the code change.

vsk added a comment.Sep 22 2017, 10:53 AM

Sorry, I see the issue now. The pre-patch IR looked like "br i1 true, label %continue, label %diagnose", so there was no alignment check, per-se.

vsk updated this revision to Diff 116374.Sep 22 2017, 10:54 AM
  • Tighten up lit test.
This revision is now accepted and ready to land.Sep 22 2017, 11:17 AM
This revision was automatically updated to reflect the committed changes.