oota-llvm.git
11 years agoR600: PV stores Reg id, not index
Vincent Lejeune [Mon, 17 Jun 2013 20:16:40 +0000 (20:16 +0000)]
R600: PV stores Reg id, not index

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184117 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Properly set COUNT_3 bit in TEX clause initiating inst for pre EG gen.
Vincent Lejeune [Mon, 17 Jun 2013 20:16:26 +0000 (20:16 +0000)]
R600: Properly set COUNT_3 bit in TEX clause initiating inst for pre EG gen.

Fixes rv7x0 bug in Heaven reported here:
https://bugs.freedesktop.org/show_bug.cgi?id=64257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184116 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj][ELF] Exit with error status on error.
Sean Silva [Mon, 17 Jun 2013 20:14:59 +0000 (20:14 +0000)]
[yaml2obj][ELF] Exit with error status on error.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184115 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Remove a use of PathV1.h."
Rafael Espindola [Mon, 17 Jun 2013 19:54:17 +0000 (19:54 +0000)]
Revert "Remove a use of PathV1.h."

This reverts commit r183985.

We were missing the checks for not deleting things like /dev/null.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184111 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in CrashDebugger.cpp.
Rafael Espindola [Mon, 17 Jun 2013 19:33:18 +0000 (19:33 +0000)]
Don't use PathV1.h in CrashDebugger.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184109 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in ToolRunner.h.
Rafael Espindola [Mon, 17 Jun 2013 19:21:38 +0000 (19:21 +0000)]
Don't use PathV1.h in ToolRunner.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184107 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove CBE related code.
Rafael Espindola [Mon, 17 Jun 2013 19:03:02 +0000 (19:03 +0000)]
Remove CBE related code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184106 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSwitch spill weights from a basic loop depth estimation to BlockFrequencyInfo.
Benjamin Kramer [Mon, 17 Jun 2013 19:00:36 +0000 (19:00 +0000)]
Switch spill weights from a basic loop depth estimation to BlockFrequencyInfo.

The main advantages here are way better heuristics, taking into account not
just loop depth but also __builtin_expect and other static heuristics and will
eventually learn how to use profile info. Most of the work in this patch is
pushing the MachineBlockFrequencyInfo analysis into the right places.

This is good for a 5% speedup on zlib's deflate (x86_64), there were some very
unfortunate spilling decisions in its hottest loop in longest_match(). Other
benchmarks I tried were mostly neutral.

This changes register allocation in subtle ways, update the tests for it.
2012-02-20-MachineCPBug.ll was deleted as it's very fragile and the instruction
it looked for was gone already (but the FileCheck pattern picked up unrelated
stuff).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184105 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix for a regression caused by the LoopVectorizer when
Pekka Jaaskelainen [Mon, 17 Jun 2013 18:49:06 +0000 (18:49 +0000)]
Fix for a regression caused by the LoopVectorizer when
vectorizing loops with memory accesses to non-zero address spaces. It
simply dropped the AS info. Fixes PR16306.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184103 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in ExtractFunction.cpp.
Rafael Espindola [Mon, 17 Jun 2013 18:48:59 +0000 (18:48 +0000)]
Don't use PathV1.h in ExtractFunction.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184102 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in tools/gold/gold-plugin.cpp.
Rafael Espindola [Mon, 17 Jun 2013 18:38:18 +0000 (18:38 +0000)]
Don't use PathV1.h in tools/gold/gold-plugin.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184099 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in LTOCodeGenerator.cpp
Rafael Espindola [Mon, 17 Jun 2013 18:05:35 +0000 (18:05 +0000)]
Don't use PathV1.h in LTOCodeGenerator.cpp

