This is an archive of the discontinued LLVM Phabricator instance.

Do not use template for check{Int,UInt,IntUInt,Alignment}.
ClosedPublic

Authored by ruiu on Mar 29 2018, 1:55 PM.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Mar 29 2018, 1:55 PM

The nice thing about the template parameters is that it forces the compiler to see the constant value.

It is quite possible that gcc and clang optimize this, but we have to benchmark.

ruiu added a comment.Mar 29 2018, 2:09 PM

It is so trivial that I'm pretty sure that both gcc and clang can optimize it, but if you are in doubt, I can check for assembly.

ruiu added a comment.Mar 29 2018, 2:11 PM

(If you want me to do that....)

espindola accepted this revision.Mar 29 2018, 2:39 PM

Disassemble looks good.

LGTM

This revision is now accepted and ready to land.Mar 29 2018, 2:39 PM
This revision was automatically updated to reflect the committed changes.