-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Signless Types For LLVM #1322
Comments
Basic Work Plan: Each item below will be considered an iteration. An iteration consists of making The iterations planned are the following (in roughly this order):
|
For the SETCC instruction, we envision using a 4-bit code to specify the ULGE Mneumonic Semantics Description |
please consider using the table from SelectionDAGNodes.h, which is more complete. -Chris |
The table suggested by Chris is: The bit mnemonics are: NULGE Opcode Description |
Another idea: It probably makes sense to split integer setcc and fp setcc, particularly if you're going to do One particularly nice aspect of this is that you can have different enums for the integer/fp setcc's, so that -Chris |
That's a good idea. So we would end up with two tables, like this: For Floating Point SetCC (FSETCC): NULGE Opcode Description For Integer SetCC (SETCC): LGE OpCode Description |
The integer table is right. The FP table wants to keep the 'undefined on unordered' bit though. -Chris |
Chris Wrote:
I don't understand. All the bits from the original table and the revised table |
you dropped: 1X001 SETEQ True if equal from the fp table. -Chris |
Ah, right, I was thinking we'd just use the integer codes for those cases but |
Another (potentially better) approach would be to start the flagging: add a flag to fsetcc that indicates that Actually, in retrospect, I think that starting small is the right way to go. Right now we have no way (at the -Chris |
Some proposals for the setcc instructions:
Make sense? Comments? |
Right, but the names of the mneumonics are things like "setlt", which sets the results based on a lt
I don't see this as being a big win, do you?
I think we need two, fset and iset (where cond is internally represented as flags, not as -Chris |
Note that the spec for vsetint and vsetfp (vector comparisons, returning a vector of bools), uses condition |
New GEP Rules:
|
New Plan for bc/asm upgrade: Due to the signless types changes necessary to auto-upgrade bc and asm files to llvm-dis1.9 < 1.9.bc | llvm-upgrade | llvm-as2.0 > 2.0.bc This avoids any need to provide backwards compatibility code in 2.0 in either |
We have a conflict with the YACC Grammar for ULT/ULE/UGT/UGE. The current Consequently, I'm going to leave ULT/ULE/UGT/UGE for ICMP with "unsigned" meaning. For FCMP, we'll use two prefixes: ORD and UNO so we would have: This should be clear enough for both humans and bison. Reid. |
hrm? It shouldn't be ambiguous, you just need to factor the grammar right. What are the relevant |
There may be ways around it, but I"d rather avoid the ambiguity. The question icmp ult ... either of those could be in error depending on the operands and it isn't clear I'd rather have the predicates be non-overlapping. If you have alternative |
Again, there should be no ambiguity. |
The disambiguation has been moved to the parser from the lexer. The predicate |
is this done? |
This has been implemented. |
Extended Description
Despite our best attempts, the LLVM type system somehow ended up too
high-level. No! How can it be so? Let me tell you.
The LLVM primitive integer types maintain a distinction between signed
and unsigned, when all we really want to know is the size of the data. This
extra information bloats the .bc files and in-memory IR with "noop" casts
(like int -> uint) and causes there to be redundancy in the LLVM language.
This redundancy in the language currently leads to horrible missed optimization
opportunities (particular in the indvars pass), but can even miss trivial
cases (i.e. not CSE'ing (X+4) with ((unsigned)X + 4), which produce the same
value). Another annoying thing is that 'int 1' and 'uint 1' both need to be
written out to the .bc file, which is more duplication and takes space.
As a side note, we also have three trivial bits of ugliness:
with S.
vary in size like C types do, depending on the target.
which is obviously untrue, but still people think that.
You can read more about this feature in Chris Lattner's LLVM Notes, at
http://nondot.org/~sabre/LLVMNotes/TypeSystemChanges.txt.
Since this is a fairly extensive change to LLVM, this bug will be used to track
the progress of the work as it proceeds.
The text was updated successfully, but these errors were encountered: