]> granicus.if.org Git - clang/commit
IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to use new...
authorDaniel Dunbar <daniel@zuster.org>
Thu, 15 Apr 2010 03:47:33 +0000 (03:47 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 15 Apr 2010 03:47:33 +0000 (03:47 +0000)
commit2677261656b2f3325218d38bdd9d102ad732da92
tree16880ea4721f0c6ed0011ba7ae33598905f8afea
parente57aa9e367af227214140e1a174cc561aabaa0b9
IRgen: (Reapply 101222, with fixes) Move EmitStoreThroughBitfieldLValue to use new CGBitfieldInfo::AccessInfo decomposition, instead of computing the access policy itself.
 - Sadly, this doesn't seem to give any .ll size win so far. It is possible to make this routine significantly smarter & avoid various shifting, masking, and zext/sext, but I'm not really convinced it is worth it. It is tricky, and this is really instcombine's job.

 - No intended functionality change; the test case is just to increase coverage & serves as a demo file, it worked before this commit.

The new fixes from r101222 are:

 1. The shift to the target position needs to occur after the value is extended to the correct size. This broke Clang bootstrap, among other things no doubt.

 2. Swap the order of arguments to OR, to get a tad more constant folding.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@101339 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGExpr.cpp
test/CodeGen/bitfield-2.c [new file with mode: 0644]