[cfe-commits] PATCH: Large re-working of bitfield IR-gen, and a fix for PR13691

Chandler Carruth chandlerc at google.com
Tue Aug 28 10:18:09 PDT 2012


On Tue, Aug 28, 2012 at 10:13 AM, Sean Silva <silvas at purdue.edu> wrote:

> -class CGBitFieldInfo {
> -public:
> -  /// Descriptor for a single component of a bit-field access. The entire
> -  /// bit-field is constituted of a bitwise OR of all of the individual
> -  /// components.
> -  ///
> -  /// Each component describes an accessed value, which is how the
> component
> -  /// should be transferred to/from memory, and a target placement,
> which is how
> -  /// that component fits into the constituted bit-field. The pseudo-IR
> for a
> -  /// load is:
> -  ///
> -  ///   %0 = gep %base, 0, FieldIndex
> -  ///   %1 = gep (i8*) %0, FieldByteOffset
> -  ///   %2 = (i(AccessWidth) *) %1
> -  ///   %3 = load %2, align AccessAlignment
> -  ///   %4 = shr %3, FieldBitStart
> -  ///
> -  /// and the composed bit-field is formed as the boolean OR of all
> accesses,
> -  /// masked to TargetBitWidth bits and shifted to TargetBitOffset.
>
> Could you beef up the 2-liner comment you replaced this nice comment
> with to include the pseudo-IR for a bitfield access like this comment
> does? I think that's a very valuable piece of documentation to have.


Is it really a good idea to have this in the comment versus the tests? My
far is that the comment will slip out of date.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120828/9b2cf809/attachment.html>


More information about the cfe-commits mailing list