1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

85882 Commits

Author SHA1 Message Date
Benjamin Kramer
d97f445bdf Revert r166390 "LoopIdiom: Replace custom dependence analysis with LoopDependenceAnalysis."
It passes all tests, produces better results than the old code but uses the
wrong pass, LoopDependenceAnalysis, which is old and unmaintained. "Why is it
still in tree?", you might ask. The answer is obviously: "To confuse developers."

Just swapping in the new dependency pass sends the pass manager into an infinte
loop, I'll try to figure out why tomorrow.

llvm-svn: 166399
2012-10-21 19:31:16 +00:00
Jakob Stoklund Olesen
600ff2e59e Don't crash when the Assignments vector is empty.
Reported by Vincent Lejeune using an out-of-tree target.

llvm-svn: 166398
2012-10-21 19:05:03 +00:00
Anders Carlsson
d04e66ae01 Avoid an extra hash lookup when inserting a value into the widen map.
llvm-svn: 166395
2012-10-21 16:26:35 +00:00
Jakub Staszak
a477da32fc Simplify code. No functionality change.
llvm-svn: 166393
2012-10-21 15:36:03 +00:00
Jakub Staszak
ed5ec60053 Simplify code. No functionality change.
llvm-svn: 166392
2012-10-21 15:29:19 +00:00
Benjamin Kramer
7d87bba7c4 LoopIdiom: Replace custom dependence analysis with LoopDependenceAnalysis.
Requires a lot less code and complexity on loop-idiom's side and the more
precise analysis can catch more cases, like the one I included as a test case.
This also fixes the edge-case miscompilation from PR9481. I'm not entirely
sure that all cases are handled that the old checks handled but LDA will
certainly become smarter in the future.

llvm-svn: 166390
2012-10-21 15:03:07 +00:00
Nadav Rotem
380fe201de Fix a bug in the vectorization of wide load/store operations.
We used a SCEV to detect that A[X] is consecutive. We assumed that X was
the induction variable. But X can be any expression that uses the induction
for example: X = i + 2;

llvm-svn: 166388
2012-10-21 06:49:10 +00:00
Nadav Rotem
825cda19d5 Add support for reduction variables that do not start at zero.
This is important for nested-loop reductions such as :

In the innermost loop, the induction variable does not start with zero:

for (i = 0 .. n)
 for (j = 0 .. m)
  sum += ...

llvm-svn: 166387
2012-10-21 05:52:51 +00:00
Nadav Rotem
5ab04af30a Document change. Describe the pass and some papers that inspired the design of the pass.
llvm-svn: 166386
2012-10-21 04:04:25 +00:00
Nadav Rotem
763abacb83 Vectorizer: fix a bug in the classification of induction/reduction phis.
llvm-svn: 166384
2012-10-21 02:38:01 +00:00
Lang Hames
784ac6493a Allow the commuted form of tied-operand constraints in tablegen ("$dst = $src",
rather than "$src = $dst").

llvm-svn: 166382
2012-10-20 22:44:13 +00:00
Nadav Rotem
2ee8edf34a Fix an infinite loop in the loop-vectorizer.
PR14134.

llvm-svn: 166379
2012-10-20 20:45:01 +00:00
Dmitri Gribenko
f01cbf1125 Document current Doxygen use practices in Coding Standards. Mostly it is
obvious stuff and most new code being committed conforms to that.  Some old
code does not; this might cause confusion and this is the motivation to
document the correct guidelines.

llvm-svn: 166378
2012-10-20 13:27:43 +00:00
Benjamin Kramer
7808f22a33 Symbol hygiene: Make sure declarations and definitions match, make helper functions static.
llvm-svn: 166376
2012-10-20 12:53:26 +00:00
Benjamin Kramer
7e11b31d39 SROA: Simplify code. No functionality change.
llvm-svn: 166375
2012-10-20 12:04:57 +00:00
Benjamin Kramer
f3ac3fa22b InstCombine: Fix an edge case where constant icmps could sneak into ConstantFoldInstOperands and crash.
Have to refactor the ConstantFolder interface one day to define bugs like this away. Fixes PR14131.

