David Majnemer [Thu, 6 Aug 2015 21:08:34 +0000 (21:08 +0000)]
PHIs don't need to be postprocessed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244275
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 6 Aug 2015 21:08:32 +0000 (21:08 +0000)]
Handle PHI nodes prefacing EH pads too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244274
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 6 Aug 2015 21:08:30 +0000 (21:08 +0000)]
handle phi nodes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244273
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 6 Aug 2015 21:07:55 +0000 (21:07 +0000)]
[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
Frederic Riss [Thu, 6 Aug 2015 21:05:06 +0000 (21:05 +0000)]
[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
Frederic Riss [Thu, 6 Aug 2015 21:05:01 +0000 (21:05 +0000)]
[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
Frederic Riss [Thu, 6 Aug 2015 21:04:55 +0000 (21:04 +0000)]
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
Reid Kleckner [Thu, 6 Aug 2015 21:01:32 +0000 (21:01 +0000)]
[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
Sanjoy Das [Thu, 6 Aug 2015 20:43:41 +0000 (20:43 +0000)]
[IndVars] Fix PR24356.
Unsigned predicates increase or decrease agnostic of the signs of their
increments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244265
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Thu, 6 Aug 2015 20:43:28 +0000 (20:43 +0000)]
[IndVars] Improved logging under DEBUG(); NFC.
Before this, we'd print the modified comparision in the "Simplified
comparison" case. That looked misleading.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244264
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Thu, 6 Aug 2015 20:22:46 +0000 (20:22 +0000)]
Convert a bunch of loops to foreach. NFC.
After r244074, we now have a successors() method to iterate over
all the successors of a TerminatorInst. This commit changes a bunch
of eligible loops to use it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244260
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Thu, 6 Aug 2015 20:05:27 +0000 (20:05 +0000)]
Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244259
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 6 Aug 2015 19:43:02 +0000 (19:43 +0000)]
AMDGPU/SI: Add Fiji support
Patch by: Alex Deucher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244255
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 6 Aug 2015 19:28:38 +0000 (19:28 +0000)]
AMDGPU/SI: Add support for 32-bit immediate SMRD offsets on CI
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11604
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244254
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 6 Aug 2015 19:28:30 +0000 (19:28 +0000)]
AMDGPU/SI: Use ComplexPatterns for SMRD addressing modes
Summary: This allows us to consolidate several of the TableGen patterns.
Reviewers: arsenm
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11602
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244253
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 6 Aug 2015 19:23:33 +0000 (19:23 +0000)]
Fix memory leaks by avoiding extra manual dynamic allocation
Improvement to r244212.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244252
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Weber [Thu, 6 Aug 2015 19:21:25 +0000 (19:21 +0000)]
Fix nested CrashRecoveryContexts with LLVM_ENABLE_THREADS=OFF, allow them.
libclang uses a CrashRecoveryContext, and building a module does too. If a
module gets built through libclang, nested CrashRecoveryContexts are used. They
work fine with threads as things are stored in ThreadLocal variables, but in
LLVM_ENABLE_THREADS=OFF builds the two recovery contexts would write to the
same globals.
To fix, keep active CrashRecoveryContextImpls in a list and have the global
point to the innermost one, and do something similar for
tlIsRecoveringFromCrash.
Necessary (but not sufficient) for PR11974 and PR20325
http://reviews.llvm.org/D11770
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244251
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 6 Aug 2015 19:19:55 +0000 (19:19 +0000)]
[libFuzzer] move the mutators to public interface so that custom mutators may reuse these functions directly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244250
91177308-0d34-0410-b5e6-
96231b3b80d8
Nico Rieck [Thu, 6 Aug 2015 19:10:45 +0000 (19:10 +0000)]
Rename inst_range() to instructions() for consistency. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244248
91177308-0d34-0410-b5e6-
96231b3b80d8
Kit Barton [Thu, 6 Aug 2015 19:01:57 +0000 (19:01 +0000)]
Fix possible infinite loop in shrink wrapping when searching for save/restore
points.
There is an infinite loop that can occur in Shrink Wrapping while searching
for the Save/Restore points.
Part of this search checks whether the save/restore points are located in
different loop nests and if so, uses the (post) dominator trees to find the
immediate (post) dominator blocks. However, if the current block does not have
any immediate (post) dominators then this search will result in an infinite
loop. This can occur in code containing an infinite loop.
The modification checks whether the immediate (post) dominator is different from
the current save/restore block. If it is not, then the search terminates and the
current location is not considered as a valid save/restore point for shrink wrapping.
Phabricator: http://reviews.llvm.org/D11607
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244247
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 6 Aug 2015 19:00:42 +0000 (19:00 +0000)]
LibDriver: Replace references to lld-link2 with lld-link.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244246
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Thu, 6 Aug 2015 18:44:34 +0000 (18:44 +0000)]
[Reassociation] Fix miscompile for va_arg arguments.
iisUnmovableInstruction() had a list of instructions hardcoded which are
considered unmovable. The list lacked (at least) an entry for the va_arg
and cmpxchg instructions.
Fix this by introducing a new Instruction::mayBeMemoryDependent()
instead of maintaining another instruction list.
Patch by Matthias Braun <matze@braunis.de>.
Differential Revision: http://reviews.llvm.org/D11577
rdar://problem/
22118647
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244244
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 6 Aug 2015 18:26:36 +0000 (18:26 +0000)]
MIR Parser: Report an error when parsing duplicate memory operand flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244240
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Thu, 6 Aug 2015 18:17:29 +0000 (18:17 +0000)]
Revert r244154 which causes some build failure. See https://llvm.org/bugs/show_bug.cgi?id=24377.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244239
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Thu, 6 Aug 2015 18:15:25 +0000 (18:15 +0000)]
Update docs for accessing !dbg attachments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244238
91177308-0d34-0410-b5e6-
96231b3b80d8
Kit Barton [Thu, 6 Aug 2015 18:02:53 +0000 (18:02 +0000)]
This patch changes the interface to enable the shrink wrapping optimization.
It adds a new constructor, which takes a std::function predicate function that
is run at the beginning of shrink wrapping to determine whether the optimization
should run on the given machine function. The std::function can be overridden by
each target, allowing target-specific decisions to be made on each machine
function.
This is necessary for PowerPC, as the decision to run shrink wrapping is
partially based on the ABI. Futhermore, this operates nicely with the GCC iFunc
capability, which allows option overrides on a per-function basis.
Phabricator: http://reviews.llvm.org/D11421
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244235
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 6 Aug 2015 17:37:18 +0000 (17:37 +0000)]
[AArch64] Use a static function and other minor cleanup for readability. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244233
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 6 Aug 2015 17:17:44 +0000 (17:17 +0000)]
[cmake] Handle Dragonfly BSD like FreeBSD
Fixes build break reported in PR24358.
Patch by John Marino.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244232
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Thu, 6 Aug 2015 16:57:49 +0000 (16:57 +0000)]
docs: Fix typo in Phabricator.rst
Summary: Fix a small typo in Phabricator.rst: s/your/you.
Reviewers: rnk
Subscribers: rnk, llvm-commits
Differential Revision: http://reviews.llvm.org/D11585
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244231
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 6 Aug 2015 16:55:53 +0000 (16:55 +0000)]
MIR Serialization: Serialize the 'invariant' machine memory operand flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244230
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Diamond [Thu, 6 Aug 2015 16:55:03 +0000 (16:55 +0000)]
Fix an alignment error in `llvm::expandAtomicRMWToCmpXchg` without breaking the build where X86 isn't enabled.
Summary: Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test.
Reviewers: rengolin, jfb
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11804
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244229
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 6 Aug 2015 16:49:30 +0000 (16:49 +0000)]
MIR Serialization: Serialize the 'non-temporal' machine memory operand flag.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244228
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 6 Aug 2015 15:50:12 +0000 (15:50 +0000)]
[AArch64] Improve the readability of the ld/st optimization pass. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244222
91177308-0d34-0410-b5e6-
96231b3b80d8
Douglas Katzman [Thu, 6 Aug 2015 15:44:12 +0000 (15:44 +0000)]
[SPARC] Don't compare arch name as a string, use the enum instead.
Fixes PR22695
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244221
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Thu, 6 Aug 2015 14:51:02 +0000 (14:51 +0000)]
Reuse variable. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244214
91177308-0d34-0410-b5e6-
96231b3b80d8
Aaron Ballman [Thu, 6 Aug 2015 14:07:29 +0000 (14:07 +0000)]
Silencing a -Wtype-limits warning; NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244213
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Thu, 6 Aug 2015 13:18:59 +0000 (13:18 +0000)]
Plug memory leaks in AsmWriterEmitter::EmitPrintAliasInstruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244212
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 6 Aug 2015 12:49:40 +0000 (12:49 +0000)]
Fix minor typos. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244211
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Thu, 6 Aug 2015 10:37:59 +0000 (10:37 +0000)]
Revert "Divide the primitive size in bits by eight so the initial load's alignment is in bytes as expected. Tested with the included unit test."
This reverts commit r244155, as it was breaking the buildbots for too long.
Should be reapplied with proper fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244205
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Thu, 6 Aug 2015 09:49:17 +0000 (09:49 +0000)]
llvm/lib/IR/AttributeImpl.h: Move comment block not to cover typedef, introduced in r244164. [-Wdocumentation]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244204
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Liao [Thu, 6 Aug 2015 09:06:20 +0000 (09:06 +0000)]
Removing tailing whitespaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244203
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Thu, 6 Aug 2015 08:45:34 +0000 (08:45 +0000)]
[X86] Improve EmitLoweredSelect for contiguous CMOV pseudo instructions.
This change improves EmitLoweredSelect() so that multiple contiguous CMOV pseudo
instructions with the same (or exactly opposite) conditions get lowered using a single
new basic-block. This eliminates unnecessary extra basic-blocks (and CFG merge points)
when contiguous CMOVs are being lowered.
Patch by: kevin.b.smith@intel.com
Differential Revision: http://reviews.llvm.org/D11428
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244202
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 6 Aug 2015 08:17:06 +0000 (08:17 +0000)]
[PM/AA] Clean up and homogenize comments throughout basic-aa.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244200
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Thu, 6 Aug 2015 07:59:26 +0000 (07:59 +0000)]
Fix Visual C++ error C2248:
'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>::additionalSizeToAlloc' :
cannot access protected member declared in class
'llvm::TrailingObjects<`anonymous-namespace'::Class1,short,llvm::NoTrailingTypeArg>'
I'm not sure how this compiles with gcc.
Aren't protecteded members accessible only with protected or public inheritance?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244199
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 6 Aug 2015 07:57:58 +0000 (07:57 +0000)]
[PM/AA] Run clang-format over all of basic-aa before making more
substantive edits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244198
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 6 Aug 2015 07:33:15 +0000 (07:33 +0000)]
[PM/AA] Hoist the interface for BasicAA into a header file.
This is the first mechanical step in preparation for making this and all
the other alias analysis passes available to the new pass manager. I'm
factoring out all the totally boring changes I can so I'm moving code
around here with no other changes. I've even minimized the formatting
churn.
I'll reformat and freshen comments on the interface now that its located
in the right place so that the substantive changes don't triger this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244197
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Thu, 6 Aug 2015 05:26:35 +0000 (05:26 +0000)]
COFF: Assign the correct symbol type to internal functions.
The COFFSymbolRef::isFunctionDefinition() function tests for several conditions
that are not related to whether a symbol is a function, but rather whether
the symbol meets the requirements for a function definition auxiliary record,
which excludes certain symbols such as internal functions and undefined
references. The test we need to determine the symbol type is much simpler:
we only need to compare the complex type against IMAGE_SYM_DTYPE_FUNCTION.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244195
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 6 Aug 2015 02:05:46 +0000 (02:05 +0000)]
[PM/AA] Simplify the AliasAnalysis interface by removing a wrapper
around a DataLayout interface in favor of directly querying DataLayout.
This wrapper specifically helped handle the case where this no
DataLayout, but LLVM now requires it simplifynig all of this. I've
updated callers to directly query DataLayout. This in turn exposed
a bunch of places where we should have DataLayout readily available but
don't which I've fixed. This then in turn exposed that we were passing
DataLayout around in a bunch of arguments rather than making it readily
available so I've also fixed that.
No functionality changed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244189
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 6 Aug 2015 01:29:13 +0000 (01:29 +0000)]
[libFuzzer] add one more mutation strategy: byte shuffling
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244188
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Thu, 6 Aug 2015 00:44:07 +0000 (00:44 +0000)]
MIR Serialization: Initial serialization of the machine operand target flags.
This commit implements the initial serialization of the machine operand target
flags. It extends the 'TargetInstrInfo' class to add two new methods that help
to provide text based serialization for the target flags.
This commit can serialize only the X86 target flags, and the target flags for
the other targets will be serialized in the follow-up commits.
Reviewers: Duncan P. N. Exon Smith
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244185
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Thu, 6 Aug 2015 00:18:52 +0000 (00:18 +0000)]
[llvm-objdump] Add missing call to exit(1).
Reported by: Rafael Espindola.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244184
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 23:53:38 +0000 (23:53 +0000)]
Revert "Make sure all temporary files get created under %T."
This reverts commit r244163. The workaround shouldn't be necessary
after r244172, and moreover the commit was slightly buggy as it
dis a simple mkdir without removing the directory first, which could
cause 'File exists' errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244182
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:52:42 +0000 (23:52 +0000)]
ValueMapper: Rotate distinct node remapping algorithm
Rotate the algorithm for remapping distinct nodes in order to simplify
how uniquing cycles get resolved. This removes some of the recursion,
and, most importantly, exposes all uniquing cycles at the top-level.
Besides being a little more efficient -- temporary MDNodes won't live as
long -- the clearer logic should help protect against bugs like those
fixed in r243961 and r243976.
What are uniquing cycles? Why do they present challenges when remapping
metadata?
!0 = !{!1}
!1 = !{!0}
!0 and !1 form a simple uniquing cycle. When remapping from one
metadata graph to another, every uniquing cycle gets "duplicated"
through a dance:
!0-temp = !{!1?} ; map(!0): clone !0, VM[!0] = !0-temp
!1-temp = !{!0?} ; ..map(!1): clone !1, VM[!1] = !1-temp
!1-temp = !{!0-temp} ; ..map(!1): remap !1's operands
!2 = !{!0-temp} ; ..map(!1): uniquify: !1-temp => !2
!0-temp = !{!2} ; map(!0): remap !0's operands
!3 = !{!2} ; map(!0): uniquify: !0-temp => !3
; Result
!2 = !{!3}
!3 = !{!2}
(In the two "uniquify" steps above, the operands of !X-temp are compared
to the operands of !X. If they're the same, then !X-temp gets RAUW'ed
to !X; if they're different, then !X-temp is promoted to a new unique
node. The latter case always hits in for uniquing cycles, so we
duplicate all the nodes involved.)
Why is this a problem? Uniquable Metadata nodes that have temporary
node as transitive operands keep RAUW support until the temporary nodes
get finalized. With non-cycles, this happens automatically: when a
uniquable node's count of unresolved operands drops to zero, it
immediately sheds its own RAUW support (possibly triggering the same in
any node that references it). However, uniquing cycles create a
reference cycle, and uniqued nodes that transitively reference a
uniquing cycle are "stuck" in an unresolved state until someone calls
`MDNode::resolveCycles()` on a node in the unresolved subgraph.
Distinct nodes should help here (and mostly do): since they aren't
uniqued anywhere, they are guaranteed not to be RAUW'ed. They
effectively form a barrier between uniqued nodes, breaking some uniquing
cycles, and shielding uniqued nodes from uniquing cycles.
Unfortunately, with this barrier in place, the unresolved subgraph(s)
can be disjoint from the top-level node. The mapping algorithm needs to
find at least one representative from each disjoint subgraph. But which
nodes are *stuck*, and which will get resolved automatically? And which
nodes are in the unresolved subgraph? The old logic was conservative.
This commit rotates the logic for distinct nodes, so that we have access
to unresolved nodes at the top-level call to `llvm::MapMetadata()`.
Each time we return to the top-level, we know that all temporaries have
been RAUW'ed away. Here, it's safe (and necessary) to call
`resolveCycles()` immediately on unresolved operands.
This should also perform better than the old algorithm. The recursion
stack is shorter, temporary nodes don't live as long, and there are
fewer tracking references to unresolved nodes. As the debug info graph
introduces more 'distinct' nodes, remapping should incrementally get
cheaper and cheaper.
Aside from possible performance improvements (and reduced cruft in the
`LLVMContext`), there should be no functionality change here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244181
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 5 Aug 2015 23:44:42 +0000 (23:44 +0000)]
[libFuzzer] avoid build warnings in non-assert build (useful warning in this case)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244177
91177308-0d34-0410-b5e6-
96231b3b80d8
Wei Mi [Wed, 5 Aug 2015 23:40:30 +0000 (23:40 +0000)]
Add a stat to show how often the limit to decompose GEPs in BasicAA is reached.
Differential Revision: http://reviews.llvm.org/D9689
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244174
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 23:33:50 +0000 (23:33 +0000)]
[dsymutil] Do not create temporary files in -no-output mode.
The files were never written to and then deleted, but they were created
nonetheless. To prevent that, create a wrapper around the 2 variants of
createUniqueFile and use the one that only does an access(Exists) call
to check for name unicity in -no-output mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244172
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 23:33:45 +0000 (23:33 +0000)]
[dsymutil] Update source used to generate test binary.
Forgot to include that in the last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244171
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Wed, 5 Aug 2015 23:22:34 +0000 (23:22 +0000)]
ValueMapper: Simplify remap() helper function, NFC
Rename `remap()` to `remapOperands()`, and restrict its contract to
remapping operands. Previously, it also called `mapToMetadata()`, but
this logic is hard to reason about externally. In particular, this
refactors `mapUniquedNode()` to avoid redundant mapping calls, taking
advantage of the RAUWs that are already in place.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244168
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 5 Aug 2015 23:15:37 +0000 (23:15 +0000)]
x86: NFC remove needless InstrCompiler cast
Summary: The casts from String to PatFrag weren't needed if we instead provided an SDNode. This fix was suggested by @pete in D11382.
Subscribers: pete, llvm-commits
Differential Revision: http://reviews.llvm.org/D11788
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244167
91177308-0d34-0410-b5e6-
96231b3b80d8
Bjarke Hammersholt Roune [Wed, 5 Aug 2015 23:11:57 +0000 (23:11 +0000)]
[NVPTX] Use LDG for pointer induction variables.
More specifically, make NVPTXISelDAGToDAG able to emit cached loads (LDG) for pointer induction variables.
Also fix latent bug where LDG was not restricted to kernel functions. I believe that this could not be triggered so far since we do not currently infer that a pointer is global outside a kernel function, and only loads of global pointers are considered for cached loads.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244166
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 5 Aug 2015 23:02:57 +0000 (23:02 +0000)]
[libFuzzer] in dfsan mode, set labels every time we start recording traces as opposed to doing it at process startup. This ensures that the labels are fresh.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244165
91177308-0d34-0410-b5e6-
96231b3b80d8
James Y Knight [Wed, 5 Aug 2015 22:57:34 +0000 (22:57 +0000)]
Add a TrailingObjects template class.
This is intended to help support the idiom of a class that has some
other objects (or multiple arrays of different types of objects)
appended on the end, which is used quite heavily in clang.
Differential Revision: http://reviews.llvm.org/D11272
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244164
91177308-0d34-0410-b5e6-
96231b3b80d8
Artem Belevich [Wed, 5 Aug 2015 22:54:36 +0000 (22:54 +0000)]
Make sure all temporary files get created under %T.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244163
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 22:33:28 +0000 (22:33 +0000)]
[dsymutil] Add support for the -arch option.
This option allows to select a subset of the architectures when
performing a universal binary link. The filter is done completely
in the mach-o specific part of the code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244160
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 5 Aug 2015 22:27:08 +0000 (22:27 +0000)]
Fix Windows test failure with triple instead of using the native OS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244159
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Wed, 5 Aug 2015 22:26:20 +0000 (22:26 +0000)]
If the "CodeView" module flag is set, emit codeview instead of DWARF
Summary:
Emit both DWARF and CodeView if "CodeView" and "Dwarf Version" module
flags are set.
Reviewers: majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11756
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244158
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 5 Aug 2015 22:26:15 +0000 (22:26 +0000)]
MIR Serialization: Serialize the machine operand's offset.
This commit serializes the offset for the following operands: target index,
global address, external symbol, constant pool index, and block address.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244157
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Wed, 5 Aug 2015 22:13:43 +0000 (22:13 +0000)]
Add <numeric> header for use of std::accumulate().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244156
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Diamond [Wed, 5 Aug 2015 22:10:57 +0000 (22:10 +0000)]
Divide the primitive size in bits by eight so the initial load's alignment is in
bytes as expected. Tested with the included unit test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244155
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Wed, 5 Aug 2015 22:01:20 +0000 (22:01 +0000)]
Record whether the weights on out-edges from a MBB are normalized.
1. Create a utility function normalizeEdgeWeights() in MachineBranchProbabilityInfo that normalizes a list of edge weights so that the sum of then can fit in uint32_t.
2. Provide an interface in MachineBasicBlock to normalize its successors' weights.
3. Add a flag in MachineBasicBlock that tracks whether its successors' weights are normalized.
4. Provide an overload of getSumForBlock that accepts a non-const pointer to a MBB so that it can force normalizing this MBB's successors' weights.
5. Update several uses of getSumForBlock() by eliminating the once needed weight scale.
Differential Revision: http://reviews.llvm.org/D11442
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244154
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 5 Aug 2015 21:43:48 +0000 (21:43 +0000)]
[libFuzzer] add option -report_slow_units=Nsec to control when slow units are printed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244152
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 5 Aug 2015 21:32:13 +0000 (21:32 +0000)]
[libFuzzer] add a missing test file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244151
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 21:16:46 +0000 (21:16 +0000)]
Drop the defaulted CallGraph move ctor, since it's unused and MSVC doesn't support defaulted move ops
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244135
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Wed, 5 Aug 2015 21:16:02 +0000 (21:16 +0000)]
Replace &vector[0] with vector.data() to avoid invalid dereference caught by debug STL. Also move a '*' for consistency and fix an 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244134
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 21:15:48 +0000 (21:15 +0000)]
-Wdeprecated: Remove some dead code that was relying on a questionable (rule-of-3-violating) copy ctor in MCInstPrinter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244133
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Wed, 5 Aug 2015 21:13:26 +0000 (21:13 +0000)]
[LoopUnswitch] Preserve make.implicit metadata for unswitched conditions
Summary: This patch adds support to preserve make.implicit metadata for unswitched conditions in loop pre-header.
Reviewers: sanjoy, weimingz
Subscribers: mcrosier, llvm-commits
Differential Revision: http://reviews.llvm.org/D11769
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244132
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 5 Aug 2015 21:08:26 +0000 (21:08 +0000)]
[Hexagon] Edit a comment. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244130
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 21:06:50 +0000 (21:06 +0000)]
-Wdeprecated clean by making LogBuilder move constructible so it can be returned by value (in DifferenceEngine::logf)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244129
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 5 Aug 2015 21:04:59 +0000 (21:04 +0000)]
x86 atomic: optimize a.store(reg op a.load(acquire), release)
Summary: PR24191 finds that the expected memory-register operations aren't generated when relaxed { load ; modify ; store } is used. This is similar to PR17281 which was addressed in D4796, but only for memory-immediate operations (and for memory orderings up to acquire and release). This patch also handles some floating-point operations.
Reviewers: reames, kcc, dvyukov, nadav, morisset, chandlerc, t.p.northover, pete
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D11382
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244128
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 5 Aug 2015 21:04:31 +0000 (21:04 +0000)]
[PM] Remove a failed attempt to port the CallGraph analysis to the new
pass manager.
This never worked, and won't ever work. It was actually why I ended up
building the LazyCallGraph set of code which is more more effectively
wired up to the new pass manager. This accidentally got committed when
I was trying to land a cleanup of the code organization in the other
parts of this file. =[ My bad, but fortunately Dave was keen eyed enough
to spot that this code couldn't possibly work. =]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244127
91177308-0d34-0410-b5e6-
96231b3b80d8
Pete Cooper [Wed, 5 Aug 2015 20:55:53 +0000 (20:55 +0000)]
Update GettingStarted docs list of LLVM_TARGETS_TO_BUILD to match cmake.
Since the docs were written, we've added the BPF backend to the list.
Updating the docs to take this in to account. Also sorted them to
match cmake while I was changing these lines.
Reviewed by Chris B.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244123
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 20:55:50 +0000 (20:55 +0000)]
-Wdeprecated cleanup: Make CallGraph movable by default by using unique_ptr members rather than raw pointers.
The only place that tries to return a CallGraph by value
(CallGraphAnalysis::run) doesn't seem to be used right now, but it's a
reasonable bit of cleanup anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244122
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 5 Aug 2015 20:53:56 +0000 (20:53 +0000)]
Revert "Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem pointed out by Michael Hordijk."
I mistakenly committed the patch for D6629, and was trying to commit another. Reverting until it gets proper signoff.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244121
91177308-0d34-0410-b5e6-
96231b3b80d8
JF Bastien [Wed, 5 Aug 2015 20:49:46 +0000 (20:49 +0000)]
Fix MO's analyzePhysReg, it was confusing sub- and super-registers. Problem pointed out by Michael Hordijk.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244120
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 20:38:57 +0000 (20:38 +0000)]
-Wdeprecated-clean: Remove uses of throw() in favor of noexcept
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244115
91177308-0d34-0410-b5e6-
96231b3b80d8
Cong Hou [Wed, 5 Aug 2015 20:30:11 +0000 (20:30 +0000)]
NFC.
Convert comments in MachineBasicBlock.h into new style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244113
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 5 Aug 2015 20:20:29 +0000 (20:20 +0000)]
-Wdeprecated-clean: Fix cases of violating the rule of 5 in ways that are deprecated in C++11
LoadedObjectInfo was depending on the implicit copy ctor in the presence
of a user-declared dtor. Default (and protect) it in the base class and
make the devired classes final to avoid any risk of a public API that
would enable slicing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244112
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Diamond [Wed, 5 Aug 2015 20:03:26 +0000 (20:03 +0000)]
Revert "Fix `llvm-config` to emit the linker flag for the combined shared object built by autoconfig/make instead of the individual components."
It seems I was wrong thinking `autoconf`/`make` only installed shared libraries if configured with `--enable-shared`, even if `--disable-static` is present. I'll re-address with a followup patch.
This reverts commit r243297 for causing PR#24154.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244108
91177308-0d34-0410-b5e6-
96231b3b80d8
Richard Diamond [Wed, 5 Aug 2015 19:40:39 +0000 (19:40 +0000)]
Write access test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244103
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 5 Aug 2015 19:03:42 +0000 (19:03 +0000)]
MIR Parser: Report an error when parsing large immediate operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244100
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 5 Aug 2015 18:52:21 +0000 (18:52 +0000)]
MIR Serialization: Serialize the typed immediate integer machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244098
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Wed, 5 Aug 2015 18:46:21 +0000 (18:46 +0000)]
[Unroll] Switch to using 'int' cost types in preparation for a somewhat
more involved change to the cost computation pattern.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244095
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 18:45:13 +0000 (18:45 +0000)]
[dsymutil] Fix test patterns.
Depending on the filesystem paths, the YAML dump might quote paths.
Account for that in the regex patterns.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244094
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 5 Aug 2015 18:44:00 +0000 (18:44 +0000)]
MIR Parser: Extract the IR constant parsing code into a new method. NFC.
This commit extracts the code that parses the IR constant values into a new
method named 'parseIRConstant' in the 'MIParser' class. The new method will
be reused by the code that parses the typed integer immediate machine operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244093
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Wed, 5 Aug 2015 18:35:37 +0000 (18:35 +0000)]
[Hexagon] Implement TargetTransformInfo for Hexagon
Author: Brendon Cahoon <bcahoon@codeaurora.org>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244089
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 18:27:44 +0000 (18:27 +0000)]
[dsymutil] Implement support for handling mach-o universal binaries as main input/output.
The DWARF linker isn't touched by this, the implementation links
individual files and merges them together into a fat binary by
calling out to the 'lipo' utility.
The main change is that the MachODebugMapParser can now return
multiple debug maps for a single binary.
The test just verifies that lipo would be invoked correctly, but
doesn't actually generate a binary. This mimics the way clang
tests its external iplatform tools integration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244087
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 18:27:38 +0000 (18:27 +0000)]
[dsymutil] Introduce exit helper. NFC.
llvm-dsymutil will start creating temporary files in a followup
commit. To ease the correct cleanup of this files, introduce a
helper called to exit dsymutil.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244086
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Wed, 5 Aug 2015 18:27:34 +0000 (18:27 +0000)]
[dsymutil] Split some logic into a helper function. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244085
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Wed, 5 Aug 2015 18:23:01 +0000 (18:23 +0000)]
[libFuzzer] use data-flow feedback from strcmp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244084
91177308-0d34-0410-b5e6-
96231b3b80d8
Alex Lorenz [Wed, 5 Aug 2015 18:09:03 +0000 (18:09 +0000)]
MIR Parser: Report an error when parsing duplicate register flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244081
91177308-0d34-0410-b5e6-
96231b3b80d8