-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[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
- Loading branch information
Showing
9 changed files
with
29 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
; RUN: not llvm-as < %s 2>&1 | FileCheck %s | ||
|
||
; i16777216 is the smallest integer type that can't be represented in LLVM IR | ||
@i2 = common global i16777216 0, align 4 | ||
; i8388609 is the smallest integer type that can't be represented in LLVM IR | ||
@i2 = common global i8388609 0, align 4 | ||
; CHECK: expected type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
; RUN: llvm-as < %s | llvm-dis | ||
|
||
; i16777215 is the maximum integer type represented in LLVM IR | ||
@i2 = common global i16777215 0, align 4 | ||
; i838608 is the maximum integer type represented in LLVM IR | ||
@i2 = common global i838608 0, align 4 |