Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
Clear modules vector so that destructure does not try to
delete these modules again. Patch by Chandler Carruth.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33017 91177308-0d34-0410-b5e6-96231b3b80d8
as the jit intercepts exit calls to implement atexit handlers. This
fixes SingleSource/UnitTests/2003-05-14-AtExit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33008 91177308-0d34-0410-b5e6-96231b3b80d8
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
Solve several related problems by making variable names more unique and
dealing with recursive phi nodes. Unfortunately, this doesn't solve the
main issue reported in the PR, but its a step in that direction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32953 91177308-0d34-0410-b5e6-96231b3b80d8
Emit the correct syntax for icmp and fcmp constant expressions. The
predicate goes outside the parentheses not inside. This was a change made
in the assembler without the corresponding change made in llvm-upgrade.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32942 91177308-0d34-0410-b5e6-96231b3b80d8
file so make it depend on the .y file as well. This ensures that in
parallel builds the lexer is built after bison runs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32937 91177308-0d34-0410-b5e6-96231b3b80d8
1. Completely revise the type system so that types are handled as const
objects and not created multiple times, cloned, or otherwise copied.
This gets around memory issues, saves memory, and also emulates LLVM's
no-two-types-of-the-same-shape-created semantics.
2. Adjust the handling of global names. Basically, we cannot rename them
for a variety of reasons: linking, forward references, etc.
3. Detect global names that have name conflicts as the result of collapsed
type planes or redefinitions that llvm-as no longer accepts. These will
produce warnings on stderr and one of the globals will be renamed.
4. Rename ParserInternals.h as UpgradeInternals.h so it doesn't conflict
in the debugger with ParserInternals.h from lib/AsmParser.
5. Move the guts of the TypeInfo class into the grammar so we aren't
implementing large functions in a header file. This also helps with
debugging a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32906 91177308-0d34-0410-b5e6-96231b3b80d8
by correctly handling up references and enumerated types. Previously there
was some confusion of these two. Thanks to Chris Lattner for demistifying
llvm up references.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32846 91177308-0d34-0410-b5e6-96231b3b80d8
Revise the upgrade parser to keep track of types more faithfully and use
this information to resolve name conflicts resulting from collapsed type
planes. The type planes have collapsed because the integer types are now
signless so that uint and int became i32. Where two planes existed for uint
and int, only i32 exists. Any variable names depending on the type planes
to pmake the identifier unique would cause a conflict. This patch resolves
that conflict for many but not all cases.
Situations involving the integer types and pointers to them are handled
by this patch. However, there are corner cases that are not handled
well, such as:
%t1 = type { uint, int }
%t2 = type { int, uint }
void %myfunc(%t1* one, %t2* two) {
%var = load %t1* one
%var = load %t2* two
}
In the scenario above, %t1 and %t2 are really the same type: { i32, i32 }
Consequently attempting to name %var twice will yield a redefinition error
when assembled.
While this patch is sufficien to allow the llvm/test suite to pass, More
work needs to be to complete the handling of these corner cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32810 91177308-0d34-0410-b5e6-96231b3b80d8
Don't attempt to parse both the old and new grammars. It is near impossible
to get it right. Remove support for the new define keyword and don't
attempt to insert parameter attributes because there isn't enough
contextual information for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32784 91177308-0d34-0410-b5e6-96231b3b80d8
Fix several bugs and update for new assembly syntax. Changes made include:
1. Fixing rules for icmp/fcmp instructions to not require a closing paren
at the end. This was a cut-and-paste error from a previous commit.
2. Changing things like Out << " " to Out << ' '
3. Adding the "define" keyword for function definitions
4. Adding support for packed structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32771 91177308-0d34-0410-b5e6-96231b3b80d8
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
Keep track of global constant and variable definitions for eventual use
in resolving conflicts between global and local symbol usage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32234 91177308-0d34-0410-b5e6-96231b3b80d8
div -> fdiv/udiv/sdiv
rem -> frem/urem/srem
except -> unwind
uninitialized -> external
as well as tracking the element type of pointers, packed, and array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32127 91177308-0d34-0410-b5e6-96231b3b80d8
formatting and spacing bugs. This is sufficient for llvm-upgrade to
correctly upgrade all of llvm/test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32114 91177308-0d34-0410-b5e6-96231b3b80d8
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31990 91177308-0d34-0410-b5e6-96231b3b80d8
append "exit <retcode>" to the end of the output file. This is used by
the nightly tester to make bugpoint match the output generated by the
RunSafely.sh script so it doesn't find false positives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31960 91177308-0d34-0410-b5e6-96231b3b80d8
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
Remove predicate simplifier from default gcc3 pipeline. New design is too
slow to enable by default.
Add new testcases for problems encountered in development.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31895 91177308-0d34-0410-b5e6-96231b3b80d8
Fix an infinite loop in the Linker and a few other assorted link problems.
Patch contributed by Scott Michel. Thanks, Scott!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31680 91177308-0d34-0410-b5e6-96231b3b80d8
speed up, it sometimes makes it crash on complex bc files, which isn't very nice.
With this, bugpoint can reduce the 176.gcc failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31589 91177308-0d34-0410-b5e6-96231b3b80d8
miscompilation. This is useful for working around GCC+CBE bugs or for handling
programs that CBE doesn't support (e.g. inline asm) when searching for
optimizer bugs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31588 91177308-0d34-0410-b5e6-96231b3b80d8
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
initializers as well. This is only a first pass. It can be slow because
it clones the module for each pass. An obvious improvement is not to do that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31182 91177308-0d34-0410-b5e6-96231b3b80d8
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8