Commit Graph

120460 Commits

Author SHA1 Message Date
Chen Li
b3df24519c [ConstantFoldTerminator] Preserve make.implicit metadata when converting SwitchInst to BranchInst
Summary: llvm::ConstantFoldTerminator function can convert SwitchInst with single case (and default) to a conditional BranchInst. This patch adds support to preserve make.implicit metadata on this conversion.

Reviewers: sanjoy, weimingz, chenli

Subscribers: mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D11841

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244348 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 19:30:12 +00:00
Frederic Riss
e825981a7b [MCDwarf] Use more idiomatic [u]int8_t types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244347 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 19:19:44 +00:00
Simon Pilgrim
547527cc83 [InstCombine] Fix SSE2/AVX2 vector logical shift by constant
This patch fixes the sse2/avx2 vector shift by constant instcombine call to correctly deal with the fact that the shift amount is formed from the entire lower 64-bit and not just the lowest element as it currently assumes.

e.g.

%1 = tail call <4 x i32> @llvm.x86.sse2.psrl.d(<4 x i32> %v, <4 x i32> <i32 15, i32 15, i32 15, i32 15>)

In this case, (V)PSRLD doesn't perform a lshr by 15 but in fact attempts to shift by 64424509455 ((15 << 32) | 15) - giving a zero result.

In addition, this review also recognizes shift-by-zero from a ConstantAggregateZero type (PR23821).

Differential Revision: http://reviews.llvm.org/D11760

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244341 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 18:22:50 +00:00
Cong Hou
433c477edd NFC.
Use a parent class to avoid reduncant code when specializing GraphTraits for T and const T.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244340 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 18:04:17 +00:00
Nico Weber
6d6e4e4c1b Add functions to save and restore the PrettyStackTrace state.
PrettyStackTraceHead is a LLVM_THREAD_LOCAL, which means it's just a global
in LLVM_ENABLE_THREADS=NO builds.  If a CrashRecoveryContext is used with
code that uses PrettyStackEntries, and a crash happens, PrettyStackTraceHead is
currently not reset to its pre-crash value.  These functions make it possible
to add a cleanup to such code that does this.

(Not reseting the value then causes the assert in ~PrettyStackTraceEntry() to
fire if the code outside of the CrashRecoveryContext also uses
PrettyStackEntries -- for example, clang when building a module.)

Part of PR11974.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244338 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:47:03 +00:00
Nico Weber
2fe3acd745 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244337 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:32:06 +00:00
Rafael Espindola
9b171d27d0 Delete dead code. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244335 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:06:05 +00:00
Chad Rosier
7f6b762785 [ARM] Remove an unused reference to MachineRegisterInfo. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244334 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 17:02:29 +00:00
Rafael Espindola
09ad805fcf Don't use a DenseMap to handle SHT_SYMTAB_SHNDX.
It is already a convenient table.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244333 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:51:44 +00:00
Tom Stellard
e8ad273f98 AMDGPU/SI: Use correct encoding of vopc for VI in the assembler
Summary: We were using the SI encoding for VI.

Reviewers: arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11812

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244332 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:45:33 +00:00
Tom Stellard
3148bd5091 AMDGPU/SI: Add VI checks to vop3 assembler tests
Reviewers: arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11811

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244331 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:45:30 +00:00
Eric Christopher
9097e5d14f We're actually -Wmissing-field-initializers clean thanks to the cmake
build so check and turn on -Wmissing-field-initializers. While there,
reorganize the conditional warning code based on compiler to be a bit
more obvious and inside a switch statement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244330 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:44:47 +00:00
Rafael Espindola
0b35ff9dd4 Delete dead typedef. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244328 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:36:47 +00:00
Frederic Riss
e428f29a41 Use 'signed char' instead of 'char'
Hope this fixes the s390 and aarch64 bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244327 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:31:59 +00:00
Rafael Espindola
423d8e41fd add missing tests files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244323 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:35:49 +00:00
Tom Stellard
98203b8215 AMDGPU/SI: v_mac_legacy_f32 does not exist on VI
Reviewers: arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11810

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244322 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:34:30 +00:00
Tom Stellard
779291b8db AMDGPU/SI: Remove unused outs parameter from VOPC TableGen classes
Reviewers: arsenm

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11809

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244321 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:34:27 +00:00
Rafael Espindola
e1358aa4ce Add dynamic_table iterators back to ELF.h.
In tree they are only used by llvm-readobj, but it is also used by
https://github.com/mono/CppSharp.

While at it, add some missing error checking.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244320 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:25:20 +00:00
Frederic Riss
54c40cfb7b [dsymutil] Use the new MCDwarfLineTableParams customization to emit linetables
llvm-dsymutil has to be able to process debug info produced by other compilers
which use different line table settings. The testcase wasn't generated by
another compiler, but by a modified clang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244319 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:14:13 +00:00
Frederic Riss
796478f4f5 [MC/Dwarf] Allow to specify custom parameters for linetable emission.
NFC patch for current users, but llvm-dsymutil will use the new
functionality to adapt to the input linetable.

Based on a patch by Adrian Prantl.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244318 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 15:14:08 +00:00
Silviu Baranga
1962b1b6b7 Fix unused variable warning introduced in r244314
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244315 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 12:05:46 +00:00
Silviu Baranga
441de0574a [ARM] Update ReconstructShuffle to handle mismatched types
Summary:
Port the ReconstructShuffle function from AArch64 to ARM
to handle mismatched incoming types in the BUILD_VECTOR
node.

This fixes an outstanding FIXME in the ReconstructShuffle
code.

Reviewers: t.p.northover, rengolin

Subscribers: aemerson, llvm-commits, rengolin

Differential Revision: http://reviews.llvm.org/D11720

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244314 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 11:40:46 +00:00
John Brawn
bb8d0fbf02 Revert "Make global aliases have symbol size equal to their type"
This reverts r242520, as it caused pr24379. Also removes part of the test added
by r243874 that checks the size of alias symbols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244313 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 10:56:21 +00:00
NAKAMURA Takumi
34620e340b Tweak llvm/test/tools/dsymutil/arch-option.test to avoid globbing on mingw-w64.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244311 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 08:38:22 +00:00
NAKAMURA Takumi
52cfa5e534 ShrinkWrap.cpp: Tweak r244235 for a non-functional member, PredicateFtor. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244309 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 07:40:23 +00:00
JF Bastien
6d2f2ee4ab WebAssembly: textual emission uses expected opcode names
Summary: WebAssembly's tablegen instructions have the names WebAssembly expects, but by LLVM convention they're uppercase and suffixed with their type after an underscore. Leave the C++ code that way, but print outt he names WebAssembly expects (lowercase, no type). We could teach tablegen to do this later, maybe by using `!cast<string>(node)` in the .td files.

Reviewers: sunfish

Subscribers: jfb, llvm-commits

Differential Revision: http://reviews.llvm.org/D11776

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244305 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 01:57:03 +00:00
Tom Stellard
9baa291a86 ELF: Add AMDGPU specific defintions
Reviewers: rafael

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11458

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244303 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 01:35:24 +00:00
Duncan P. N. Exon Smith
d2914e38f0 ValueMapper: Resolve uniquing cycles more aggressively
As a follow-up to r244181, resolve uniquing cycles underneath distinct
nodes on the fly.  This prevents uniquing cycles in early operands from
affecting later operands.  It also removes an iteration through distinct
nodes' operands.

No real functional change here, just more prompt resolution of temporary
nodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244302 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 00:44:55 +00:00
Duncan P. N. Exon Smith
db5b592a6e ValueMapper: Pull out helper to resolve cycles, NFC
Pull out a helper for resolving uniquing cycles of `Metadata` to remove
the boiler-plate of downcasting to `MDNode`.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244301 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 00:39:26 +00:00
Davide Italiano
e06606ffd1 [llvm-readobj] Convert to range-loops.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244300 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 00:35:28 +00:00
Alex Lorenz
b12f9b3954 MIR Serialization: Fix serialization of unnamed IR block references.
The block address machine operands can reference IR blocks in other functions.
This commit fixes a bug where the references to unnamed IR blocks in other
functions weren't serialized correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244299 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 23:57:04 +00:00
Alex Lorenz
263d80f920 MIR Parser: Simplify the token's string value handling.
This commit removes the 'StringOffset' and 'HasStringValue' fields from the
MIToken struct and simplifies the 'stringValue' method which now returns
the new 'StringValue' field.

This commit also adopts a different way of initializing the lexed tokens -
instead of constructing a new MIToken instance, the lexer resets the old token
using the new 'reset' method and sets its attributes using the new
'setStringValue', 'setOwnedStringValue', and 'setIntegerValue' methods.

Reviewers: Sean Silva

