Philip Reames [Sun, 26 Apr 2015 19:41:23 +0000 (19:41 +0000)]
Don't Place Entry Safepoints Before the llvm.frameescape() Intrinsic
llvm.frameescape() intrinsic is not a real call. The intrinsic can only exist in the entry block. Inserting a gc.statepoint() before llvm.frameescape() may split the entry block, and push the intrinsic out of the entry block.
Patch by: Swaroop.Sridhar@microsoft.com
Differential Revision: http://reviews.llvm.org/D8910
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235820
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexei Starovoitov [Sun, 26 Apr 2015 01:58:08 +0000 (01:58 +0000)]
[bpf] fix build and remove a compiler warning in Release mode
Patch by Brenden Blanco.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235814
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sun, 26 Apr 2015 00:53:33 +0000 (00:53 +0000)]
R600: Remove / merge redundant testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235813
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 25 Apr 2015 20:55:25 +0000 (20:55 +0000)]
[x86] instcombine more cases of insertps into a shufflevector
This is a follow-on to D8833 (insertps optimization when the zero mask is not used).
In this patch, we check for the case where the zmask is used, but both input vectors
to the insertps intrinsic are the same operand or the zmask overrides the destination
lane. This lets us replace the 2nd shuffle input operand with the zero vector.
Differential Revision: http://reviews.llvm.org/D9257
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235810
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sat, 25 Apr 2015 20:41:51 +0000 (20:41 +0000)]
add SSE run to check non-AVX codegen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235809
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 25 Apr 2015 17:25:13 +0000 (17:25 +0000)]
[ARM] Simplify code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235803
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 25 Apr 2015 14:46:53 +0000 (14:46 +0000)]
[hexagon] Use range-based for loops. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235802
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 25 Apr 2015 14:46:46 +0000 (14:46 +0000)]
[hexagon] Remove setHexLibcallName, it leaks memory.
Just spell out the full names, it's not that much more code.
No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235801
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 25 Apr 2015 12:12:43 +0000 (12:12 +0000)]
line endings fix
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235800
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sat, 25 Apr 2015 01:47:39 +0000 (01:47 +0000)]
build: make libunwind a proper project
This allows the build infrastructure to properly detect and build libunwind.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235796
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 24 Apr 2015 23:34:46 +0000 (23:34 +0000)]
Fix build error from accidental change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235792
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 24 Apr 2015 23:27:32 +0000 (23:27 +0000)]
[WinEH] Find correct cloned entry block for outlined handler functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235791
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 24 Apr 2015 23:10:38 +0000 (23:10 +0000)]
[WinEH] Find correct cloned entry block for outlined handler functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235789
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Fri, 24 Apr 2015 22:18:46 +0000 (22:18 +0000)]
Assert that Process::FindInEnvPath() is passed a relative path.
It misbehaves with absolute paths. (So does path::append().)
Goes with clang r235787.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235788
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:07:31 +0000 (22:07 +0000)]
Linker: Copy over function metadata attachments
Update `lib/Linker` to handle `Function` metadata attachments. The
attachments stick with the function body.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235786
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 22:04:41 +0000 (22:04 +0000)]
IR: Add assembly/bitcode support for function metadata attachments
Add serialization support for function metadata attachments (added in
r235783). The syntax is:
define @foo() !attach !0 {
Metadata attachments are only allowed on functions with bodies. Since
they come before the `{`, they're not really part of the body; since
they require a body, they're not really part of the header. In
`LLParser` I gave them a separate function called from `ParseDefine()`,
`ParseOptionalFunctionMetadata()`.
In bitcode, I'm using the same `METADATA_ATTACHMENT` record used by
instructions. Instruction metadata attachments are included in a
special "attachment" block at the end of a `Function`. The attachment
records are laid out like this:
InstID (KindID MetadataID)+
Note that these records always have an odd number of fields. The new
code takes advantage of this to recognize function attachments (which
don't need an instruction ID):
(KindID MetadataID)+
This means we can use the same attachment block already used for
instructions.
This is part of PR23340.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235785
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:53:27 +0000 (21:53 +0000)]
Verifier: Function metadata attachments require a body
Add a verifier check that only functions with bodies have metadata
attachments. This should help catch bugs in frontends and
transformation passes. Part of PR23340.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235784
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:51:02 +0000 (21:51 +0000)]
IR: Add Function metadata attachments
Add IR support for `Metadata` attachments. Assembly and bitcode support
will follow shortly, but for now we just have unit tests. This is part
of PR23340.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235783
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:29:36 +0000 (21:29 +0000)]
LLParser: Simplify ParseInstructionMetadata(), NFC
Remove unused `PFS` variable and take the `Instruction` by reference.
(Not really related to PR23340, but might as well clean this up while
I'm here.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235782
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Fri, 24 Apr 2015 21:28:00 +0000 (21:28 +0000)]
[DAGCombiner] Fix the type used in canFoldInAddressingMode to account for the
right scaling.
In the function canFoldInAddressingMode, VT is computed as the type of the
destination/source of a LOAD/STORE operations, instead of the memory type of the
operation.
On targets with a scaling factor on the offset of the LOAD/STORE operations, the
function may return false for actually valid cases. This may then prevent the
selection of profitable pre or post indexed load/store operations, and instead
select pre or post indexed load/store for unprofitable cases.
Patch by Francois de Ferriere <francois.de-ferriere@st.com>!
Differential Revision: http://reviews.llvm.org/D9146
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235780
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:21:57 +0000 (21:21 +0000)]
LLParser: Split out ParseMetadataAttachment(), NFC
Make the code reusable for `Function` metadata attachments (PR23340).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235778
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 24 Apr 2015 21:16:07 +0000 (21:16 +0000)]
[opaque pointer type] Verifier/AutoUpgrade: Remove a few uses of PointerType::getElementType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235777
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:06:21 +0000 (21:06 +0000)]
AsmWriter: Parameterize the syntactic separator for attachments
Parameterize the separator for attachments, since `Function` metadata
attachments (PR23340) aren't going to use a `,` (comma). No real
functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235775
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 21:03:05 +0000 (21:03 +0000)]
AsmWriter: Only collect attachment names once per module
Collect metadata names once per `AssemblyWriter` instead of every time
we need to print some attachments. Just a drive-by; this caught my eye
while I was refactoring the code in r235772.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235774
91177308-0d34-0410-b5e6-
96231b3b80d8
Kaelyn Takata [Fri, 24 Apr 2015 21:02:18 +0000 (21:02 +0000)]
Remove an unused variable to prevent -Werror build failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235773
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:59:52 +0000 (20:59 +0000)]
AsmWriter: Split out code for printing Metadata attachments, NFC
Refactor the code for printing `Instruction` metadata attachments so it
can be reused for `Function`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235772
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 24 Apr 2015 20:57:56 +0000 (20:57 +0000)]
SimplifyCFG: Correctly handle switch lookup tables which fully cover the input type and use bit tests to check for holes
When using bit tests for hole checks, we call AddPredecessorToBlock to give the
phi node a value from the bit test block. This would break if we've
previously called removePredecessor on the default destination because the
switch is fully covered.
Test case by Mark Lacey.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235771
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:47:23 +0000 (20:47 +0000)]
IR: Use a bitmask to access GlobalObject subclass data
Make room for more than just `Function::isMaterializable()` in the
`GlobalObject` subclass data bitfield. Since we're treating it like a
bitfield, change `Function::Function()` to zero-out the whole thing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235770
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:36:25 +0000 (20:36 +0000)]
IR: Extract set logic from Instruction attachments, NFC
Extract the set logic for metadata attachments from `Instruction` so it
can be reused for `Function` (PR23340).
This data structure makes a `SmallVector<>` look (a little) like a map,
just doing the bare minimum to support the `Instruction` (and soon,
`Function`) metadata API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235769
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Apr 2015 20:25:05 +0000 (20:25 +0000)]
[SEH] Implement GetExceptionCode in __except blocks
This introduces an intrinsic called llvm.eh.exceptioncode. It is lowered
by copying the EAX value live into whatever basic block it is called
from. Obviously, this only works if you insert it late during codegen,
because otherwise mid-level passes might reschedule it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235768
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:23:44 +0000 (20:23 +0000)]
IR: Use remove_if for Instruction::dropUnknownMetadata()
Technically the operations are different -- the old logic moved items
from the back into the opened-up slots, instead of the usual
`remove_if()` logic of a slow and a fast iterator -- but unless a
profile tells us otherwise I prefer the simpler logic here. Regardless,
there shouldn't be an observable function change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235767
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:19:13 +0000 (20:19 +0000)]
IR: Remove MDMapTy and MDPairTy typedefs, NFC
Remove some typedefs in preparation for factoring out attachment logic
from `Instruction`.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235764
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 20:16:42 +0000 (20:16 +0000)]
IR: Rename LLVMContextImpl::MetadataStore to InstructionMetadata
Rename `MetadataStore` to the more explicit `InstructionMetadata`. This
will make room for `FunctionMetadata` (start of PR23340).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235763
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 24 Apr 2015 19:32:54 +0000 (19:32 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to the invoke instruction
Same as r235145 for the call instruction - the justification, tradeoffs,
etc are all the same. The conversion script worked the same without any
false negatives (after replacing 'call' with 'invoke').
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235755
91177308-0d34-0410-b5e6-
96231b3b80d8
Sundeep Kushwaha [Fri, 24 Apr 2015 19:22:02 +0000 (19:22 +0000)]
[PATCH] [Hexagon] Adding a test case for calling convention.
http://reviews.llvm.org/D9241
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235754
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 24 Apr 2015 19:11:51 +0000 (19:11 +0000)]
[AsmPrinter] Make AsmPrinter's OutStreamer member a unique_ptr.
AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a
reference for this is crufty.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235752
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 24 Apr 2015 18:13:27 +0000 (18:13 +0000)]
Revert changes to LTO test case since llvm-lto can't handle textual IR inputs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235738
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 24 Apr 2015 18:06:09 +0000 (18:06 +0000)]
Skip extra LLVM IR assemble/disassemble steps in some tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235736
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 24 Apr 2015 18:06:06 +0000 (18:06 +0000)]
[opaque pointer type] bitcode: add explicit callee type to invoke instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235735
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Fri, 24 Apr 2015 17:39:16 +0000 (17:39 +0000)]
Fix LoopInterchange/reductions.ll test for debug builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235734
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 24 Apr 2015 17:14:16 +0000 (17:14 +0000)]
Teach AArch64\lit.local.cfg the new triple names windows-gnu and windows-msvc.
Tests were failing when built with -DLLVM_DEFAULT_TARGET_TRIPLE=i686-pc-windows-gnu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235733
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 24 Apr 2015 17:09:20 +0000 (17:09 +0000)]
[CMake] Fix for PR 23328: LLVM_OPTIMIZED_TABLEGEN broken
In CMake dependencies can be filenames or targets, and targets can't be filenames. The Ninja generator handles filename dependencies because it generates targets for every output file from a command. For example:
add_custom_command(OUTPUT foo.txt COMMAND touch foo.txt)
With the Ninja generator this generates a target foo.txt, but with the Makefile generator it doesn't. This is probably because Ninja explicitly requires these hard dependency ties, and Make just behaves oddly in general.
To fix this we need to make the tablegen actions depend on a target rather than a filename.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235732
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 24 Apr 2015 16:56:24 +0000 (16:56 +0000)]
Linker: Update -override testcase to check callers
Check that `@main` is calling `@foo2` (the renamed internal function),
not the `@foo` with external linkage that's been pulled in from the
override file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235730
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 24 Apr 2015 16:53:55 +0000 (16:53 +0000)]
Switch lowering: fix APInt overflow causing infinite loop / OOM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235729
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 24 Apr 2015 16:22:19 +0000 (16:22 +0000)]
[WinEH] Split the landingpad BB instead of cloning it
This means we don't have to RAUW the landingpad instruction and
landingpad BB, which is a nice win.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235725
91177308-0d34-0410-b5e6-
96231b3b80d8
Diego Novillo [Fri, 24 Apr 2015 15:46:41 +0000 (15:46 +0000)]
Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235723
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 24 Apr 2015 15:39:47 +0000 (15:39 +0000)]
Use the cleaner syntx value initialization to zero initialize POD structs.
Suggestion from David Blaikie!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235721
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 24 Apr 2015 15:10:15 +0000 (15:10 +0000)]
Silence clang warning: private field 'data_' is not used.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235720
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Fri, 24 Apr 2015 14:26:27 +0000 (14:26 +0000)]
Silence clang warning: missing field 'Dr0' initializer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235719
91177308-0d34-0410-b5e6-
96231b3b80d8
Vasileios Kalintiris [Fri, 24 Apr 2015 13:48:19 +0000 (13:48 +0000)]
[mips][FastISel] Specify which types we handle for integer extension.
Summary:
Perform integer extension only when the destination type is one of
i8, i16 & i32 and when the source type is i1, i8 or i16. For other
combinations we fall back to SelectionDAG.
This fixes the test MultiSource/Benchmarks/7zip that was failing in our
out-of-tree MIPS buildbots.
Reviewers: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9243
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235718
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Fri, 24 Apr 2015 12:51:45 +0000 (12:51 +0000)]
Removing dead code; NFC. This code was triggering a C4718 warning (recursive call has no side effects, deleting) with MSVC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235717
91177308-0d34-0410-b5e6-
96231b3b80d8
Filipe Cabecinhas [Fri, 24 Apr 2015 11:30:15 +0000 (11:30 +0000)]
[BitcodeReader] Fix asserts when we read a non-vector type for insert/extract/shuffle
Added some additional checking for vector types + tests.
Bug found with AFL fuzz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235710
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Fri, 24 Apr 2015 07:42:35 +0000 (07:42 +0000)]
Correct extractelement constant folding
Summary: Constant folding of extractelement with out-of-bound index produces undef also for indexes bigger than 64bit (instead of crash assert failure as before)
Test Plan: Unit tests included.
Reviewers: majnemer
Reviewed By: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9225
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235700
91177308-0d34-0410-b5e6-
96231b3b80d8
Pawel Bylica [Fri, 24 Apr 2015 07:38:39 +0000 (07:38 +0000)]
Fix APInt long division algorithm
Summary: This patch fixes step D4 of Knuth's division algorithm implementation. Negative sign of the step result was not always detected due to incorrect "borrow" handling.
Test Plan: Unit test that reveals the bug included.
Reviewers: chandlerc, yaron.keren
Reviewed By: yaron.keren
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D9196
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235699
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Apr 2015 06:49:44 +0000 (06:49 +0000)]
[TableGen] Don't leak Expanders and Operators in SetTheory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235697
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 24 Apr 2015 05:38:48 +0000 (05:38 +0000)]
[TableGen] Fix all remaining memory leaks of Init and RecTy objects.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235696
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 24 Apr 2015 04:22:39 +0000 (04:22 +0000)]
Resurrect r235688
We should skip vector types which are not SCEVable.
test/CodeGen/NVPTX/sched2.ll passes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235695
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 24 Apr 2015 03:26:11 +0000 (03:26 +0000)]
Revert r235688
Seems breaking builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235690
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 24 Apr 2015 02:57:30 +0000 (02:57 +0000)]
[NVPTX] Emits "generic()" depending on the original address space
Summary:
Fixes a bug in the NVPTX codegen. The code used to miss necessary "generic()"
on aggregates of addrspacecasts.
Test Plan: addrspacecast-gvar.ll
Reviewers: eliben, jholewinski
Reviewed By: jholewinski
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9130
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235689
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Fri, 24 Apr 2015 02:54:06 +0000 (02:54 +0000)]
[NVPTX] enable NaryReassociate in NVPTX
Summary:
We run NaryReassociate right after SLSR because SLSR enables many
opportunities for NaryReassociate. For example, in nary-slsr.ll
foo((a + b) + c);
foo((a + b * 2) + c);
foo((a + b * 3) + c); // 2 muls and 6 adds
after SLSR:
ab = a + b;
foo(ab + c);
ab2 = ab + b;
foo(ab2 + c);
ab3 = ab2 + b;
foo(ab3 + c); // 6 adds
after NaryReassociate:
abc = (a + b) + c;
foo(abc);
ab2c = abc + b;
foo(ab2c);
ab3c = ab2c + b;
foo(ab3c); // 4 adds
Test Plan: nary-slsr.ll
Reviewers: jholewinski, eliben
Reviewed By: eliben
Subscribers: jholewinski, llvm-commits
Differential Revision: http://reviews.llvm.org/D9066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235688
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 24 Apr 2015 01:57:58 +0000 (01:57 +0000)]
R600/SI: Fix verifier error when producing v_madmk_f32
Copy the kill flags when swapping the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235687
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 24 Apr 2015 01:15:27 +0000 (01:15 +0000)]
Improve isTriviallyReMaterializable() documentation.
This should make it clear under which narrow circumstances implicit
physreg uses are okay when rematerializing and prevent people from
accidentally allowing too much when overriding
isReallyTriviallyReMaterializable() even with the weaker assert in the
RegisterCoalescer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235679
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 24 Apr 2015 00:25:50 +0000 (00:25 +0000)]
R600/RegisterCoalescer: Enable more rematerialization/add missing testcase
This enables the rematerialization of some R600 MOV instructions in the
RegisterCoalescer and adds a testcase for r235668.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235675
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 24 Apr 2015 00:10:27 +0000 (00:10 +0000)]
Fix a couple of typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235674
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Fri, 24 Apr 2015 00:01:37 +0000 (00:01 +0000)]
RegisterCoalescer: implicit phsreg uses are fine when rematerializing
The target hooks should have already checked them. This change is
necessary to enable the remateriailzation on R600.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235673
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 23 Apr 2015 23:34:51 +0000 (23:34 +0000)]
Revert accidentally committed "MC: Allow targets to stop symbol name quoting"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235672
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 23 Apr 2015 23:34:48 +0000 (23:34 +0000)]
R600/SI: Special case v_mov_b32 as really rematerializable
This should be fixed to properly understand all rematerializable
instructions while ignoring implicit reads of exec.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235671
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 23 Apr 2015 23:34:05 +0000 (23:34 +0000)]
MC: Allow targets to stop symbol name quoting
Currently symbol names are printed in quotes if it contains something
outside of the arbitrary set of characters that isAcceptableChar tests
for. On somem targets, it is never OK to print a symbol name in quotes
so allow targets to opt out of this behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235670
91177308-0d34-0410-b5e6-
96231b3b80d8
Matthias Braun [Thu, 23 Apr 2015 23:24:36 +0000 (23:24 +0000)]
RegisterCoalescer: Avoid unnecessary register class widening for some rematerializations
I couldn't provide a testcase as none of the public targets has wide
register classes with alot of subregisters and at the same time an
instruction which "ReMaterializable" and "AsCheapAsAMove" (could
probably be added for R600).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235668
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Apr 2015 23:22:33 +0000 (23:22 +0000)]
Re-commit "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
This reverts commit r235617.
r235649 should have addressed the problems.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235667
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Smith [Thu, 23 Apr 2015 23:22:26 +0000 (23:22 +0000)]
Fix modules build post-r235612.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235666
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 23 Apr 2015 23:16:22 +0000 (23:16 +0000)]
[PowerPC] Support register name prefixes for vector registers
Match binutils by supporting the optional register name prefix for new vector
registers ("vs" for VSX registers and "q" for QPX registers).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235665
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 23 Apr 2015 23:05:08 +0000 (23:05 +0000)]
[PowerPC] Use sync inst alias when printing
So long as the choice between printing msync and sync is not ambiguous, we can
print 'sync 0' and just 'sync'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235663
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 22:59:24 +0000 (22:59 +0000)]
R600: Correctly lower CONCAT_VECTOR nodes with more than 2 operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235662
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Thu, 23 Apr 2015 22:55:48 +0000 (22:55 +0000)]
Fix comment for NoCommonBits.
Maybe there is a better wording, but at least it should be technically
correct now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235660
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 23 Apr 2015 22:47:57 +0000 (22:47 +0000)]
[PowerPC] Add asm/disasm support for dcbt with hint
Add assembler/disassembler support for dcbt/dcbtst (and aliases) with the hint
field specified (non-zero). Unforunately, the syntax for this instruction is
special in that it differs for server vs. embedded cores:
dcbt ra, rb, th [server]
dcbt th, ra, rb [embedded]
where th can be omitted when it is 0. dcbtst is the same. Thus we need to play
games in the parser and the printer to flip the operands around on the embedded
cores. We'll use the server syntax as the default (binutils currently uses the
embedded form by default, but IBM is changing that).
We also stop marking dcbtst as having unmodeled side effects (this is not
necessary, it is just a hint like dcbt -- noticed by inspection, so no separate
test case).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235657
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 23 Apr 2015 22:38:36 +0000 (22:38 +0000)]
[WinEH] Ignore filter clauses while mapping landing pad blocks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235656
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Apr 2015 21:36:32 +0000 (21:36 +0000)]
Remove trivial assert to fix NDEBUG Werror builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235652
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 23 Apr 2015 21:36:23 +0000 (21:36 +0000)]
Recommit r235458: [opaque pointer type] Avoid using PointerType::getElementType for a few cases of CallInst
(reverted in r235533)
Original commit message:
"Calls to llvm::Value::mutateType are becoming extra-sensitive now that
instructions have extra type information that will not be derived from
operands or result type (alloca, gep, load, call/invoke, etc... ). The
special-handling for mutateType will get more complicated as this work
continues - it might be worth making mutateType virtual & pushing the
complexity down into the classes that need special handling. But with
only two significant uses of mutateType (vectorization and linking) this
seems OK for now.
Totally open to ideas/suggestions/improvements, of course.
With this, and a bunch of exceptions, we can roundtrip an indirect call
site through bitcode and IR. (a direct call site is actually trickier...
I haven't figured out how to deal with the IR deserializer's lazy
construction of Function/GlobalVariable decl's based on the type of the
entity which means looking through the "pointer to T" type referring to
the global)"
The remapping done in ValueMapper for LTO was insufficient as the types
weren't correctly mapped (though I was using the post-mapped operands,
some of those operands might not have been mapped yet so the type
wouldn't be post-mapped yet). Instead use the pre-mapped type and
explicitly map all the types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235651
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Apr 2015 21:22:30 +0000 (21:22 +0000)]
[WinEH] Replace more lpad value uses with undef
We were asserting on code like this:
extern "C" unsigned long _exception_code();
void might_crash(unsigned long);
void foo() {
__try {
might_crash(0);
} __except(1) {
might_crash(_exception_code());
}
}
Gtest and many other libraries get the exception code from the __except
block. What's supposed to happen here is that EAX is live into the
__except block, and it contains the exception code. Eventually we'll
represent that as a use of the landingpad ehptr value, but for now we
can replace it with undef.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235649
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 23 Apr 2015 21:17:39 +0000 (21:17 +0000)]
[MachineCopyPropagation] Handle undef flags conservatively so that we do not
remove copies that are useful after breaking some hardware dependencies.
In other words, handle this kind of situations conservatively by assuming reg2
is redefined by the undef flag.
reg1 = copy reg2
= inst reg2<undef>
reg2 = copy reg1
Copy propagation used to remove the last copy.
This is incorrect because the undef flag on reg2 in inst, allows next
passes to put whatever trashed value in reg2 that may help.
In practice we end up with this code:
reg1 = copy reg2
reg2 = 0
= inst reg2<undef>
reg2 = copy reg1
This fixes PR21743.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235647
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:57:39 +0000 (20:57 +0000)]
Unbreak build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235646
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:42:20 +0000 (20:42 +0000)]
[Hexagon] Minor cleanup in HexagonFrameLowering
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235645
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 20:32:01 +0000 (20:32 +0000)]
R600/SI: Fix indirect addressing with a negative constant offset
When the base register index of the vector plus the constant offset
was less than zero, we were passing the wrong base register to the indirect
addressing instruction.
In this case, we need to set the base register to v0 and then add
the computed (negative) index to m0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235641
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Apr 2015 20:31:35 +0000 (20:31 +0000)]
Thumb2: When applying branch optimizations, visit branches in reverse order.
The order in which branches appear in ImmBranches is approximately their
order within the function body. By visiting later branches first, we reduce
the distance between earlier forward branches and their targets, making it
more likely that the cbn?z optimization, which can only apply to forward
branches, will succeed for those earlier branches.
Differential Revision: http://reviews.llvm.org/D9185
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235640
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Apr 2015 20:31:32 +0000 (20:31 +0000)]
ARM: When re-creating a branch via InsertBranch, preserve CPSR flags.
In particular, this preserves the kill flag, which allows the Thumb2 cbn?z
optimization to be applied in cases where a branch has been re-created after
the live variables analysis pass, e.g. by the machine block placement pass.
This appears to be low risk; a number of other targets seem to already be
doing something similar, e.g. AArch64, PowerPC.
Differential Revision: http://reviews.llvm.org/D9184
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235639
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Apr 2015 20:31:30 +0000 (20:31 +0000)]
Thumb2: When optimizing for size, do not if-convert branches involving comparisons with zero.
This allows the constant island pass to lower these branches to cbn?z
instructions, resulting in a shorter instruction sequence.
Differential Revision: http://reviews.llvm.org/D9183
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235638
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Apr 2015 20:31:26 +0000 (20:31 +0000)]
ARM: When spilling extra registers for alignment, prefer low registers on all Thumb targets.
This makes it more likely that we can use the 16-bit push and pop instructions
on Thumb-2, saving around 4 bytes per function.
Differential Revision: http://reviews.llvm.org/D9165
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235637
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 23 Apr 2015 20:31:22 +0000 (20:31 +0000)]
ARM: Only enforce 4-byte alignment on Thumb-2 functions with constant pools.
This appears to have been introduced back in r76698 as part of an unrelated
change. I can find no official ARM documentation stating that Thumb-2 functions
require 4-byte alignment; in fact, ARM documentation appears to contradict
this (see, e.g., ARM Architecture Reference Manual Thumb-2 Supplement,
section 2.6.1: "Thumb-2 enforces 16-bit alignment on all instructions.").
Also remove code that sets alignment for ARM functions, which is redundant
with code in the MachineFunction constructor, and remove the hidden
-arm-align-constant-islands flag, which has been enabled by default since
r146739 (Dec 2011) and has probably received sufficient testing by now.
Differential Revision: http://reviews.llvm.org/D9138
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235636
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Thu, 23 Apr 2015 20:26:21 +0000 (20:26 +0000)]
[Hexagon] Fix compiler warnings in release build
Patch by Aditya Nandakumar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235635
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Thu, 23 Apr 2015 20:09:20 +0000 (20:09 +0000)]
[getUnderlyingOjbects] Analyze loop PHIs further to remove false positives
Specifically, if a pointer accesses different underlying objects in each
iteration, don't look through the phi node defining the pointer.
The motivating case is the underlyling-objects-2.ll testcase. Consider
the loop nest:
int **A;
for (i)
for (j)
A[i][j] = A[i-1][j] * B[j]
This loop is transformed by Load-PRE to stash away A[i] for the next
iteration of the outer loop:
Curr = A[0]; // Prev_0
for (i: 1..N) {
Prev = Curr; // Prev = PHI (Prev_0, Curr)
Curr = A[i];
for (j: 0..N)
Curr[j] = Prev[j] * B[j]
}
Since A[i] and A[i-1] are likely to be independent pointers,
getUnderlyingObjects should not assume that Curr and Prev share the same
underlying object in the inner loop.
If it did we would try to dependence-analyze Curr and Prev and the
analysis of the corresponding SCEVs would fail with non-constant
distance.
To fix this, the getUnderlyingObjects API is extended with an optional
LoopInfo parameter. This is effectively what controls whether we want
the above behavior or the original. Currently, I only changed to use
this approach for LoopAccessAnalysis.
The other testcase is to guard the opposite case where we do want to
look through the loop PHI. If we step through an array by incrementing
a pointer, the underlying object is the incoming value of the phi as the
loop is entered.
Fixes rdar://problem/
19566729
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235634
91177308-0d34-0410-b5e6-
96231b3b80d8
Jingyue Wu [Thu, 23 Apr 2015 20:00:04 +0000 (20:00 +0000)]
[NVPTX] run SeparateConstOffsetFromGEP before SLSR
Summary:
We pick this order because SeparateConstOffsetFromGEP may create more
opportunities for SLSR.
Test Plan:
reassociate-geps-and-slsr.ll
no performance regression on internal benchmarks
Reviewers: meheff
Subscribers: llvm-commits, jholewinski
Differential Revision: http://reviews.llvm.org/D9230
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235632
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 19:33:55 +0000 (19:33 +0000)]
R600/SI: Add missing -mcpu=SI to assembler test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235630
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 19:33:54 +0000 (19:33 +0000)]
R600/SI: Add assembler support for all CI and VI VOP1 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235629
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 19:33:52 +0000 (19:33 +0000)]
R600/SI: v_mov_fed_b32 does not exist on VI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235628
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 19:33:51 +0000 (19:33 +0000)]
R600/SI: Use a better error message for unsupported instructions in the assembler
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235627
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 23 Apr 2015 19:33:48 +0000 (19:33 +0000)]
R600/SI: Improve AsmParser support for forced e64 encoding
We can now force e64 encoding even when the operands would be legal
for e32 encoding.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235626
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Kaylor [Thu, 23 Apr 2015 18:37:39 +0000 (18:37 +0000)]
[WinEH] Handle stubs for outlined functions that have only unreached terminators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235618
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 23 Apr 2015 18:34:01 +0000 (18:34 +0000)]
Revert "[SEH] Remove the old __C_specific_handler code now that WinEHPrepare works"
We still have some "uses remain after removal" issues in -O0 builds.
This reverts commit r235557.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235617
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 23 Apr 2015 18:30:38 +0000 (18:30 +0000)]
[PowerPC] Enable printing instructions using aliases
TableGen had been nicely generating code to print a number of instructions using
shorter aliases (and PowerPC has plenty of short mnemonics), but we were not
calling it. For some of the aliases we support in the parser, TableGen can't
infer the "inverse" alias relationship, so there is still more to do.
Thus, after some hours of updating test cases...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235616
91177308-0d34-0410-b5e6-
96231b3b80d8