llvm-svn: 166374
2012-10-20 08:43:52 +00:00
Nadav Rotem
cdd573e703 Vectorize: teach cavVectorizeMemory to distinguish between A[i]+=x and A[B[i]]+=x.
If the pointer is consecutive then it is safe to read and write. If the pointer is non-loop-consecutive then
it is unsafe to vectorize it because we may hit an ordering issue.

llvm-svn: 166371
2012-10-20 08:26:33 +00:00
Nadav Rotem
762317ecc6 Fix a typo
llvm-svn: 166367
2012-10-20 05:03:27 +00:00
Nadav Rotem
4e013454ca Vectorizer: refactor the memory checks to a new function. No functionality change.
llvm-svn: 166366
2012-10-20 04:59:06 +00:00
Nadav Rotem
33b2c76073 Vectorization docs.
llvm-svn: 166364
2012-10-20 02:34:34 +00:00
Chad Rosier
f81bc67275 [ms-inline asm] Rename AsmOpRewrite to just AsmRewrite to be more generic. No functional change intended.
llvm-svn: 166360
2012-10-20 01:02:45 +00:00
Chad Rosier
be98459bfd [ms-inline asm] If the state of the parser is ignore, then don't parse the
inline assembly.  Also make sure the remove the ignored statements from the IR.

llvm-svn: 166357
2012-10-20 00:47:08 +00:00
Nadav Rotem
61a5b018ad LoopVectorize: Keep the IRBuilder on the stack.
llvm-svn: 166354
2012-10-19 23:27:19 +00:00
Chad Rosier
03179afe79 [ms-inline asm] Continue parsing even when we're in an ignore block.
llvm-svn: 166352
2012-10-19 23:15:00 +00:00
Nadav Rotem
8fe03aa4c1 Vectorizer: Add support for loop reductions.
For example:

  for (i=0; i<n; i++)
   sum += A[i] +  B[i] + i;

llvm-svn: 166351
2012-10-19 23:05:40 +00:00
Shuxin Yang
d8a190a17c 1. Remove noreturn attribute from __builtin_debugtrap().
(The change at Clang side was committed in r166345)

2. Cosmetic change in order to conform to coding standards. 

llvm-svn: 166350
2012-10-19 23:00:20 +00:00
Chad Rosier
3d1b58e0f9 [ms-inline asm] Reset the opcode prior to parsing a statement.
llvm-svn: 166349
2012-10-19 22:57:33 +00:00
Akira Hatanaka
5439c43726 [mips] Use 64-bit registers to return an sret pointer if target ABI is N64.
llvm-svn: 166344
2012-10-19 22:11:40 +00:00
Eric Christopher
42faa398e7 Grammar-o.
llvm-svn: 166343
2012-10-19 22:10:54 +00:00
Akira Hatanaka
32235d5612 [mips] Add code to do tail call optimization.
Currently, it is enabled only if option "enable-mips-tail-calls" is given and
all of the callee's arguments are passed in registers.

llvm-svn: 166342
2012-10-19 21:47:33 +00:00
Akira Hatanaka
18ec43c9c2 [mips] Fix TAILCALL's operand node type.
llvm-svn: 166341
2012-10-19 21:30:15 +00:00
Nadav Rotem
13a468b929 revert r166264 because the LTO build is still failing
llvm-svn: 166340
2012-10-19 21:28:43 +00:00
Akira Hatanaka
d728ae0014 [mips] Delete MipsFunctionInfo::MaxCallFrameSize which is no longer used.
llvm-svn: 166339
2012-10-19 21:18:38 +00:00
Akira Hatanaka
54f6697369 [mips] Add tail call instructions.
llvm-svn: 166338
2012-10-19 21:14:34 +00:00
Akira Hatanaka
8198825482 [mips] Make the branch nodes used in jump instructions a template parameter.
llvm-svn: 166337
2012-10-19 21:11:03 +00:00
Akira Hatanaka
cfc486ced3 Add node and enum for mips tail call.
llvm-svn: 166318
2012-10-19 20:59:39 +00:00
Chad Rosier
b2e9c0e226 [ms-inline asm] Have the TargetParser callback to Sema to determine the size of
a memory operand.  Retain this information and then add the sizing directives
to the IR.  This allows the backend to do proper instruction selection.

