[all-commits] [llvm/llvm-project] 2fd180: [IR] Reduce max supported integer from 2^24-1 to 2...

Craig Topper via All-commits all-commits at lists.llvm.org
Tue Sep 14 08:12:02 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2fd180bbb9a7bb8604a5aca31f1ca9dc5358a433
      https://github.com/llvm/llvm-project/commit/2fd180bbb9a7bb8604a5aca31f1ca9dc5358a433
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-09-14 (Tue, 14 Sep 2021)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/test/CodeGen/ext-int.c
    M clang/test/CodeGenCXX/ext-int.cpp
    M clang/test/SemaCXX/ext-int.cpp
    M llvm/docs/LangRef.rst
    M llvm/docs/ReleaseNotes.rst
    M llvm/include/llvm/IR/DerivedTypes.h
    M llvm/test/Assembler/invalid-inttype.ll
    M llvm/test/Assembler/max-inttype.ll

  Log Message:
  -----------
  [IR] Reduce max supported integer from 2^24-1 to 2^23.

SelectionDAG will promote illegal types up to a power of 2 before
splitting down to a legal type. This will create an IntegerType
with a bit width that must be <= MAX_INT_BITS. This places an
effective upper limit on any type of 2^23 so that we don't try
create a 2^24 type.

I considered putting a fatal error somewhere in the path from
TargetLowering::getTypeConversion down to IntegerType::get, but
limiting the type in IR seemed better.

This breaks backwards compatibility with IR that is using a really
large type. I suspect such IR is going to be very rare due to the
the compile time costs such a type likely incurs.

Prevents the ICE in PR51829.

Reviewed By: efriedma, aaron.ballman

Differential Revision: https://reviews.llvm.org/D109721




More information about the All-commits mailing list