Commit Graph

127057 Commits

Author SHA1 Message Date
Frederic Riss
f87dc438fd [MCDwarf] Fix encoding of line tables with weird custom parameters
With poorly chosen custom parameters, the line table encoding logic would
sometimes end up generating a special opcode bigger than 255, which is wrong.
The set of default parameters that LLVM uses isn't subject to this bug.

When carefully chosing the line table parameters, it's impossible to fall into the
corner case that this patch fixes. The standard however doesn't require that these
parameters be carefully chosen. And even if it did, we shouldn't generate broken
encoding.

Add a unittest for this specific encoding bug, and while at it, create some unit
tests for the encoding logic using different sets of parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 22:06:35 +00:00
Craig Topper
de7763c85d Remove utostr_32 as it has no uses anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259331 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:26 +00:00
Craig Topper
78709b8c2e Replace usages of llvm::utostr_32 with just llvm::utostr. While this is less efficient, its unclear the few places that were using the _32 version were doing so for efficiency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259330 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:24 +00:00
Craig Topper
2b9504417f Merge utohex_buffer into utohexstr, it's only caller. Also change utohexstr to use the std::string constructor that takes a start and end pointer. This saves a call to strlen. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 20:00:22 +00:00
Sanjay Patel
8ae9283986 add helper function for minnum/maxnum ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259326 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:35:23 +00:00
Sanjay Patel
1b85558809 use range-based for loop; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259325 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:34:48 +00:00
Sanjay Patel
8f8429c590 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259324 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:34:11 +00:00
Sanjay Patel
0714d26fe2 simplify; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259323 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:33:33 +00:00
Sanjay Patel
54543aceab clean up; NFC
function names, comments, formatting, typos


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259322 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 16:32:23 +00:00
JF Bastien
43b517fe4e WebAssembly: more failures are gone
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259321 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 08:19:40 +00:00
JF Bastien
632c5868b4 WebAssembly: update expected failures
r259305 fixed a few assertions around FrameIndex, and I forgot to update these failures despite having run the torture tests.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 08:05:05 +00:00
Frederic Riss
79c213f615 [dsymutil] Fix FileCheck command.
Damn case-insensitive filesystem...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259319 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 04:39:16 +00:00
Frederic Riss
99a07120d4 [dsymutil] Fix handling of common symbols.
llvm-dsymutil was misinterpreting the value of common symbols as their
address when it actually contains their size. This didn't impact
llvm-dsymutil's ability to link the debug information for common symbols
because these are always found by name and not by address. Things could
however go wrong when the size of a common object matched the object
file address of another symbol. Depending on the link order of the symbols
the common object might incorrectly evict this other object from the
address to symbol mapping, and then link the evicted symbol with a wrong
binary address.

