Commit Graph

9337 Commits

Author SHA1 Message Date
Chris Lattner
8399e02a2c Fix volatile load/store of pointers. Consider this testcase:
void %test(int** %P) {
  %A = volatile load int** %P
  ret void
}

void %test2(int*** %Q) {
  %P = load int*** %Q
  volatile store int** %P, int*** %Q
  ret void
}

instead of emitting:

void test(int **l1_P) {
  int *l2_A;

  l2_A = (int **((volatile int **)l1_P));
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((volatile int ***)l2_Q) = l1_P;
  return;
}

... which is loading/storing volatile pointers, not through volatile pointers,
emit this (which is right):

void test(int **l1_P) {
  int *l3_A;

  l3_A = *((int * volatile*)l1_P);
  return;
}
void test2(int ***l2_Q) {
  int **l1_P;

  l1_P = *l2_Q;
  *((int ** volatile*)l2_Q) = l1_P;
  return;
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20191 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-15 05:52:14 +00:00
Chris Lattner
0798056b28 Fix a bug in my previous change to this, which broke the build on sparcs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20184 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 21:42:10 +00:00
Chris Lattner
27e192196f Print GEP offsets as signed values instead of unsigned values. On X86, this
prints:

getelementptr (int* %A, int -1)

as: "(A) - 4" instead of "(A) + 18446744073709551612", which makes the
assembler much happier.

This fixes test/Regression/CodeGen/X86/2005-02-14-IllegalAssembler.ll,
and Benchmarks/Prolangs-C/cdecl with LLC on X86.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20183 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 21:40:26 +00:00
Chris Lattner
8a7980b5ea Fix the second bug attached to PR504.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20181 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 20:11:45 +00:00
Chris Lattner
a92d12c053 Work around GCC PR19958, which causes programs to sometimes crash after
printing help output or version info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20180 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 19:17:29 +00:00
Misha Brukman
b70aaa62b6 Write out single characters as chars, not strings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20179 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 18:52:35 +00:00
Chris Lattner
9d30e22da0 Implement CodeGen/CBackend/2005-02-14-VolatileOperations.ll
Volatile loads and stores need to emit volatile pointer operations in C.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20177 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 16:47:52 +00:00
Andrew Lenharth
572af908e4 fix setcc on floats, fixes singlesource:pi, perhaps others
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20172 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-14 05:41:43 +00:00
Chris Lattner
550c57cb30 Fix the llvm bootstrap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20170 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 23:37:09 +00:00
Chris Lattner
45495c5248 Move helper function here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20168 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 23:13:47 +00:00
Chris Lattner
946af52687 If errno is zero strerror_r does not modify the buffer, leaving it unterminated.
This causes garbage to be printed out after error messages.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20165 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 22:46:37 +00:00
Reid Spencer
818827d734 Make the check for global variables the same as the one for functions. In
both cases they are looking for non-external variables/functions that do
not have internal linkage. Using "!isExternal()" is a little more
understandable than "hasInitializer()"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20155 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 18:12:20 +00:00
Chris Lattner
1117bb0e99 Nuke blank line.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20154 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 17:54:21 +00:00
Chris Lattner
12945acd4a Minor cleanup. No need to explicitly tell the compiler the template arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20153 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 17:50:16 +00:00
Chris Lattner
b52f1c2950 Make sure to clear the LazyFunctionLoadMap after we ParseAllFunctionBodies.
Otherwise, clients who call ParseAllFunctionBodies will attempt to parse
the function bodies twice, which is (uh) very very bad (tm).

This fixes gccld on python.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20152 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 17:48:18 +00:00
Chris Lattner
e5cea5eb89 Do not put internal symbols into the symbol table. This shrinks the symbol
table for archives in common cases, and prevents trying to resolve a
external reference with an internal reference.  This shrinks the libpython.a
symbol table from 126302 to 19770 bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20151 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 17:42:11 +00:00
Chris Lattner
50c301b9bb Print something useful for gccld -v with an archive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20148 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 15:26:14 +00:00
Chris Lattner
4dc534c7fe Correct the recursive PHI node handling routines in a way that CANNOT induce
infinite loops (using the new replaceSymbolicValuesWithConcrete method).

This patch reverts this patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20050131/023830.html

... which was an attempted fix for this problem.  Unfortunately, that patch
caused test/Regression/Transforms/IndVarsSimplify/exit_value_tests.llx to fail
and slightly castrated the entire analysis.  This patch fixes it right.

This patch is dedicated to jeffc, for making me deal with this.  :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20146 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-13 04:37:18 +00:00
Andrew Lenharth
093f32785b try to do better match for i32 adds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20143 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 21:11:17 +00:00
Andrew Lenharth
9b1e659cd6 make FP conversion more conservative (matches gcc)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20142 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 21:10:58 +00:00
Andrew Lenharth
7536eeabf6 oops, I was sure this had already gond though the nightly tester
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20141 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 20:42:09 +00:00
Andrew Lenharth
ebce50464a added sign extend for boolean
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20137 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 19:35:12 +00:00
Chris Lattner
e6f8c5a716 Allow globals to be of different const'nesses when we link.
This finally resolves PR502, PR450,
and test/Regression/Linker/2005-02-12-ConstantGlobals{,-2}.ll correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20135 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 19:20:28 +00:00
Chris Lattner
f6249261a9 Fix for testcase Transforms/IndVarsSimplify/2005-02-11-InvokeCrash.ll
and PR504.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20129 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-12 03:26:49 +00:00
Andrew Lenharth
3e31592dca fix a bunch of regressions due to call behavior
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20110 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 20:10:38 +00:00
Alkis Evlogimenos
f64ea9d122 Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20109 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 18:36:30 +00:00
Tanya Lattner
db40cf1b58 Added new circuit finding alogrithm.
Fixed bug in graph so that phi ite diff edges are added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20108 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 17:02:58 +00:00
Tanya Lattner
4bcb011f96 Allow modsched and local scheduling to both be run.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20107 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 17:02:06 +00:00
Andrew Lenharth
63f2ab2d1b so, if you beat on it, you too can talk emacs into having a sane indenting policy... Also, optimize many function calls with pc-relative calls (partial prologue skipping for that case coming soon), try to fix the random jumps to strange places problem by pesimizing div et. al. register usage and fixing up GP before using, some calling convention tweaks, and make frame pointer unallocatable (not strickly necessary, but let's go for correctness first)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20106 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 06:25:22 +00:00
Andrew Lenharth
3d261f5ae3 fix fp branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20105 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 05:17:38 +00:00
Misha Brukman
f5024ff76d * Fix spelling of `volatile'
* Align comments with tablegen elements


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20103 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-10 01:52:22 +00:00
Chris Lattner
3ac9605109 Don't print a 'Total Execution Time' line for the 'Miscellaneous Ungrouped
Timers' section.  Since these are random timers in the program it doesn't
make sense to sum them up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20090 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 18:41:32 +00:00
Chris Lattner
fe0343a1cd Fix test/Regression/Assembler/2005-02-09-AsmWriterStoreBug.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20089 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 17:45:03 +00:00
Chris Lattner
6be079491f Use new edge iterators to simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20086 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-09 03:20:43 +00:00
Andrew Lenharth
445171aaf6 BranchCC, nifty
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20067 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-08 00:40:03 +00:00
Andrew Lenharth
760270da51 fix store issue and an FP conversion (segfault) issue
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20066 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 23:02:23 +00:00
Chris Lattner
bcc70bcb25 IndCallGraphMap is now a pointer to a new'd map.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 16:09:15 +00:00
Andrew Lenharth
2921916ffc copytoreg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20063 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 06:31:44 +00:00
Andrew Lenharth
06342c3484 copyfromreg fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20062 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 06:21:37 +00:00
Andrew Lenharth
0382401356 fix load bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20061 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:55:55 +00:00
Andrew Lenharth
a549deb025 more FP load store fixes and Load store simplifications
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20060 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:33:15 +00:00
Andrew Lenharth
f311e8b901 clean up load and stores alot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20059 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:18:02 +00:00
Andrew Lenharth
0538034a82 teach all loads and stores about the stack
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20058 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-07 05:07:00 +00:00
Andrew Lenharth
2c9e38c285 prefer FP scratch registers and more check in LowerArguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20057 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 21:07:31 +00:00
Andrew Lenharth
6583890c2b fix oopso
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20056 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 16:22:15 +00:00
Andrew Lenharth
9e8d1094f2 smarter loads and stores. can now handle base+offset.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20055 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-06 15:40:40 +00:00
Andrew Lenharth
0bc68a87e7 fix build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20053 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 19:46:51 +00:00
Andrew Lenharth
97127a1391 clean up
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20051 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 17:41:39 +00:00
Andrew Lenharth
d4bdd548fc fix f32 setcc, and fp select
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20050 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 16:41:03 +00:00
Andrew Lenharth
9818c05bb8 added ugly support for fp compares
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20049 91177308-0d34-0410-b5e6-96231b3b80d8
2005-02-05 13:19:12 +00:00