[PATCH] D109714: Reduce maximum width of _ExtInt from 2^24-1 to 2^23 to workaround SelectionDAG issue.

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 12:54:04 PDT 2021


aaron.ballman accepted this revision.
aaron.ballman added a comment.

LGTM modulo a request for some comments in the code. It makes me sad that we have a max number of bits specified by LLVM that's kinda useless. "You can store this many bits into this integer value, but if you attempt to add 0 to that value, it sometimes breaks" doesn't sound like a useful maximum. :-D



================
Comment at: clang/lib/Sema/SemaType.cpp:2272
 
-  if (NumBits > llvm::IntegerType::MAX_INT_BITS) {
-    Diag(Loc, diag::err_ext_int_max_size) << IsUnsigned
-                                          << llvm::IntegerType::MAX_INT_BITS;
+  int MaxBits = PowerOf2Floor(llvm::IntegerType::MAX_INT_BITS);
+  if (NumBits > MaxBits) {
----------------
I'd appreciate some extra comments here explaining why the max int bit width is insufficient.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D109714/new/

https://reviews.llvm.org/D109714



More information about the llvm-commits mailing list