Use the new ability to have symbols without an object file address to fix
this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259318 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 04:29:34 +00:00
Frederic Riss
c5413fcc11 [dsymutil] Allow debug map mappings with no object file address. NFC
This change just changes the data structure that ties symbol names,
object file address and linked binary addresses to accept mappings
with no object file address. Such symbol mappings are not fed into
the debug map yet, so this patch is NFC.
A subsequent patch will make use of this functionality for common
symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259317 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 04:29:22 +00:00
Tim Shen
a750479355 [SelectionDAG] Eliminate exponential behavior in WalkChainUsers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259315 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 03:59:34 +00:00
Craig Topper
ac8a991748 No need to use utostr/utohexstr when writing into a raw_ostream. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259314 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 01:55:15 +00:00
Craig Topper
fef23f4125 Shrink character buffer size in raw_ostream::write_hex to 16 characters intead of 20 as that's the largest string a 64-bit hex value can be.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259313 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 01:12:38 +00:00
Craig Topper
ff0b4a2d25 Use std::end instead of repeating buffer sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 01:12:35 +00:00
Craig Topper
95769998f9 Convert int to Twine instead of using utostr since it was already being added to a Twine. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 00:15:35 +00:00
Jingyue Wu
e3e4ffd172 [doc] improve the doc for CUDA
1. Mentioned that CUDA support works best with trunk.
2. Simplified the example by removing its dependency on the CUDA samples.
3. Explain the --cuda-gpu-arch flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 23:48:47 +00:00
Derek Schuff
a2b61fb428 [WebAssembly] Fix uses of FrameIndex as store values
Previously the code assumed all uses of FI on loads and stores were as
addresses. This checks whether the use is the address or a value and
handles the latter case as it does for non-memory instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 21:43:08 +00:00
JF Bastien
cdfe27d1cc WebAssembly: don't optimize frameindex store
The previous code was incorrect (can't getReg a frameindex). We could instead optimize it to reduce tree height, but I'm not sure that's worthwhile yet because we then try to eliminate the frameindex.

This patch also fixes frame index elimination for operations which may load or store: it used to assume the base was operand 2 and immediate offset operand 1. That's not true for stores, where they're 4 and 3.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 14:11:26 +00:00
JF Bastien
5ca4b7cecc WebAssembly NFC: fix build warning
WebAssemblyFrameLowering.cpp:158:44: warning: enumeral and non-enumeral type in conditional expression [enabled by default]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 11:19:26 +00:00
Gerolf Hoflehner
729a217c15 [BasicAA] NFC - revised comment for function adjustToPointerSize()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259300 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:58:38 +00:00
Gerolf Hoflehner
86f53ba864 [BasicAA] Fix for missing must alias (D16343)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:52:53 +00:00
Gerolf Hoflehner
8326b169bc [BasicAA] Update on r259290 - added missing cast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:35:09 +00:00
Matt Arsenault
084a86c382 AMDGPU: Fix emitting invalid workitem intrinsics for HSA
The AMDGPUPromoteAlloca pass was emitting the read.local.size
calls, which with HSA was incorrectly selected to reading from
the offset mesa uses off of the kernarg pointer.

Error on intrinsics which aren't supported by HSA, and start
emitting the correct IR to read the workgroup size
out of the dispatch pointer.

Also initialize the pass so it can be tested with opt, and
start moving towards not depending on the subtarget as an
argument.

Start emitting errors for the intrinsics not handled with HSA.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:19:45 +00:00
Matt Arsenault
9a30bf46a7 AMDGPU: Stop checking intrinsics not used by HSA for dispatch-ptr
Only the dispatch.ptr intrinsic is supposed to be used now to get
the workgroup size, and the read.local.size intrinsics do not
work correctly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259296 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:10:59 +00:00
Matt Arsenault
0f1831aa7d InstCombine: fabs(x) * fabs(x) -> x * x
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259295 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:02:00 +00:00
Dan Gohman
af25d0139c [WebAssembly] Refine block placement to insert blocks between trees.
Refine the test for whether an instruction is in an expression tree so that
it detects when one tree ends and another begins, so we can place a block
at that point, rather than continuing to find the first instruction not in
a tree at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259294 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 05:01:06 +00:00
Matt Arsenault
27e98d1c21 AMDGPU: Add new amdgcn workitem intrinsics
These use the correct prefix and follow the HSA naming convention
rather than the config register option names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259293 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 04:25:19 +00:00
Justin Bogner
b7fdaea278 Remove references to *.h.in files and some autoconf hackery
Missed this stuff in r259291.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259292 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 04:15:33 +00:00
Justin Bogner
53a4064102 Remove *.h.in - these were only used by the autoconf build system
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259291 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 04:05:45 +00:00
Gerolf Hoflehner
f6d75eeed4 [BasicAA] NFC - utility function for two's complement wrap-around
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 02:42:11 +00:00
Xinliang David Li
958f45c5b1 Further reduce test time
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259285 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:37:32 +00:00
Matthias Braun
5e08bd340a Avoid overly large SmallPtrSet/SmallSet
These sets perform linear searching in small mode so it is never a good
idea to use SmallSize/N bigger than 32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:24:31 +00:00
Matthias Braun
96c7162300 Use Support/DataTypes.h instead of cstdint
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:14:01 +00:00
Alexey Samsonov
af1aa14cb5 [docs] Remove references to autotools build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:10:15 +00:00
Justin Lebar
b31edea184 [CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.
Summary: Previously we'd just silently skip these.

Reviewers: tra, jholewinski

Subscribers: llvm-commits, jhen, echristo,

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 01:07:38 +00:00
David Majnemer
41a66df74f [CodeView] Properly handle empty line tables
Don't crash when there are no appropriate line table entries for a given
function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259277 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-30 00:36:09 +00:00
Manman Ren
77c763c1a3 [Objective-C] Support a new special module flag.
"Objective-C Class Properties" will be put into the objc_imageinfo struct.

rdar://23891898


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:51:00 +00:00
Davide Italiano
c98cfb2adf [llvm-nm] Add a comment to explain why we initialize MC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:38:05 +00:00
Kostya Serebryany
58b3c64b6b [libFuzzer] add -timeout_exitcode option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259265 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:30:07 +00:00
Sanjay Patel
2801207748 function names start with a lower case letter ; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:27:03 +00:00
Kostya Serebryany
fb614ec4d4 [libFuzzer] re-enable test for -abort_on_timeout=1, this time protecting from ASAN_OPTIONS set outside
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259263 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:19:00 +00:00
Sanjay Patel
62d61909e4 fix formatting; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:14:58 +00:00
Fiona Glaser
d7541ec848 Fix typo in LoopSimplifyCFG
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259261 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 23:12:52 +00:00
Vedant Kumar
0c94d7d441 [Profiling] Add a -sparse mode to llvm-profdata merge
Add an option to llvm-profdata merge for writing out sparse indexed
profiles. These profiles omit InstrProfRecords for functions which are
never executed.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 22:54:45 +00:00
Reid Kleckner
2e10304d4f Fix the MSVC build by moving static asserts into constructors
Apparently MSVC won't allow you to ask for the sizeof() a data member at
class scope.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 22:40:22 +00:00
Fiona Glaser
e98524387e Add LoopSimplifyCFG pass
Loop transformations can sometimes fail because the loop, while in
valid rotated LCSSA form, is not in a canonical CFG form. This is
an extremely simple pass that just merges obviously redundant
blocks, which can be used to fix some known failure cases. In the
future, it may be enhanced with more cases (and have code shared with
SimplifyCFG).

This allows us to run LoopSimplifyCFG -> LoopRotate -> LoopUnroll,
so that SimplifyCFG cleans up the loop before Rotate tries to run.

Not currently used in the pass manager, since this pass doesn't do
anything unless you can hook it up in an LPM with other loop passes.
It'll be added once Chandler cleans up things to allow this.

Tested in a custom pipeline out of tree to confirm it works in
practice (in addition to the included trivial test).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-29 22:35:36 +00:00