[lld] r188981 - [lld][Hexagon] Enable Hexagon sdata sorting test
Rui Ueyama
ruiu at google.com
Thu Aug 22 14:19:54 PDT 2013
On Wed, Aug 21, 2013 at 8:02 PM, Shankar Easwaran
<shankare at codeaurora.org>wrote:
> Author: shankare
> Date: Wed Aug 21 22:02:17 2013
> New Revision: 188981
>
> URL: http://llvm.org/viewvc/llvm-project?rev=188981&view=rev
> Log:
> [lld][Hexagon] Enable Hexagon sdata sorting test
>
> Modified:
> lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
> lld/trunk/test/elf/hexagon-quickdata-sortcommon.test
>
> Modified: lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h?rev=188981&r1=188980&r2=188981&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h
> (original)
> +++ lld/trunk/lib/ReaderWriter/ELF/Hexagon/HexagonSectionChunks.h Wed Aug
> 21 22:02:17 2013
> @@ -54,11 +54,18 @@ template <class HexagonELFType>
> void SDataSection<HexagonELFType>::doPreFlight() {
> // sort the atoms on the alignments they have been set
> std::stable_sort(this->_atoms.begin(), this->_atoms.end(),
> - [](const lld::AtomLayout * A, const lld::AtomLayout *
> B) {
> + [](const lld::AtomLayout * A,
> + const lld::AtomLayout *
> B) {
> const DefinedAtom *definedAtomA = cast<DefinedAtom>(A->_atom);
> const DefinedAtom *definedAtomB = cast<DefinedAtom>(B->_atom);
> int64_t align2A = 1 << definedAtomA->alignment().powerOf2;
> int64_t align2B = 1 << definedAtomB->alignment().powerOf2;
> + if (align2A == align2B) {
> + if (definedAtomA->merge() == DefinedAtom::mergeAsTentative)
> + return false;
> + if (definedAtomB->merge() == DefinedAtom::mergeAsTentative)
> + return true;
> + }
> return align2A < align2B;
> });
>
nit: you could have compared the shift amounts rather than the results of
shifted values.
Modified: lld/trunk/test/elf/hexagon-quickdata-sortcommon.test
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/test/elf/hexagon-quickdata-sortcommon.test?rev=188981&r1=188980&r2=188981&view=diff
>
> ==============================================================================
> --- lld/trunk/test/elf/hexagon-quickdata-sortcommon.test (original)
> +++ lld/trunk/test/elf/hexagon-quickdata-sortcommon.test Wed Aug 21
> 22:02:17 2013
> @@ -1,7 +1,6 @@
> RUN: lld -flavor gnu -target hexagon -o %t1 --noinhibit-exec \
> RUN: %p/Inputs/quickdata-sortcommon-test.o.elf-hexagon
> RUN: llvm-nm -n %t1 | FileCheck %s -check-prefix=quickdataSortCommon
> -XFAIL: *
>
> quickdataSortCommon: 00002000 D A1
> quickdataSortCommon: 00002001 D AA1
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130822/10376f90/attachment.html>
More information about the llvm-commits
mailing list