llvm-svn: 166316
2012-10-19 20:57:14 +00:00
Michael Liao
432bf8dcf1 Add 'IntrNoReturn' for longjmp intrinsics
llvm-svn: 166314
2012-10-19 20:43:54 +00:00
Benjamin Kramer
0edfdde403 SimplifyLibcalls: The return value of ffsll is always i32, even when the input is zero.
Fixes PR13028.

llvm-svn: 166313
2012-10-19 20:43:44 +00:00
Micah Villmow
4dcbb3e605 Fix a build error for ocaml bindings that was introduced with the TargetData --> DataLayout changes.
llvm-svn: 166309
2012-10-19 20:36:22 +00:00
Chad Rosier
9de7b4647d [ms-inline asm] Add a MCAsmParserSemaCallback to the TargetAsmParser.
llvm-svn: 166308
2012-10-19 20:35:42 +00:00
Daniel Dunbar
7abcd13b24 lit: Rename the valgrind leaks feature to match what is currently used
(vg_leak).

llvm-svn: 166306
2012-10-19 20:29:30 +00:00
Daniel Dunbar
48d2376b89 lit: Remove support for XTARGET.
- The XTARGET feature (inherited from old DG tests) was just confusing (and
   barely ever used). The same effect can now be achieved with a combination of
   the more useful REQUIRES and XFAIL.

llvm-svn: 166305
2012-10-19 20:29:27 +00:00
Daniel Dunbar
4747331126 lit: Add 'valgrind' and 'valgrind-leaks' features when valgrind is used.
- These can be used with the XFAIL options.

llvm-svn: 166303
2012-10-19 20:12:00 +00:00
Daniel Dunbar
9d930b0d06 tests: Stop mangling '-vg' into the triple, we don't use this currently.
- Also, lit is going to get a valgrind feature, instead.

llvm-svn: 166302
2012-10-19 20:11:56 +00:00
Shuxin Yang
3ad15929e7 This patch is to fix radar://8426430. It is about llvm support of __builtin_debugtrap()
which is supposed to consistently raise SIGTRAP across all systems. In contrast,
__builtin_trap() behave differently on different systems. e.g. it raises SIGTRAP on ARM, and
SIGILL on X86. The purpose of __builtin_debugtrap() is to consistently provide "trap"
functionality, in the mean time preserve the compatibility with on gcc on __builtin_trap().

  The X86 backend is already able to handle debugtrap(). This patch is to:
  1) make front-end recognize "__builtin_debugtrap()" (emboddied in the one-line change to Clang).
  2) In DAG legalization phase, by default, "debugtrap" will be replaced with "trap", which
     make the __builtin_debugtrap() "available" to all existing ports without the hassle of
     changing their code.
  3) If trap-function is specified (via -trap-func=xyz to llc), both __builtin_debugtrap() and
     __builtin_trap() will be expanded into the function call of the specified trap function.
    This behavior may need change in the future.

  The provided testing-case is to make sure 2) and 3) are working for ARM port, and we
already have a testing case for x86. 

llvm-svn: 166300
2012-10-19 20:11:16 +00:00
Chad Rosier
2f344f2453 [ms-inline asm] Add the isParsingInlineAsm() function to the MCAsmTargetParser.
llvm-svn: 166292
2012-10-19 17:57:49 +00:00
Benjamin Kramer
49175bcdcd Indvars: Don't recursively delete instruction during BB iteration.
This can invalidate the iterators leading to use after frees and crashes.
Fixes PR12536.

llvm-svn: 166291
2012-10-19 17:53:54 +00:00
Daniel Dunbar
05096e6a09 Fix some doc-os.
llvm-svn: 166290
2012-10-19 17:23:39 +00:00
Daniel Dunbar
b86f0140e9 lit: Propagate TERM variable in environment, some tools can do really obscure
odd things if this is missing.

llvm-svn: 166289
2012-10-19 17:23:34 +00:00