Differential Revision: http://reviews.llvm.org/D11792


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244295 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 23:17:42 +00:00
Sean Silva
7515d33b6c [LangRef] Cleanup some stray whitespace inconsistencies.
Patch by Debora Setton Sanches! <setton.debora@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244294 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:56:48 +00:00
Sean Silva
1709c2bf16 [LangRef] Tiny editorial fixes.
Patch by Debora Setton Sanches! <setton.debora@gmail.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244293 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:56:24 +00:00
Alex Lorenz
32dcc28f85 Add initial documentation for the MIR serialization format.
Differential Revision: http://reviews.llvm.org/D11736


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244292 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:55:19 +00:00
Juergen Ributzka
138cd6dae8 [AArch64][FastISel] Always use AND before checking the branch flag.
When we are not emitting the condition for the branch, because the condition is
in another BB or SDAG did the selection for us, then we have to mask the flag in
the register with AND.

This is required when the condition comes from a truncate, because SDAG only
truncates down to a legal size of i32.

This fixes rdar://problem/22161062.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244291 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:44:15 +00:00
Juergen Ributzka
6f653ee44c Revert "[AArch64][FastISel] Add more truncation tests." and "[AArch64][FastISel] Always use an AND instruction when truncating to non-legal types."
This reverts commit r243198 and 243304.

Turns out this wasn't the correct fix for this problem. It works only within
FastISel, but fails when the truncate is selected by SDAG.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244287 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:13:48 +00:00
Sean Silva
3153f23b24 [compatibility.ll] Cover explicitly named comdats.
Patch by Vedant Kumar! <vsk@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244284 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:04:21 +00:00
Sean Silva
c169fa6f10 Describe the process better.
Patch by Vedant Kumar! <vsk@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244283 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 22:03:54 +00:00
Rafael Espindola
8a0ff180e8 Move to llvm-readobj code that is only used there.
lld might end up using a small part of this, but it will be in a much
refactored form. For now this unblocks avoiding the full section scan in the
ELFFile constructor.

This also has a (very small) error handling improvement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244282 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:54:37 +00:00
David Majnemer
ecc0eab4a8 Revert accidentally committed WinEHPrepare changes
This reverts commit r244272, r244273, r244274, and r244275.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244278 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:13:51 +00:00
David Majnemer
5931147ea2 [IR] Remove TerminateInst's "NameStr" argument
TerminateInst can't have a name because it doesn't produce a result.  No
functionality change is intended, this is just a cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244276 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:08:36 +00:00
David Majnemer
a94c4c0c2b PHIs don't need to be postprocessed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244275 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:08:34 +00:00
David Majnemer
d284a380ab Handle PHI nodes prefacing EH pads too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244274 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:08:32 +00:00
David Majnemer
70200146b4 handle phi nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244273 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:08:30 +00:00
David Majnemer
cb675bb03a [WinEHPrepare] Add rudimentary support for the new EH instructions
Summary:
This adds somewhat basic preparation functionality including:
- Formation of funclets via coloring basic blocks.
- Cloning of polychromatic blocks to ensure that funclets have unique
  program counters.
- Demotion of values used between different funclets.
- Some amount of cleanup once we have removed predecessors from basic
  blocks.
- Verification that we are left with a CFG that makes some amount of
  sense.

N.B. Arguments and numbering still need to be done.

Reviewers: rnk, JosephTremoulet

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D11750

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244272 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:07:55 +00:00
Frederic Riss
af511be69a [dsymutil] Implement dSYM bundle creation
A dSYM bundle is a file hierarchy that looks slike this:
 <bundle name>.dSYM/
     Contents/
        Info.plist
        Resources/
           DWARF/
              <DWARF file(s)>

This is the default output mode of dsymutil.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244270 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:05:06 +00:00
Frederic Riss
e88f2f375e [dsymutil] Add (unimplemented) --flat option
dsymutil should by default generate dSYM bundles which are filesystem
hierarchies containing the debug info and an additional Info.plist.
Currently llvm-dsymutil emits raw binaries containing the debug info.
This is what we call the 'flat mode'. Add a -f/-flat option that is
supposed to enable that flat mode, but don't wire it for now, only
pass it to the tests that will need it to stay functional once we
do bundle generation by default.
This basically makes this commit NFC and removes the noise from the
actual commit that adds support for bundle generation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244269 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:05:01 +00:00
Frederic Riss
9a7f4507ab Thread premissions through sys::fs::create_director{y|ies}
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244268 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:04:55 +00:00
Reid Kleckner
cf166560f5 [WinEH] Add documentation motivating the new EH instructions
This adds documentation on how to use the new EH instructions added in
r243766.

Reviewers: majnemer, reames

Differential Revision: http://reviews.llvm.org/D11565

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244267 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-06 21:01:32 +00:00