This patch also adds a simpler version of sys::fs::remove and a tool_output_file
constructor for when we already have an open file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184095 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in llvm-link.
Rafael Espindola [Mon, 17 Jun 2013 17:32:19 +0000 (17:32 +0000)]
Don't use PathV1.h in llvm-link.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184092 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDisable vectorization for -Oz.
Nadav Rotem [Mon, 17 Jun 2013 17:22:40 +0000 (17:22 +0000)]
Disable vectorization for -Oz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184089 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDelete declared but not implemented functions.
Rafael Espindola [Mon, 17 Jun 2013 17:15:00 +0000 (17:15 +0000)]
Delete declared but not implemented functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184087 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable the loop vectorizer by default for -Os and -O2.
Nadav Rotem [Mon, 17 Jun 2013 16:23:34 +0000 (16:23 +0000)]
Enable the loop vectorizer by default for -Os and -O2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184084 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove lib/Archive to tools/llvm-ar.
Rafael Espindola [Mon, 17 Jun 2013 15:47:20 +0000 (15:47 +0000)]
Move lib/Archive to tools/llvm-ar.

llvm-ar is the only tool that needs to write archive files. Every other tool
should be able to use the lib/Object interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184083 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't link with the archive library programs that don't use it.
Rafael Espindola [Mon, 17 Jun 2013 15:29:46 +0000 (15:29 +0000)]
Don't link with the archive library programs that don't use it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184081 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a testcase for r184074.
Rafael Espindola [Mon, 17 Jun 2013 14:00:41 +0000 (14:00 +0000)]
Add a testcase for r184074.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184080 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix incorrectly finding 'executable' directories instead of files.
Manuel Klimek [Mon, 17 Jun 2013 10:48:34 +0000 (10:48 +0000)]
Fix incorrectly finding 'executable' directories instead of files.

This broke for example the 'not' utility, if a directory called
'FileCheck' is executable and in the path before the actual 'FileCheck'.

This patch steals the implementation of the "old" PathV1 canExecute
implementation:
- checks for R_OK (file readable): this is necessary for executing
  scripts; we should not regress here unless we have good reasons
- checks for S_ISREG; if we want to get rid of this, we'd need to
  change all callers who already made the assumption when depending
  on Path V1.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184074 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAArch64: print relocation addends if present on AArch64
Tim Northover [Mon, 17 Jun 2013 03:03:06 +0000 (03:03 +0000)]
AArch64: print relocation addends if present on AArch64

llvm-objdump should provide some way of printing out the addends present in the
.rela sections for debugging purposes if nothing else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184072 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebugInfo: remove target-specific Frame Index handling for DBG_VALUE MachineInstrs
David Blaikie [Sun, 16 Jun 2013 20:34:27 +0000 (20:34 +0000)]
DebugInfo: remove target-specific Frame Index handling for DBG_VALUE MachineInstrs

Frame index handling is now target-agnostic, so delete the target hooks
for creation & asm printing of target-specific addressing in DBG_VALUEs
and any related functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184067 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions
David Blaikie [Sun, 16 Jun 2013 20:34:15 +0000 (20:34 +0000)]
Debug Info: Simplify Frame Index handling in DBG_VALUE Machine Instructions

Rather than using the full power of target-specific addressing modes in
DBG_VALUEs with Frame Indicies, simply use Frame Index + Offset. This
reduces the complexity of debug info handling down to two
representations of values (reg+offset and frame index+offset) rather
than three or four.

Ideally we could ensure that frame indicies had been eliminated by the
time we reached an assembly or dwarf generation, but I haven't spent the
time to figure out where the FIs are leaking through into that & whether
there's a good place to convert them. Some FI+offset=>reg+offset
conversion is done (see PrologEpilogInserter, for example) which is
necessary for some SelectionDAG assumptions about registers, I believe,
but it might be possible to make this a more thorough conversion &
ensure there are no remaining FIs no matter how instruction selection
is performed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184066 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMachineOperand::setIsDebug should ensure the register is /not/ a definition
David Blaikie [Sun, 16 Jun 2013 20:34:09 +0000 (20:34 +0000)]
MachineOperand::setIsDebug should ensure the register is /not/ a definition

This currently unused function appeared to be asserting in the wrong
direction - DebugValues are never definitions of registers, only uses.
Curiously we don't perform any of these checks for the more common (&
actually used) case of MachineOperand::CreateReg (or other Create
functions).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184065 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSilence warning in Release builds.
Benjamin Kramer [Sun, 16 Jun 2013 11:29:48 +0000 (11:29 +0000)]
Silence warning in Release builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184059 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPut back variable names because they are referenced in the documentation
Dmitri Gribenko [Sun, 16 Jun 2013 03:22:56 +0000 (03:22 +0000)]
Put back variable names because they are referenced in the documentation
comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184051 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebugInfo: follow up to 184045 to constrain the tests further to ensure they don...
David Blaikie [Sat, 15 Jun 2013 16:02:44 +0000 (16:02 +0000)]
DebugInfo: follow up to 184045 to constrain the tests further to ensure they don't contain +0 offsets

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184046 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebugInfo: print DBG_VALUE MachineInstrs with [] for deref and drop the offset when...
David Blaikie [Sat, 15 Jun 2013 15:52:58 +0000 (15:52 +0000)]
DebugInfo: print DBG_VALUE MachineInstrs with [] for deref and drop the offset when it's zero

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184045 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse 0 instead of NULL.
Jakub Staszak [Sat, 15 Jun 2013 12:20:44 +0000 (12:20 +0000)]
Use 0 instead of NULL.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184044 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAPInt: Add a fast case for isAllOnesValue.
Benjamin Kramer [Sat, 15 Jun 2013 11:32:09 +0000 (11:32 +0000)]
APInt: Add a fast case for isAllOnesValue.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184042 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPruneEH: Only merge attribute sets when used. No functionality change.
Benjamin Kramer [Sat, 15 Jun 2013 10:55:39 +0000 (10:55 +0000)]
PruneEH: Only merge attribute sets when used. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184041 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMissing NDEBUGs.
Andrew Trick [Sat, 15 Jun 2013 05:46:47 +0000 (05:46 +0000)]
Missing NDEBUGs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184039 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMI-Sched: heuristics using the new latency and machine model.
Andrew Trick [Sat, 15 Jun 2013 05:39:19 +0000 (05:39 +0000)]
MI-Sched: heuristics using the new latency and machine model.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184038 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSupport BufferSize on ProcResGroup for unified MOp schedulers.
Andrew Trick [Sat, 15 Jun 2013 04:50:06 +0000 (04:50 +0000)]
Support BufferSize on ProcResGroup for unified MOp schedulers.

And add Sandybridge/Haswell resource buffers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184034 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate machine models. Specify buffer sizes for OOO processors.
Andrew Trick [Sat, 15 Jun 2013 04:50:02 +0000 (04:50 +0000)]
Update machine models. Specify buffer sizes for OOO processors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184033 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMachine Model: Add MicroOpBufferSize and resource BufferSize.
Andrew Trick [Sat, 15 Jun 2013 04:49:57 +0000 (04:49 +0000)]
Machine Model: Add MicroOpBufferSize and resource BufferSize.

Replace the ill-defined MinLatency and ILPWindow properties with
with straightforward buffer sizes:
MCSchedMode::MicroOpBufferSize
MCProcResourceDesc::BufferSize

These can be used to more precisely model instruction execution if desired.

Disabled some misched tests temporarily. They'll be reenabled in a few commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184032 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMI-Sched: Rename IssueCount to CurrMOps.
Andrew Trick [Sat, 15 Jun 2013 04:49:49 +0000 (04:49 +0000)]
MI-Sched: Rename IssueCount to CurrMOps.

"Counts" refer to scaled resource counts within a region. CurrMOps is
simply the number of micro-ops to be issue in the current cycle.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184031 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMI-Sched: Remove the temporary EnableCopyConstrain flag.
Andrew Trick [Sat, 15 Jun 2013 04:49:46 +0000 (04:49 +0000)]
MI-Sched: Remove the temporary EnableCopyConstrain flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184030 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMI-Sched: added tracking of dependent latency for better heuristics.
Andrew Trick [Sat, 15 Jun 2013 04:49:44 +0000 (04:49 +0000)]
MI-Sched: added tracking of dependent latency for better heuristics.

Heuristics compare the critical path in the scheduled code, called
ExpectedLatency, with the latency of instructions remaining to be
scheduled. There are two ways to look at remaining latency:

(1) Dependent latency includes the latency between unscheduled and
scheduled instructions.

(2) Independent latency is simply the height (bottom-up) or depth
(top-down) of instructions currently in the ready Q.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184029 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMI-Sched: DEBUG: print critical resource.
Andrew Trick [Sat, 15 Jun 2013 04:49:42 +0000 (04:49 +0000)]
MI-Sched: DEBUG: print critical resource.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184028 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSelectionDAG: slightly refactor DAGCombiner::visitSELECT_CC to avoid redudant checks...
Stephen Lin [Sat, 15 Jun 2013 04:03:33 +0000 (04:03 +0000)]
SelectionDAG: slightly refactor DAGCombiner::visitSELECT_CC to avoid redudant checks...

This doesn't really effect performance due to all the relevant calls being transparent but is clearer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184027 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDebug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments...
David Blaikie [Sat, 15 Jun 2013 00:33:47 +0000 (00:33 +0000)]
Debug Info: Don't print the display name and colon prefix for DEBUG_VALUE comments if the display name is empty

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184026 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Move some classes into anonymous namespaces.
Sean Silva [Sat, 15 Jun 2013 00:31:46 +0000 (00:31 +0000)]
[yaml2obj] Move some classes into anonymous namespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184025 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Add support for sh_link via `Link` key.
Sean Silva [Sat, 15 Jun 2013 00:25:26 +0000 (00:25 +0000)]
[yaml2obj] Add support for sh_link via `Link` key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184022 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Add SI load support for v[24]i32 and store for v2i32
Tom Stellard [Sat, 15 Jun 2013 00:09:31 +0000 (00:09 +0000)]
R600: Add SI load support for v[24]i32 and store for v2i32

Also add a seperate vector lit test file, since r600 doesn't seem to handle
v2i32 load/store yet, but we can test both for SI.

Patch by: Aaron Watry

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry <awatry@gmail.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184021 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove empty directory.
Rafael Espindola [Fri, 14 Jun 2013 23:27:04 +0000 (23:27 +0000)]
Remove empty directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184020 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove the LLVM specific archive index.
Rafael Espindola [Fri, 14 Jun 2013 23:25:53 +0000 (23:25 +0000)]
Remove the LLVM specific archive index.

Archive files (.a) can have a symbol table indicating which object
files in them define which symbols. The purpose of this symbol table
is to speed up linking by allowing the linker the read only the .o
files it is actually going to use instead of having to parse every
object's symbol table.

LLVM's archive library currently supports a LLVM specific format for
such table. It is hard to see any value in that now that llvm-ld is
gone:

* System linkers don't use it: GNU ar uses the same plugin as the
linker to create archive files with a regular index. The OS X ar
creates no symbol table for IL files, I assume the linker just parses
all IL files.

* It doesn't interact well with archives having both IL and native objects.

* We probably don't want to be responsible for yet another archive
format variant.

This patch then:

* Removes support for creating and reading such index from lib/Archive.
* Remove llvm-ranlib, since there is nothing left for it to do.

We should in the future add support for regular indexes to llvm-ar for
both native and IL objects. When we do that, llvm-ranlib should be
reimplemented as a symlink to llvm-ar, as it is equivalent to "ar s".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184019 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Use correct encoding for Vertex Fetch instructions on Cayman
Tom Stellard [Fri, 14 Jun 2013 22:12:30 +0000 (22:12 +0000)]
R600: Use correct encoding for Vertex Fetch instructions on Cayman

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184016 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Use EXPORT_RAT_INST_STORE_DWORD for stores on Cayman
Tom Stellard [Fri, 14 Jun 2013 22:12:24 +0000 (22:12 +0000)]
R600: Use EXPORT_RAT_INST_STORE_DWORD for stores on Cayman

We were using RAT_INST_STORE_RAW, which seemed to work, but the docs
say this instruction doesn't exist for Cayman, so it's probably safer
to use a documented instruction instead.

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184015 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Factor the instruction encoding out the RAT_WRITE_CACHELESS_eg class
Tom Stellard [Fri, 14 Jun 2013 22:12:19 +0000 (22:12 +0000)]
R600: Factor the instruction encoding out the RAT_WRITE_CACHELESS_eg class

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184014 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Move instruction encoding definitions into a separate .td file
Tom Stellard [Fri, 14 Jun 2013 22:12:09 +0000 (22:12 +0000)]
R600: Move instruction encoding definitions into a separate .td file

Reviewed-by: Vincent Lejeune<vljn at ovi.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184013 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIntroduce getSelect usage and use more getSelectCC
Matt Arsenault [Fri, 14 Jun 2013 22:04:37 +0000 (22:04 +0000)]
Introduce getSelect usage and use more getSelectCC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184012 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd getSelect helper function
Matt Arsenault [Fri, 14 Jun 2013 22:04:32 +0000 (22:04 +0000)]
Add getSelect helper function

Patch by Micah Villmow from last year that was reviewed, but never committed

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184011 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd GetCurrentDirectory back.
Rafael Espindola [Fri, 14 Jun 2013 21:41:33 +0000 (21:41 +0000)]
Add GetCurrentDirectory back.

It looks like clang-tools-extra/unittests/cpp11-migrate/TransformTest.cpp
depends on the behaviour of the old one on Windows. Maybe a difference
between GetCurrentDirectoryA and GetCurrentDirectoryW?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184009 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSelectionDAG: minor fix to order of operands in comments to match the code
Stephen Lin [Fri, 14 Jun 2013 21:33:58 +0000 (21:33 +0000)]
SelectionDAG: minor fix to order of operands in comments to match the code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184008 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace use of PathV1.h in MCContext.cpp.
Rafael Espindola [Fri, 14 Jun 2013 20:26:58 +0000 (20:26 +0000)]
Replace use of PathV1.h in MCContext.cpp.

GetCurrentDirectory is now unused. Remove it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184003 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMark rematerialized super/sub registers as dead.
Tim Northover [Fri, 14 Jun 2013 20:22:21 +0000 (20:22 +0000)]
Mark rematerialized super/sub registers as dead.

When we're rematerializing into a not-quite-right register we already add the
real definition as an imp-def, but we should also be marking the "official"
register as dead, since nothing else is going to use it as a result of this
remat.

Not doing this can affect pressure tracking.

rdar://problem/14158833

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184002 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix frame pointer debug information test
JF Bastien [Fri, 14 Jun 2013 19:55:26 +0000 (19:55 +0000)]
Fix frame pointer debug information test

Run the test at O1 instead of O0: ARM FastISel keeps frame pointers around and ignores the flag. The test should now pass on ARM and still passes on x86.See: http://llvm.org/bugs/show_bug.cgi?id=16322

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183999 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "Cmake: add compiler option in a more idiomatic way"
Rafael Espindola [Fri, 14 Jun 2013 19:41:05 +0000 (19:41 +0000)]
Revert "Cmake: add compiler option in a more idiomatic way"

This reverts commit 183995.

It broke the bots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/9730/steps/build_clang/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183997 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace use of PathV1.h in Program.cpp.
Rafael Espindola [Fri, 14 Jun 2013 19:38:45 +0000 (19:38 +0000)]
Replace use of PathV1.h in Program.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183996 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCmake: add compiler option in a more idiomatic way
Arnaud A. de Grandmaison [Fri, 14 Jun 2013 19:26:57 +0000 (19:26 +0000)]
Cmake: add compiler option in a more idiomatic way

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183995 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDo not to perform RUN line substitution of llc if that's prefixed by a hypnen
Eli Bendersky [Fri, 14 Jun 2013 19:14:52 +0000 (19:14 +0000)]
Do not to perform RUN line substitution of llc if that's prefixed by a hypnen
(-llc), similarly to the way it was done for clang and llvmc.

This doesn't affect the upstream llvm tests but helps when developing custom
LLVM-based tools and testing them within the LLVM regression framework.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183994 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSelectionDAG: Fix incorrect condition checks in some cases of folding FADD/FMUL combi...
Stephen Lin [Fri, 14 Jun 2013 18:17:35 +0000 (18:17 +0000)]
SelectionDAG: Fix incorrect condition checks in some cases of folding FADD/FMUL combinations; also improve accuracy of comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183993 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused argument.
Rafael Espindola [Fri, 14 Jun 2013 18:12:13 +0000 (18:12 +0000)]
Remove unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183992 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in GraphWriter.cpp.
Rafael Espindola [Fri, 14 Jun 2013 17:11:14 +0000 (17:11 +0000)]
Don't use PathV1.h in GraphWriter.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183988 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConvert a use of sys::Path::GetTemporaryDirectory.
Rafael Espindola [Fri, 14 Jun 2013 16:43:15 +0000 (16:43 +0000)]
Convert a use of sys::Path::GetTemporaryDirectory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183987 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a use of PathV1.h.
Rafael Espindola [Fri, 14 Jun 2013 16:20:18 +0000 (16:20 +0000)]
Remove a use of PathV1.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183985 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake PrologEpilogInserter save/restore all callee saved registers
Derek Schuff [Fri, 14 Jun 2013 16:15:29 +0000 (16:15 +0000)]
Make PrologEpilogInserter save/restore all callee saved registers
in functions which call __builtin_unwind_init()

__builtin_unwind_init() is an undocumented gcc intrinsic which has this effect,
and is used in libgcc_eh.

Goes part of the way toward fixing PR8541.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183984 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a use of PathV1.h.
Rafael Espindola [Fri, 14 Jun 2013 15:24:56 +0000 (15:24 +0000)]
Remove a use of PathV1.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183982 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove PrependMainExecutablePath next to its only user.
Rafael Espindola [Fri, 14 Jun 2013 15:12:13 +0000 (15:12 +0000)]
Move PrependMainExecutablePath next to its only user.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183980 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a use of sys::Path.
Rafael Espindola [Fri, 14 Jun 2013 13:59:21 +0000 (13:59 +0000)]
Remove a use of sys::Path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183979 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix thumb coprocessor instruction with pre-writeback disassembly
Amaury de la Vieuville [Fri, 14 Jun 2013 11:21:35 +0000 (11:21 +0000)]
ARM: fix thumb coprocessor instruction with pre-writeback disassembly

was        stc2 p0, c0, [r0]!
instead of stc2 p0, c0, [r0,#0]!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183975 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: cvtpi2ps is just an SSE instruction with MMX operands. It has no AVX equivalent.
Benjamin Kramer [Fri, 14 Jun 2013 09:31:41 +0000 (09:31 +0000)]
X86: cvtpi2ps is just an SSE instruction with MMX operands. It has no AVX equivalent.

Give it the right register format so we can also emit it when AVX is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183971 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unused header.
Rafael Espindola [Fri, 14 Jun 2013 04:31:19 +0000 (04:31 +0000)]
Remove unused header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183968 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEnable FastISel on ARM for Linux and NaCl, not MCJIT
JF Bastien [Fri, 14 Jun 2013 02:49:43 +0000 (02:49 +0000)]
Enable FastISel on ARM for Linux and NaCl, not MCJIT

This is a resubmit of r182877, which was reverted because it broken
MCJIT tests on ARM. The patch leaves MCJIT on ARM as it was before: only
enabled for iOS. I've CC'ed people from the original review and revert.

FastISel was only enabled for iOS ARM and Thumb2, this patch enables it
for ARM (not Thumb2) on Linux and NaCl, but not MCJIT.

Thumb2 support needs a bit more work, mainly around register class
restrictions.

The patch punts to SelectionDAG when doing TLS relocation on non-Darwin
targets. I will fix this and other FastISel-to-SelectionDAG failures in
a separate patch.

The patch also forces FastISel to retain frame pointers: iOS always
keeps them for backtracking (so emitted code won't change because of
this), but Linux was getting much worse code that was incorrect when
using big frames (such as test-suite's lencod). I'll also fix this in a
later patch, it will probably require a peephole so that FastISel
doesn't rematerialize frame pointers back-to-back.

The test changes are straightforward, similar to:
  http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130513/174279.html
They also add a vararg test that got dropped in that change.

I ran all of lnt test-suite on A15 hardware with --optimize-option=-O0
and all the tests pass. All the tests also pass on x86 make check-all. I
also re-ran the check-all tests that failed on ARM, and they all seem to
pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183966 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Add support for sh_addralign via `AddressAlign` key.
Sean Silva [Fri, 14 Jun 2013 00:38:02 +0000 (00:38 +0000)]
[yaml2obj] Add support for sh_addralign via `AddressAlign` key.

For consistency, change the address in the test case from 0xDEADBEEF to
0xCAFEBABE since 0xCAFEBABE that actually has a 2-byte alignment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183962 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove #include from .h to .cpp file.
Jakub Staszak [Fri, 14 Jun 2013 00:00:13 +0000 (00:00 +0000)]
Move #include from .h to .cpp file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183960 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove forward declaration of MachineBasicBlock. It is #included anyway.
Jakub Staszak [Thu, 13 Jun 2013 23:53:13 +0000 (23:53 +0000)]
Remove forward declaration of MachineBasicBlock. It is #included anyway.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183958 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago#include <climits> instead of <limits.h> in C++ header file.
Jakub Staszak [Thu, 13 Jun 2013 23:49:09 +0000 (23:49 +0000)]
#include <climits> instead of <limits.h> in C++ header file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183957 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Add support for specifying raw section content.
Sean Silva [Thu, 13 Jun 2013 22:20:01 +0000 (22:20 +0000)]
[yaml2obj] Add support for specifying raw section content.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183955 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Add sh_addr via `Address` key.
Sean Silva [Thu, 13 Jun 2013 22:19:54 +0000 (22:19 +0000)]
[yaml2obj] Add sh_addr via `Address` key.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183954 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[yaml2obj] Initial ELF section support.
Sean Silva [Thu, 13 Jun 2013 22:19:48 +0000 (22:19 +0000)]
[yaml2obj] Initial ELF section support.

The current functionality is extremely basic and a bit rough around the
edges, but it will flesh out in future commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183953 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTry to fix the windows build.
Rafael Espindola [Thu, 13 Jun 2013 21:38:21 +0000 (21:38 +0000)]
Try to fix the windows build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183950 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in Signals.h.
Rafael Espindola [Thu, 13 Jun 2013 21:16:58 +0000 (21:16 +0000)]
Don't use PathV1.h in Signals.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183947 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a RemoveFileOnSignal that takes a StringRef.
Rafael Espindola [Thu, 13 Jun 2013 21:01:17 +0000 (21:01 +0000)]
Add a RemoveFileOnSignal that takes a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183943 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't use PathV1.h in FileUtilities.h.
Rafael Espindola [Thu, 13 Jun 2013 20:41:00 +0000 (20:41 +0000)]
Don't use PathV1.h in FileUtilities.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183941 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAvoid using PathV1.h in Program.h.
Rafael Espindola [Thu, 13 Jun 2013 20:25:38 +0000 (20:25 +0000)]
Avoid using PathV1.h in Program.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183940 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[PowerPC] Disable fast-isel for existing -O0 tests for PowerPC.
Bill Schmidt [Thu, 13 Jun 2013 20:23:34 +0000 (20:23 +0000)]
[PowerPC] Disable fast-isel for existing -O0 tests for PowerPC.

This is a preliminary patch for fast instruction selection on
PowerPC.  Code generation can differ between DAG isel and fast isel.
Existing tests that specify -O0 were written to expect DAG isel.  Make
this explicit by adding -fast-isel=false to the tests.

In some cases specifying -fast-isel=false produces different code even
when there isn't a fast instruction selector specified.  This is
because TM.Options.EnableFastISel = 1 at -O0 whether or not a FastISel
object exists.  Thus disabling fast isel can actually produce less
conservative code.  Because of this, some of the expected code
generation in the -O0 tests needs to be adjusted.

In particular, handling of function arguments is less conservative
with -fast-isel=false (see isOnlyUsedInEntryBlock() in
SelectionDAGBuilder.cpp).  This results in fewer stack accesses and,
in some cases, reduced stack size as uselessly loaded values are no
longer stored back to spill locations in the stack.

No functional change with this patch; test case adjustments only.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183939 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoR600: Don't try to fix reg class when copying IMPLICIT_DEF to a register
Tom Stellard [Thu, 13 Jun 2013 20:14:00 +0000 (20:14 +0000)]
R600: Don't try to fix reg class when copying IMPLICIT_DEF to a register

The test case for this is way too complex to be useful as a lit test,
and I was unable to reduce it.

https://bugs.freedesktop.org/show_bug.cgi?id=65438

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183937 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a version of sys::ExecuteAndWait that takes StringRefs.
Rafael Espindola [Thu, 13 Jun 2013 20:06:28 +0000 (20:06 +0000)]
Add a version of sys::ExecuteAndWait that takes StringRefs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183934 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix DeleteDeadVarargs not to crash on functions referenced by BlockAddresses
Derek Schuff [Thu, 13 Jun 2013 19:51:17 +0000 (19:51 +0000)]
Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddresses

This pass was assuming that if hasAddressTaken() returns false for a
function, the function's only uses are call sites.  That's not true
because there can be references by BlockAddresses too.

Fix the pass to handle this case.  Fix
BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type
to be changed by RAUW'ing the function with a bitcast of the recreated
function.

Patch by Mark Seaborn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183933 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHave sys::FindProgramByName return a std::string.
Rafael Espindola [Thu, 13 Jun 2013 19:25:37 +0000 (19:25 +0000)]
Have sys::FindProgramByName return a std::string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183928 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMips: Remove global set.
Benjamin Kramer [Thu, 13 Jun 2013 19:06:52 +0000 (19:06 +0000)]
Mips: Remove global set.

Backends shouldn't retain any global state. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183927 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMerge changes to clang's Driver code into LLVM's Option library
Reid Kleckner [Thu, 13 Jun 2013 18:12:12 +0000 (18:12 +0000)]
Merge changes to clang's Driver code into LLVM's Option library

This is in preparation for switching the clang driver over to using LLVM's
Option library.  Richard Smith introduced most of these changes to the clang
driver in r167638.

Reviewers: espindola on IRC

Differential Revision: http://llvm-reviews.chandlerc.com/D970

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183925 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCovert remaining graph viewers from sys::Path to std::string.
Rafael Espindola [Thu, 13 Jun 2013 17:32:16 +0000 (17:32 +0000)]
Covert remaining graph viewers from sys::Path to std::string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183921 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate code for other graph viewing programs too.
Rafael Espindola [Thu, 13 Jun 2013 17:27:45 +0000 (17:27 +0000)]
Update code for other graph viewing programs too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183920 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReduce usage of sys::Path in the graph writer.
Rafael Espindola [Thu, 13 Jun 2013 17:20:48 +0000 (17:20 +0000)]
Reduce usage of sys::Path in the graph writer.

Now PathV1.h is not needed in GraphWriter.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183919 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a version of DisplayGraph that takes a StringRef.
Rafael Espindola [Thu, 13 Jun 2013 16:56:13 +0000 (16:56 +0000)]
Add a version of DisplayGraph that takes a StringRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183915 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix B decoding
Amaury de la Vieuville [Thu, 13 Jun 2013 16:41:55 +0000 (16:41 +0000)]
ARM: fix B decoding

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183914 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM: fix t2am_imm8_offset operand printing for imm=#-0
Amaury de la Vieuville [Thu, 13 Jun 2013 16:40:51 +0000 (16:40 +0000)]
ARM: fix t2am_imm8_offset operand printing for imm=#-0

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183913 91177308-0d34-0410-b5e6-96231b3b80d8