diff options
| author | Justin Bogner <mail@justinbogner.com> | 2014-08-14 15:44:29 +0000 |
|---|---|---|
| committer | Justin Bogner <mail@justinbogner.com> | 2014-08-14 15:44:29 +0000 |
| commit | 085c4b294b6439175f5ebf150e2be09c5cef9d37 (patch) | |
| tree | f30585e5c4f80b560061c7f63375176acaafb799 /clang/lib/CodeGen | |
| parent | 11ab9416445cfe62602a4bd0d8503d95c96e5857 (diff) | |
| download | bcm5719-llvm-085c4b294b6439175f5ebf150e2be09c5cef9d37.tar.gz bcm5719-llvm-085c4b294b6439175f5ebf150e2be09c5cef9d37.zip | |
Revert "CodeGen: When bitfields fall on natural boundaries, split them up"
It fits better with LLVM's memory model to try to do this in the
backend. Specifically, narrowing wide loads in the backends should be
relatively straightforward and is generally valuable, whereas widening
loads tends to be very constrained.
Discussion here:
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20140811/112581.html
This reverts commit r215614.
llvm-svn: 215648
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGRecordLayoutBuilder.cpp | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp index 06192bd2eea..a10d8e791b0 100644 --- a/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/clang/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -377,10 +377,6 @@ CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, } return; } - - llvm::Type *WordType = - DataLayout.getLargestLegalIntType(Types.getLLVMContext()); - uint64_t WordSize = WordType ? DataLayout.getTypeSizeInBits(WordType) : 0; for (;;) { // Check to see if we need to start a new run. if (Run == FieldEnd) { @@ -396,12 +392,9 @@ CGRecordLowering::accumulateBitFields(RecordDecl::field_iterator Field, ++Field; continue; } - // Add bitfields to the run as long as they qualify. If we end up on a word - // boundary we insert a break since it's equivalent and very wide types are - // harder to optimize with. + // Add bitfields to the run as long as they qualify. if (Field != FieldEnd && Field->getBitWidthValue(Context) != 0 && - Tail == getFieldBitOffset(*Field) && - WordSize != Tail - StartBitOffset) { + Tail == getFieldBitOffset(*Field)) { Tail += Field->getBitWidthValue(Context); ++Field; continue; |

