Skip to content

[ADT] Always use 32-bit size type for SmallVector with 16-bit elements #95536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 26, 2024

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Jun 14, 2024

SmallVector has a special case to allow vector of char to exceed 4 GB in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes SmallVector<MCPhysReg> more compact because MCPhysReg is
uint16_t.

SmallVector has a special case to allow vector of char to exceed 4 GB in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes SmallVector<MCPhysReg> more compact because MCPhysReg is
uint16_t.
@llvmbot
Copy link
Member

llvmbot commented Jun 14, 2024

@llvm/pr-subscribers-llvm-support

@llvm/pr-subscribers-llvm-adt

Author: Jay Foad (jayfoad)

Changes

SmallVector has a special case to allow vector of char to exceed 4 GB in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes SmallVector<MCPhysReg> more compact because MCPhysReg is
uint16_t.


Full diff: https://github.com/llvm/llvm-project/pull/95536.diff

1 Files Affected:

  • (modified) llvm/include/llvm/ADT/SmallVector.h (+1-2)
diff --git a/llvm/include/llvm/ADT/SmallVector.h b/llvm/include/llvm/ADT/SmallVector.h
index 09676d792dfeb..d7e889cc7b1e4 100644
--- a/llvm/include/llvm/ADT/SmallVector.h
+++ b/llvm/include/llvm/ADT/SmallVector.h
@@ -116,8 +116,7 @@ template <class Size_T> class SmallVectorBase {
 
 template <class T>
 using SmallVectorSizeType =
-    std::conditional_t<sizeof(T) < 4 && sizeof(void *) >= 8, uint64_t,
-                       uint32_t>;
+    std::conditional_t<sizeof(T) == 1, uintptr_t, uint32_t>;
 
 /// Figure out the offset of the first element.
 template <class T, typename = void> struct SmallVectorAlignmentAndSize {

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. To the best of my knowledge, the original motivation for this was specifically about the char/byte case, to support large binary blobs. If this is needed for other types, then we should have a mechanism to control it.

Copy link
Member

@kuhar kuhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some tests for common types like char, int16_t, etc. (e.g., using std::is_same_v<T1, T2>)

@jayfoad
Copy link
Contributor Author

jayfoad commented Jun 15, 2024

Please add some tests for common types like char, int16_t, etc. (e.g., using std::is_same_v<T1, T2>)

There were already some static_asserts for this kind of thing. I added one for int16_t.

@jayfoad jayfoad merged commit 2582d11 into llvm:main Jun 26, 2024
5 of 6 checks passed
@jayfoad jayfoad deleted the smallvector-16-bit branch June 26, 2024 20:48
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-darwin running on doug-worker-3 while building llvm at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/398

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
54.104 [5597/12/186] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Record.cpp.o
54.498 [5596/12/187] Building CXX object utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/IntrinsicEmitter.cpp.o
55.096 [5595/12/188] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/Option.cpp.o
55.120 [5594/12/189] Building CXX object lib/Bitstream/Reader/CMakeFiles/LLVMBitstreamReader.dir/BitstreamReader.cpp.o
55.152 [5593/12/190] Linking CXX static library lib/libLLVMBitstreamReader.a
55.538 [5592/12/191] Building CXX object utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/DirectiveEmitter.cpp.o
55.809 [5591/12/192] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/ArgList.cpp.o
55.886 [5590/12/193] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o
55.924 [5589/12/194] Linking CXX static library lib/libLLVMTableGen.a
56.087 [5588/12/195] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-no_warn_duplicate_libraries utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/TableGen.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/Attributes.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/DirectiveEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/IntrinsicEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/VTEmitter.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,@loader_path/../lib  lib/libLLVMSupport.a  lib/libLLVMTableGen.a  lib/libLLVMSupport.a  -lm  /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libz.tbd  /usr/local/lib/libzstd.dylib  lib/libLLVMDemangle.a && :
Undefined symbols for architecture x86_64:
  "llvm::SmallVectorBase<unsigned long>::grow_pod(void*, unsigned long, unsigned long)", referenced from:
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
57.136 [5588/11/196] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFError.cpp.o
57.372 [5588/10/197] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFCommon.cpp.o
57.847 [5588/9/198] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CodeViewError.cpp.o
57.896 [5588/8/199] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MappedBlockStream.cpp.o
58.109 [5588/7/200] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/AppendingTypeTableBuilder.cpp.o
58.381 [5588/6/201] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/OptTable.cpp.o
58.553 [5588/5/202] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFBuilder.cpp.o
58.627 [5588/4/203] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CodeViewRecordIO.cpp.o
59.182 [5588/3/204] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/ContinuationRecordBuilder.cpp.o
59.308 [5588/2/205] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CVSymbolVisitor.cpp.o

@dyung
Copy link
Collaborator

dyung commented Jun 26, 2024

LLVM Buildbot has detected a new failure on builder llvm-clang-x86_64-darwin running on doug-worker-3 while building llvm at step 5 "build-unified-tree".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/23/builds/398

Here is the relevant piece of the build log for the reference:

Step 5 (build-unified-tree) failure: build (failure)
...
54.104 [5597/12/186] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/Record.cpp.o
54.498 [5596/12/187] Building CXX object utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/IntrinsicEmitter.cpp.o
55.096 [5595/12/188] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/Option.cpp.o
55.120 [5594/12/189] Building CXX object lib/Bitstream/Reader/CMakeFiles/LLVMBitstreamReader.dir/BitstreamReader.cpp.o
55.152 [5593/12/190] Linking CXX static library lib/libLLVMBitstreamReader.a
55.538 [5592/12/191] Building CXX object utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/DirectiveEmitter.cpp.o
55.809 [5591/12/192] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/ArgList.cpp.o
55.886 [5590/12/193] Building CXX object lib/TableGen/CMakeFiles/LLVMTableGen.dir/TGParser.cpp.o
55.924 [5589/12/194] Linking CXX static library lib/libLLVMTableGen.a
56.087 [5588/12/195] Linking CXX executable bin/llvm-min-tblgen
FAILED: bin/llvm-min-tblgen 
: && /usr/bin/clang++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk -Wl,-search_paths_first -Wl,-headerpad_max_install_names -Wl,-dead_strip -Wl,-no_warn_duplicate_libraries utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/CodeGenIntrinsics.cpp.o utils/TableGen/Basic/CMakeFiles/obj.LLVMTableGenBasic.dir/SDNodeProperties.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/TableGen.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/ARMTargetDefEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/Attributes.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/DirectiveEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/IntrinsicEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/RISCVTargetDefEmitter.cpp.o utils/TableGen/CMakeFiles/llvm-min-tblgen.dir/VTEmitter.cpp.o -o bin/llvm-min-tblgen  -Wl,-rpath,@loader_path/../lib  lib/libLLVMSupport.a  lib/libLLVMTableGen.a  lib/libLLVMSupport.a  -lm  /Library/Developer/CommandLineTools/SDKs/MacOSX14.4.sdk/usr/lib/libz.tbd  /usr/local/lib/libzstd.dylib  lib/libLLVMDemangle.a && :
Undefined symbols for architecture x86_64:
  "llvm::SmallVectorBase<unsigned long>::grow_pod(void*, unsigned long, unsigned long)", referenced from:
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      llvm::detail::IEEEFloat::toString(llvm::SmallVectorImpl<char>&, unsigned int, unsigned int, bool) const in libLLVMSupport.a[13](APFloat.cpp.o)
      ...
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
57.136 [5588/11/196] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFError.cpp.o
57.372 [5588/10/197] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFCommon.cpp.o
57.847 [5588/9/198] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CodeViewError.cpp.o
57.896 [5588/8/199] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MappedBlockStream.cpp.o
58.109 [5588/7/200] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/AppendingTypeTableBuilder.cpp.o
58.381 [5588/6/201] Building CXX object lib/Option/CMakeFiles/LLVMOption.dir/OptTable.cpp.o
58.553 [5588/5/202] Building CXX object lib/DebugInfo/MSF/CMakeFiles/LLVMDebugInfoMSF.dir/MSFBuilder.cpp.o
58.627 [5588/4/203] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CodeViewRecordIO.cpp.o
59.182 [5588/3/204] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/ContinuationRecordBuilder.cpp.o
59.308 [5588/2/205] Building CXX object lib/DebugInfo/CodeView/CMakeFiles/LLVMDebugInfoCodeView.dir/CVSymbolVisitor.cpp.o

This failure also happened on my other mac buildbot https://lab.llvm.org/buildbot/#/builders/190/builds/750

It didn't get automatically flagged because the host machine ran out of disk space which I am fixing up now.

@BertalanD
Copy link
Member

In SmallVectorSizeType's definition, size_t or uint32_t is used:

template <class T>
using SmallVectorSizeType =
std::conditional_t<sizeof(T) == 1, size_t, uint32_t>;

But the grow_pod function is instantiated for uint64_t or uint32_t:

template class llvm::SmallVectorBase<uint32_t>;
// Disable the uint64_t instantiation for 32-bit builds.
// Both uint32_t and uint64_t instantiations are needed for 64-bit builds.
// This instantiation will never be used in 32-bit builds, and will cause
// warnings when sizeof(Size_T) > sizeof(size_t).
#if SIZE_MAX > UINT32_MAX
template class llvm::SmallVectorBase<uint64_t>;

On the arm64 Apple ABI, size_t == unsigned long and uint64_t == unsigned long long.

@chelcassanova
Copy link
Contributor

This is also breaking the GreenDragon macOS buildbots: https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/6522/console

@kuhar
Copy link
Member

kuhar commented Jun 26, 2024

Revert?

@chelcassanova
Copy link
Contributor

Sure, just to unblock the bots while this gets looked into.

chelcassanova added a commit that referenced this pull request Jun 26, 2024
arsenm pushed a commit that referenced this pull request Jun 27, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jun 27, 2024
arsenm pushed a commit that referenced this pull request Jun 27, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jun 27, 2024
arsenm pushed a commit that referenced this pull request Jun 28, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jun 28, 2024
arsenm pushed a commit that referenced this pull request Jul 2, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jul 2, 2024
arsenm pushed a commit that referenced this pull request Jul 3, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jul 3, 2024
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
llvm#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
lravenclaw pushed a commit to lravenclaw/llvm-project that referenced this pull request Jul 3, 2024
arsenm pushed a commit that referenced this pull request Jul 3, 2024
#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
arsenm pushed a commit that referenced this pull request Jul 3, 2024
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
llvm#95536)

`SmallVector` has a special case to allow vector of char to exceed 4 GB
in
size on 64-bit hosts. Apply this special case only for 8-bit element
types, instead of all element types < 32 bits.

This makes `SmallVector<MCPhysReg>` more compact because `MCPhysReg` is
`uint16_t`.

---------

Co-authored-by: Nikita Popov <[email protected]>
AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants