Alex Lorenz [Mon, 15 Jun 2015 23:52:35 +0000 (23:52 +0000)]
MIR Serialization: move the MIR printer out of the MIR printing pass.
This commit decouples the MIR printer and the MIR printing pass so
that it will be possible to move the MIR printer into a separate
machine IR library later on.
Reviewers: Duncan P. N. Exon Smith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239788
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Mon, 15 Jun 2015 23:45:08 +0000 (23:45 +0000)]
[X86] Try to shorten dwarf CFI emission
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239786
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Mon, 15 Jun 2015 23:18:03 +0000 (23:18 +0000)]
Debug Info IR: Switch DIObjCProperty to use DITypeRef.
This is a prerequisite for turning on ODR type uniquing for ObjC++.
rdar://problem/
21377883
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239780
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 15 Jun 2015 23:07:38 +0000 (23:07 +0000)]
MIR Serialization: Create dummy functions when the MIR file doesn't have LLVM IR.
This commit creates a dummy LLVM IR function with one basic block and an unreachable
instruction for each parsed machine function when the MIR file doesn't have LLVM IR.
This change is required as the machine function analysis pass creates machine
functions only for the functions that are defined in the current LLVM module.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10135
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239778
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 15 Jun 2015 22:23:23 +0000 (22:23 +0000)]
MIR Serialization: Report an error when machine functions have the same name.
This commit reports an error when the MIR parser encounters a machine
function with the name that is the same as the name of a different
machine function.
Reviewers: Duncan P. N. Exon Smith
Differential Revision: http://reviews.llvm.org/D10130
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239774
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 15 Jun 2015 22:16:51 +0000 (22:16 +0000)]
Add safestack attribute to LLVMAttribute enum and Go bindings. Correct
constants in commented-out part of LLVMAttribute enum. Add tests that verify
that the safestack attribute is only allowed as a function attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239772
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 15 Jun 2015 21:57:41 +0000 (21:57 +0000)]
[Hexagon] Using readobj rather than objdump.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239770
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 15 Jun 2015 21:52:13 +0000 (21:52 +0000)]
[Hexagon] PC-relative offsets are relative to packet start rather than the offset of the relocation. Set relocation addend and check it's correct in the ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239769
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 15 Jun 2015 21:49:31 +0000 (21:49 +0000)]
[X86][SSE] Added tests for vector i8/i16 to f32/f64 conversions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239767
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 15 Jun 2015 21:07:11 +0000 (21:07 +0000)]
Protection against stack-based memory corruption errors using SafeStack
This patch adds the safe stack instrumentation pass to LLVM, which separates
the program stack into a safe stack, which stores return addresses, register
spills, and local variables that are statically verified to be accessed
in a safe way, and the unsafe stack, which stores everything else. Such
separation makes it much harder for an attacker to corrupt objects on the
safe stack, including function pointers stored in spilled registers and
return addresses. You can find more information about the safe stack, as
well as other parts of or control-flow hijack protection technique in our
OSDI paper on code-pointer integrity (http://dslab.epfl.ch/pubs/cpi.pdf)
and our project website (http://levee.epfl.ch).
The overhead of our implementation of the safe stack is very close to zero
(0.01% on the Phoronix benchmarks). This is lower than the overhead of
stack cookies, which are supported by LLVM and are commonly used today,
yet the security guarantees of the safe stack are strictly stronger than
stack cookies. In some cases, the safe stack improves performance due to
better cache locality.
Our current implementation of the safe stack is stable and robust, we
used it to recompile multiple projects on Linux including Chromium, and
we also recompiled the entire FreeBSD user-space system and more than 100
packages. We ran unit tests on the FreeBSD system and many of the packages
and observed no errors caused by the safe stack. The safe stack is also fully
binary compatible with non-instrumented code and can be applied to parts of
a program selectively.
This patch is our implementation of the safe stack on top of LLVM. The
patches make the following changes:
- Add the safestack function attribute, similar to the ssp, sspstrong and
sspreq attributes.
- Add the SafeStack instrumentation pass that applies the safe stack to all
functions that have the safestack attribute. This pass moves all unsafe local
variables to the unsafe stack with a separate stack pointer, whereas all
safe variables remain on the regular stack that is managed by LLVM as usual.
- Invoke the pass as the last stage before code generation (at the same time
the existing cookie-based stack protector pass is invoked).
- Add unit tests for the safe stack.
Original patch by Volodymyr Kuznetsov and others at the Dependable Systems
Lab at EPFL; updates and upstreaming by myself.
Differential Revision: http://reviews.llvm.org/D6094
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239761
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 21:04:27 +0000 (21:04 +0000)]
Don't indent inside a namespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239760
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 21:02:49 +0000 (21:02 +0000)]
Replace @ with the more common \. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239759
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 20:55:37 +0000 (20:55 +0000)]
Don't repeat names in comments and start functions with a lower case letter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239756
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Mon, 15 Jun 2015 20:30:22 +0000 (20:30 +0000)]
MIR Serialization: Connect the machine function analysis pass to the MIR parser.
This commit connects the machine function analysis pass (which creates machine
functions) to the MIR parser, which will initialize the machine functions
with the state from the MIR file and reconstruct the machine IR.
This commit introduces a new interface called 'MachineFunctionInitializer',
which can be used to provide custom initialization for the machine functions.
This commit also introduces a new diagnostic class called
'DiagnosticInfoMIRParser' which is used for MIR parsing errors.
This commit modifies the default diagnostic handling in LLVMContext - now the
the diagnostics are printed directly into llvm::errs() so that the MIR parsing
errors can be printed with colours.
Reviewers: Justin Bogner
Differential Revision: http://reviews.llvm.org/D9928
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239753
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Mon, 15 Jun 2015 20:16:53 +0000 (20:16 +0000)]
Remove duplicate conditional in if-stmt.
Fixes PR23839.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239751
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 20:08:17 +0000 (20:08 +0000)]
Cleanup the constructor of BitcodeReader. NFC.
Use the same argument names as the members.
Use default member initializes.
Extracted from a patch by Karl Schimpf.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239749
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 20:05:38 +0000 (20:05 +0000)]
Add "REQUIRES: asserts" to test case that uses -debug-only
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239748
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 19:38:15 +0000 (19:38 +0000)]
Unbreak docs build from r239740.
Add FaultMaps.rst to toctree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239747
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 19:29:44 +0000 (19:29 +0000)]
Unbreak the build from r239740.
Do not re-use an enum name as a field name. Some bots don't like this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239746
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Mon, 15 Jun 2015 19:05:35 +0000 (19:05 +0000)]
[Hexagon] Moving pass declarations out of header and in to implementation files. Removing unused function getSubtargetInfo from HexagonMCCodeEmitter.cpp Removing deletion of copy construction and assignment operator since parent already deletes it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239744
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 18:44:27 +0000 (18:44 +0000)]
[CodeGen] Add a pass to fold null checks into nearby memory operations.
Summary:
This change adds an "ImplicitNullChecks" target dependent pass. This
pass folds null checks into memory operation using the FAULTING_LOAD
pseudo-op introduced in previous patches.
Depends on D10197
Depends on D10199
Depends on D10200
Reviewers: reames, rnk, pgavlin, JosephTremoulet, atrick
Reviewed By: atrick
Subscribers: ab, JosephTremoulet, llvm-commits
Differential Revision: http://reviews.llvm.org/D10201
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239743
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 18:44:21 +0000 (18:44 +0000)]
[TargetInstrInfo] Add new hook: AnalyzeBranchPredicate.
Summary:
NFC: no one uses AnalyzeBranchPredicate yet.
Add TargetInstrInfo::AnalyzeBranchPredicate and implement for x86. A
later change adding support for page-fault based implicit null checks
depends on this.
Reviewers: reames, ab, atrick
Reviewed By: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10200
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239742
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 18:44:14 +0000 (18:44 +0000)]
[TargetInstrInfo] Rename getLdStBaseRegImmOfs and implement for x86.
Summary:
TargetInstrInfo::getLdStBaseRegImmOfs to
TargetInstrInfo::getMemOpBaseRegImmOfs and implement for x86. The
implementation only handles a few easy cases now and will be made more
sophisticated in the future.
This is NFCI: the only user of `getLdStBaseRegImmOfs` (now
`getmemOpBaseRegImmOfs`) is `LoadClusterMotion` and `LoadClusterMotion`
is disabled for x86.
Reviewers: reames, ab, MatzeB, atrick
Reviewed By: MatzeB, atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10199
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239741
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 18:44:08 +0000 (18:44 +0000)]
[CodeGen] Introduce a FAULTING_LOAD_OP pseudo-op.
Summary:
This instruction encodes a loading operation that may fault, and a label
to branch to if the load page-faults. The locations of potentially
faulting loads and their "handler" destinations are recorded in a
FaultMap section, meant to be consumed by LLVM's clients.
Nothing generates FAULTING_LOAD_OP instructions yet, but they will be
used in a future change.
The documentation (FaultMaps.rst) needs improvement and I will update
this diff with a more expanded version shortly.
Depends on D10196
Reviewers: rnk, reames, AndyAyers, ab, atrick, pgavlin
Reviewed By: atrick, pgavlin
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10197
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239740
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 15 Jun 2015 18:44:01 +0000 (18:44 +0000)]
[NFC] Extract X86MCInstLower::LowerMachineOperand.
Summary: Refactoring-only change that will be used later.
Reviewers: reames, atrick
Reviewed By: atrick
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10196
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239739
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 15 Jun 2015 17:03:35 +0000 (17:03 +0000)]
De-duplicate common expression, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239736
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Mon, 15 Jun 2015 16:20:16 +0000 (16:20 +0000)]
Rangify several for loops, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239733
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeny Astigeevich [Mon, 15 Jun 2015 15:48:44 +0000 (15:48 +0000)]
On behalf of Alexandros Lamprineas:
LLVM targeting aarch64 doesn't correctly produce aligned accesses for non-aligned
data at -O0/fast-isel (-mno-unaligned-access).
The root cause seems to be in fast-isel not producing unaligned access correctly
for -mno-unaligned-access.
The patch just aborts fast-isel for loads and stores when -mno-unaligned-access is
present.
The regression test is updated to check this new test case (-mno-unaligned-access
together with fast-isel).
Differential Revision: http://reviews.llvm.org/D10360
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239732
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 15 Jun 2015 15:42:26 +0000 (15:42 +0000)]
[LinkerTest] Use LLVMDisposeMessage to free error string.
LLVMDisposeMessage is just a thing wrapper around free at the moment, but it's
the proper API to use here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239731
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 14:49:41 +0000 (14:49 +0000)]
Avoid a "always true" warning from gcc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239729
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Mon, 15 Jun 2015 13:36:27 +0000 (13:36 +0000)]
gold-plugin: save the .o when given -save-temps.
The plugin now save the bitcode before and after optimizations and the
.o that is passed to the linker.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239726
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 15 Jun 2015 10:34:38 +0000 (10:34 +0000)]
Revert r239721 - Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
It appears to cause sparc-little-endian.s to assert on Windows and Darwin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239724
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Mon, 15 Jun 2015 09:19:41 +0000 (09:19 +0000)]
Replace string GNU Triples with llvm::Triple in InitMCObjectFileInfo. NFC.
Summary:
This affects other tools so the previous C++ API has been retained as a
deprecated function for the moment. Clang has been updated with a trivial
patch (not covered by the pre-commit review) to avoid breaking -Werror builds.
Other in-tree tools will be fixed with similar trivial patches.
This continues the patch series to eliminate StringRef forms of GNU triples
from the internals of LLVM that began in r239036.
Reviewers: rengolin
Reviewed By: rengolin
Subscribers: llvm-commits, rengolin
Differential Revision: http://reviews.llvm.org/D10366
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239721
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnaud A. de Grandmaison [Mon, 15 Jun 2015 09:09:06 +0000 (09:09 +0000)]
[MachineSink] Improve runtime performance. NFC.
This patch fixes a compilation time issue, when MachineSink faces PHIs
with a huge number of operands. This can happen for example in goto table
based interpreters, where some basic blocks can have several of those PHIs,
each one with several hundreds operands. MachineSink was spending a
significant time re-building and re-sorting the list of successors of
the current MachineBasicBlock. The computing and sorting of the current
MachineBasicBlock successors is now cached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239720
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Mon, 15 Jun 2015 05:46:29 +0000 (05:46 +0000)]
[ValueTracking] do not overwrite analysis results already computed
Summary:
ValueTracking used to overwrite the analysis results computed from
assumes and dominating conditions. This patch fixes this issue.
Test Plan: test/Analysis/ValueTracking/assume.ll
Reviewers: hfinkel, majnemer
Reviewed By: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10283
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239718
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Mon, 15 Jun 2015 03:00:15 +0000 (03:00 +0000)]
[Support][Endian] Define |= and &= for u{big,little}{16,32,64}_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239716
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 15 Jun 2015 02:56:40 +0000 (02:56 +0000)]
[AArch64] Delete two empty files, which should be removed by r239713.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239715
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 15 Jun 2015 01:56:40 +0000 (01:56 +0000)]
[AArch64] Revert r239711 again. We need to discuss how to share code between AArch64 and ARM backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239713
91177308-0d34-0410-b5e6-
96231b3b80d8
Hao Liu [Mon, 15 Jun 2015 01:35:49 +0000 (01:35 +0000)]
[AArch64] Match interleaved memory accesses into ldN/stN instructions.
Re-commit after adding "-aarch64-neon-syntax=generic" to fix the failure on OS X.
This patch was firstly committed in r239514, then reverted in r239544 because of a syntax incompatible failure on OS X.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239711
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 14 Jun 2015 21:47:29 +0000 (21:47 +0000)]
[CMake] Try to fix r239612, not to miss resources/windows_version_resource.rc in clang build.
- Who defines ${LLVM_SOURCE_DIR} ?
- Would windows_version_resource.rc be available in an *installed* llvm tree?
I suggest it may be installed in ${PREFIX}/share.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239703
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Jun 2015 21:01:20 +0000 (21:01 +0000)]
[InstSimplify] fsub nnan x, x -> 0.0 is valid without ninf
Both inf - inf and (-inf) - (-inf) are NaN, so it's already covered by
nnan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239702
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Jun 2015 18:53:58 +0000 (18:53 +0000)]
[InstSimplify] Add self-fdiv identities for -ffinite-math-only.
When NaNs and Infs are ignored we can fold
X / X -> 1.0
-X / X -> -1.0
X / -X -> -1.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239701
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 14 Jun 2015 13:07:47 +0000 (13:07 +0000)]
AVX-512: Implemented DAG lowering for shuff62x2/shufi62x2 instuctions ( Shuffle Packed Values at 128-bit Granularity )
Tests added , vector-shuffle-512-v8.ll test re-generated.
Differential Revision: http://reviews.llvm.org/D10300
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239697
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 14 Jun 2015 12:59:45 +0000 (12:59 +0000)]
Add support for parsing the XOR operator in Intel syntax inline assembly.
Differential Revision: http://reviews.llvm.org/D10385
Patch by marina.yatsina@intel.com
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239695
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Sun, 14 Jun 2015 12:44:55 +0000 (12:44 +0000)]
AVX-512: Implemented cvtsi2ss/d cvtusi2ss/d instructions with round control for KNL.
Added intrinsics for cvtsi2ss/d instructions.
Added tests for intrinsics and encoding.
Differential Revision: http://reviews.llvm.org/D10430
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239694
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 14 Jun 2015 00:23:40 +0000 (00:23 +0000)]
AsmPrinter.cpp: Avoid crashes for targeting like "arm-mingw32". CurrentFnSym might not be <MCSymbolELF> here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239692
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sun, 14 Jun 2015 00:23:33 +0000 (00:23 +0000)]
Reformat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239691
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Sat, 13 Jun 2015 21:46:39 +0000 (21:46 +0000)]
[Hexagon] Adding some codegen tests and updating some to match spec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239690
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Jun 2015 19:50:38 +0000 (19:50 +0000)]
[Statepoints] Skip a vector copy when uniquing values.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239688
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Jun 2015 19:50:29 +0000 (19:50 +0000)]
[ExecutionEngine] ArrayRefize argument passing.
No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239687
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Sat, 13 Jun 2015 17:50:47 +0000 (17:50 +0000)]
C++11 Rangify loops in AssemblyWriter::printModule, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239686
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 13 Jun 2015 17:23:04 +0000 (17:23 +0000)]
Don't use std::errc.
As noted on Errc.h:
// * std::errc is just marked with is_error_condition_enum. This means that
// common patters like AnErrorCode == errc::no_such_file_or_directory take
// 4 virtual calls instead of two comparisons.
And on some libstdc++ those virtual functions conclude that
------------------------
int main() {
std::error_code foo = std::make_error_code(std::errc::no_such_file_or_directory);
return foo == std::errc::no_such_file_or_directory;
}
-------------------------
should exit with 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239683
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jun 2015 16:25:12 +0000 (16:25 +0000)]
[DAGCombiner] Added BSWAP(BSWAP(x)) -> x combine pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239682
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 13 Jun 2015 15:33:15 +0000 (15:33 +0000)]
hoist loop-invariant; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239681
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 13 Jun 2015 15:32:45 +0000 (15:32 +0000)]
remove function names from comments and clean up; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239680
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jun 2015 15:23:58 +0000 (15:23 +0000)]
[SelectionDAG] Added assertions + UNDEF handling for BSWAP node creation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239679
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 13 Jun 2015 15:06:33 +0000 (15:06 +0000)]
remove unnecessary casts; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239678
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jun 2015 14:08:15 +0000 (14:08 +0000)]
[DAGCombiner] Added BSWAP vector constant folding support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239675
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jun 2015 12:57:36 +0000 (12:57 +0000)]
Stripped trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239674
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 13 Jun 2015 12:53:21 +0000 (12:53 +0000)]
[LinkerTest] Don't leak error string.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239673
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 13 Jun 2015 12:51:39 +0000 (12:51 +0000)]
Stripped trailing whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239672
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 13 Jun 2015 12:49:52 +0000 (12:49 +0000)]
Bring in a BumpPtrStringSaver from lld and simplify the interface.
StringSaver now always saves to a BumpPtrAllocator.
The only reason for having the virtual saveImpl is so lld can have a
thread safe version.
The reason for the distinct BumpPtrStringSaver class is to avoid the
virtual destructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239669
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Fiselier [Sat, 13 Jun 2015 06:55:44 +0000 (06:55 +0000)]
[LIT] Fix failing LIT tests
Summary:
I spend some time trying to get the LIT test suite passing. Here are the changes that I needed to make on my machine.
I made the following changes for the following reasons.
1. google-test.py: The Google test format now checks for "[ PASSED ] 1 test." to check if a test passes.
2. discovery.py: The output appears in a different order on my machine than it did in the test.
3. unittest-adaptor.py: The output appears in a different order on my machine than it did in the test.
4. The classname is now formed differently in `getJUnitXML(...)`.
I'm not sure what is causing the output order to differ in discovery.py and unittest-adaptor.py. Does anybody have any thoughts?
Reviewers: ddunbar, danalbert, jroelofs
Reviewed By: jroelofs
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9864
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239663
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 13 Jun 2015 05:11:14 +0000 (05:11 +0000)]
AMDGPU: s/R600/AMDGPU/ in the Makefiles
Now the library names in the Makefiles match the library names in
LLVMBuild.txt.
This should hopefully fix the remaining bot failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239661
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 13 Jun 2015 03:46:48 +0000 (03:46 +0000)]
configure: Remove non-portable fall-through operator: ;&
This was added in r239657.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239660
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 13 Jun 2015 03:42:16 +0000 (03:42 +0000)]
Rename TargetSubtargetInfo::enablePostMachineScheduler() to enablePostRAScheduler()
r213101 changed the behaviour of this method to not only affect the
PostMachineScheduler scheduler but also the PostRAScheduler scheduler,
renaming should make this fact clear. Also document that the preferred
way is to specify this in the scheduling model instead of overriding
this method.
Differential Revision: http://reviews.llvm.org/D10427
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239659
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Sat, 13 Jun 2015 03:42:11 +0000 (03:42 +0000)]
MachineLICM: Use TargetSchedModel instead of just itineraries
This will use Itinieraries if available, but will also work if just a
MCSchedModel is available.
Differential Revision: http://reviews.llvm.org/D10428
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239658
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Sat, 13 Jun 2015 03:28:10 +0000 (03:28 +0000)]
R600 -> AMDGPU rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239657
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Wala [Sat, 13 Jun 2015 01:08:00 +0000 (01:08 +0000)]
Revert 239644.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239650
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 12 Jun 2015 23:37:11 +0000 (23:37 +0000)]
AArch64: map bare-metal arm64-macho triple to MachO MC layer.
Far better than an assertion about expecting ELF.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239647
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Fri, 12 Jun 2015 23:26:42 +0000 (23:26 +0000)]
Fix returning error message in LLVMLinkModules
On error, the temporary output stream wouldn't be flushed and therefore the
caller would see an empty error message.
Patch by Antoine Pitrou
Differential Revision: http://reviews.llvm.org/D10241
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239646
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 12 Jun 2015 23:13:06 +0000 (23:13 +0000)]
[Orc] Tidy up initialization based on review feedback for r239561 from dblaikie.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239645
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Wala [Fri, 12 Jun 2015 22:49:11 +0000 (22:49 +0000)]
[Scalarizer] Fix potential for stale data in Scattered across invocations
Summary:
Scalarizer has two data structures that hold information about changes
to the function, Gathered and Scattered. These are cleared in finish()
at the end of runOnFunction() if finish() detects any changes to the
function.
However, finish() was checking for changes by only checking if
Gathered was non-empty. The function visitStore() only modifies
Scattered without touching Gathered. As a result, Scattered could have
ended up having stale data if Scalarizer only scalarized store
instructions. Since the data in Scattered is used during the execution
of the pass, this introduced dangling pointer errors.
The fix is to check whether both Scattered and Gathered are empty
before deciding what to do in finish().
Reviewers: srhines
Reviewed By: srhines
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D10422
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239644
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 12 Jun 2015 22:22:50 +0000 (22:22 +0000)]
[Orc] Tidy up the CompileOnDemand layer based on commit review from dblaikie.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239642
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 12 Jun 2015 21:31:15 +0000 (21:31 +0000)]
[Orc] Fix a bug in the CompileOnDemand layer where stub decls were not cloned
into partitions. Also, add an option to clone stub definitions (not just decls)
into partitions: these definitions could be inlined in some places to avoid the
overhead of calling via the stub.
Found by inspection - no test case yet, although I plan to add a unit test for
this once the CompileOnDemand layer refactoring settles down.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239640
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Fri, 12 Jun 2015 20:47:06 +0000 (20:47 +0000)]
R600/SI: Add assembler support for FLAT instructions
- Add glc, slc, and tfe operands to flat instructions
- Add missing flat instructions
- Fix the encoding of flat_load_dwordx3 and flat_store_dwordx3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239637
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 12 Jun 2015 20:18:20 +0000 (20:18 +0000)]
Rangify several for loops in ValueEnumerator constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239636
91177308-0d34-0410-b5e6-
96231b3b80d8
Colin LeMahieu [Fri, 12 Jun 2015 19:57:32 +0000 (19:57 +0000)]
[Hexagon] Making intrinsic tests agnostic to register allocation. Narrowing intrinsic parameters to appropriate width.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239634
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Fri, 12 Jun 2015 18:44:57 +0000 (18:44 +0000)]
Wrap some long lines in LLVMBuild files. NFC
As suggested by jroelofs in a prior review (D9752),
it makes sense to generally prefer multi-line format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239632
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Fri, 12 Jun 2015 18:31:38 +0000 (18:31 +0000)]
Add 'shave' processor name to Triple
Based on ArchType, Clang's driver can select a non-Clang compiler.
String parsing in Clang would have sufficed if it were only that,
however this change anticipates true llvm support.
Differential Revision: http://reviews.llvm.org/D10413
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239631
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 12 Jun 2015 18:22:03 +0000 (18:22 +0000)]
Refix a use of explicit pointer types in GEP constant folding
In the glorious future of opaque pointer types, it won't be possible to
retrieve the pointee type of a pointer type which is what's being done
in this GEP loop - but the first iteration is always a pointer type and
the loop doesn't care about that case, except whether or not the index
is a constant.
So pull that special case out before the loop and start at the second
iteration (index 1) instead.
Originally committed in r236670 and reverted with a test case in
r239015. This change keeps the test case working while also avoiding
depending on pointee types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239629
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Wala [Fri, 12 Jun 2015 18:16:51 +0000 (18:16 +0000)]
Fix a typo in a comment in MemCpyOpt (test commit)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239628
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 12 Jun 2015 18:13:20 +0000 (18:13 +0000)]
Rangify two for loops in BitcodeReader.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239627
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 18:07:34 +0000 (18:07 +0000)]
Remove unnecessary MCExpr.h include from MCSymbol.h
MCSymbol.h already forwards declares MCExpr and only uses MCExpr* so doesn't
need to include the header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239626
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 17:48:21 +0000 (17:48 +0000)]
Remove a bunch of inline keywords from User. NFC.
This came up in the patch review for http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-
20150608/281362.html.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239624
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 17:48:18 +0000 (17:48 +0000)]
Move OperandList to be allocated prior to User for hung off subclasses.
For hung off uses, we need a Use* to tell use where the operands are.
This was User::OperandList but we want to remove that to save space
of all subclasses which aren't making use of 'hung off uses'.
Hung off uses now allocate their own 'OperandList' Use* in the
User::new which they call.
getOperandList() now uses the hung off uses bit to work out where the
Use* for the OperandList lives. If a User has hung off uses, then this
bit tells them to go back a single Use* from the User* and use that
value as the OperandList.
If a User has no hung off uses, then we get the first operand by
subtracting (NumOperands * sizeof(Use)) from the User this pointer.
This saves a pointer from User and all subclasses. Given the average
size of a subclass of User is 112 or 128 bytes, this saves around 7% of space
With malloc tending to align to 16-bytes the real saving is typically more like 3.5%.
On 'opt -O2 verify-uselistorder.lto.bc', peak memory usage prior to this change
is 149MB and after is 143MB so the savings are around 2.5% of peak.
Looking at some passes which allocate many Instructions and Values, parseIR drops
from 54.25MB to 52.21MB while the Inliner calls to Instruction::clone() drops
from 28.20MB to 27.05MB.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239623
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 17:48:14 +0000 (17:48 +0000)]
Added a version of User::new for hung off uses.
There are now 2 versions of User::new. The first takes a size_t and is the current
implementation for subclasses which need 0 or more Use's allocated for their operands.
The new version takes no extra arguments to say that this subclass needs 'hung off uses'.
The HungOffUses bool is now set in this version of User::new and we can assert in
allocHungOffUses that we are allowed to have hung off uses.
This ensures we call the correct version of User::new for subclasses which need hung off uses.
A future commit will then allocate space for a single Use* which will be used
in place of User::OperandList once that field has been removed.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239622
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 17:48:10 +0000 (17:48 +0000)]
Rename NumOperands to make it clear its managed by the User. NFC.
This is to try make it very clear that subclasses shouldn't be changing
the value directly. Now that OperandList for normal instructions is computed
using the NumOperands, its critical that the NumOperands is accurate or we
could compute the wrong offset to the first operand.
I looked over all places which update NumOperands and they are all safe.
Hung off use User's don't use NumOperands to compute the OperandList so they
are safe to continue to manipulate it. The only other User which changed it
was GlobalVariable which has an optional init list but always allocated space
for a single Use. It was correctly setting NumOperands to 1 before setting an
initializer, and setting it to 0 after clearing the init list, so the order was safe.
Added some comments to that code to make sure that this isn't changed in future
without being aware of this constraint.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239621
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 17:48:05 +0000 (17:48 +0000)]
Replace all accesses to User::OperandList with getter and setter methods. NFC.
We don't want anyone to access OperandList directly as its going to be removed
and computed instead. This uses getter's and setter's instead in which we
can later change the underlying implementation of OperandList.
Reviewed by Duncan Exon Smith.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239620
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Jun 2015 17:23:39 +0000 (17:23 +0000)]
Have the ELF symbol predicates match more directly the spec.
The underlaying issues is that this code can't really know if an OS specific or
processor specific section number should return true or false.
One option would be to assert or return an error, but that looks like over
engineering since extensions are not that common.
It seems better to have these be direct implementation of the ELF spec so that
they are natural for someone familiar with ELF reading the code.
Code that does have to handle OS/Architecture specific values can do it at
a higher level.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239618
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Fri, 12 Jun 2015 16:13:54 +0000 (16:13 +0000)]
Don't create instructions from ConstantExpr's in CFLAliasAnalysis.
The CFLAA code currently calls ConstantExpr::getAsInstruction which creates an instruction from a constant expr.
We then pass that instruction to the InstVisitor to analyze it.
Its not necessary to create these instructions as we can just cast from Constant to Operator in the visitor. This is how other InstVisitor’s such as SelectionDAGBuilder handle ConstantExpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239616
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Bedwell [Fri, 12 Jun 2015 15:58:29 +0000 (15:58 +0000)]
In MSVC builds embed a VERSIONINFO resource in our exe and DLL files.
This reinstates my commits r238740/r238741 which I reverted due to a failure
in the clang-cl selfhost tests on Windows. I've now fixed the issue in
clang-cl that caused the failure so hopefully all should be well now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239612
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Jun 2015 12:42:13 +0000 (12:42 +0000)]
Remove a hack that tries to align '*'.
The alignment is not required, so we can just remove it for now.
The old code is a hack as it depends on the buffer management to find
the current column.
If the alignment is really desirable, the proper way to do it is
to pass in a formatted_raw_stream that knows the current column.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239603
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 12 Jun 2015 12:20:03 +0000 (12:20 +0000)]
Don't depend on the interleaving of stdout and stderr.
That can change as we change the buffering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239602
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexander Potapenko [Fri, 12 Jun 2015 11:27:06 +0000 (11:27 +0000)]
[ASan] format AddressSanitizer.cpp with `clang-format -style=Google`, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239601
91177308-0d34-0410-b5e6-
96231b3b80d8
John Brawn [Fri, 12 Jun 2015 09:38:51 +0000 (09:38 +0000)]
[ARM] Disabling vfp4 should disable fp16
ARMTargetParser::getFPUFeatures should disable fp16 whenever it
disables vfp4, as otherwise something like -mcpu=cortex-a7 -mfpu=none
leaves us with fp16 enabled (though the only effect that will have is
a wrong build attribute).
Differential Revision: http://reviews.llvm.org/D10397
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239599
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 12 Jun 2015 08:19:32 +0000 (08:19 +0000)]
Replace duplicated iplist<T> types with the corresponding typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239598
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 12 Jun 2015 05:15:27 +0000 (05:15 +0000)]
Rangify for loops, NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239596
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Fri, 12 Jun 2015 03:25:05 +0000 (03:25 +0000)]
LowerBitSets: Give names to aliases of unnamed bitset element objects.
It is valid for globals to be unnamed, but aliases must have a name. To avoid
creating invalid IR, we need to assign names to any aliases we create that
point to unnamed objects that have been moved into combined globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239590
91177308-0d34-0410-b5e6-
96231b3b80d8
Teresa Johnson [Fri, 12 Jun 2015 03:12:00 +0000 (03:12 +0000)]
Revert commit r239480 as it causes https://code.google.com/p/chromium/issues/detail?id=499508#c3.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239589
91177308-0d34-0410-b5e6-
96231b3b80d8