James Molloy [Mon, 26 Oct 2015 10:04:52 +0000 (10:04 +0000)]
[ARM] Handle the inline asm constraint type 'o'
This means "memory with offset" and requires very little plumbing to get working. This fixes PR25317.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251280
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 26 Oct 2015 09:55:45 +0000 (09:55 +0000)]
Drop code after unreachable. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251278
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 26 Oct 2015 08:37:12 +0000 (08:37 +0000)]
AVX512: Add AVX-512 not materializable instructions.
Otherwise value can be reused , despite its value could be changed - produces incorrect assembler.
https://llvm.org/bugs/show_bug.cgi?id=25270
Differential Revision: http://reviews.llvm.org/D14057
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251275
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 26 Oct 2015 06:40:28 +0000 (06:40 +0000)]
[Orc] Add license header to OrcTargetSupport.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251274
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Mon, 26 Oct 2015 06:37:04 +0000 (06:37 +0000)]
[Orc] In the CompileOnDemand layer, wrap module ownership in order to preserve
the module pointer type passed in by the user.
The previous ownership scheme, where the user pointer was always moved into a
std::shared_ptr, breaks if the user passes in a raw pointer.
Discovered while working on the Orc C API, which should be landing shortly.
I expect to include a test-case with that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251273
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 26 Oct 2015 03:34:29 +0000 (03:34 +0000)]
Update test to take into account for r251271.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251272
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 26 Oct 2015 03:15:34 +0000 (03:15 +0000)]
[MC] Add support for GNU as-compatible binary operator precedence
GNU as and Darwin give the various binary operators different
precedence. LLVM's MC supported the Darwin semantics but not the GNU
semantics.
This fixes PR25311.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251271
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Mon, 26 Oct 2015 02:45:50 +0000 (02:45 +0000)]
[MC] Don't crash when .word is given bogus values
We didn't validate that the .word directive was given a sane value,
leading to crashes when we attempt to write out the object file.
Instead, perform some validation and issue a diagnostic pointing at the
start of the diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251270
91177308-0d34-0410-b5e6-
96231b3b80d8
Tobias Grosser [Sun, 25 Oct 2015 22:55:59 +0000 (22:55 +0000)]
RegionInfo: Correctly expand regions
Instead of playing around with dominance to verify if the possible expansion of
a scop region is indeed a single entry single exit region, we now distinguish
two cases. In case we only append a basic block, all edges entering this basic
block need to have come from within the region that is expanded. In case we join
two regions, the source basic blocks of the edges that end at the entry node of
the region that is appended most be part of either the original region or the
region that is appended.
This change will be tested through Polly.
This fixes llvm.org/PR25242
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251267
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 25 Oct 2015 22:28:27 +0000 (22:28 +0000)]
Convert assert(false) into llvm_unreachable where it makes sense.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251266
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 21:47:09 +0000 (21:47 +0000)]
[X86][AVX] Regenerate tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251263
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Sun, 25 Oct 2015 20:39:35 +0000 (20:39 +0000)]
docs: document `x` mangling in LangRef
Windows has two different mangling specifiers. `x` is used on x86 for the `_`
UserLabelPrefix. Others use `w` for the no UserLabelPrefix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251260
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 25 Oct 2015 20:00:49 +0000 (20:00 +0000)]
[ScalarEvolution] Throw away dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251256
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 25 Oct 2015 19:55:24 +0000 (19:55 +0000)]
[ScalarEvolution] Get rid of NDEBUG in header (correctly this time).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251255
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Oct 2015 19:27:17 +0000 (19:27 +0000)]
[LCSSA] Unbreak build, don't reuse L; NFC
The build broke in r251248.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251251
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sun, 25 Oct 2015 19:13:36 +0000 (19:13 +0000)]
[ScalarEvolution] Get rid of NDEBUG in header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251249
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 25 Oct 2015 19:08:32 +0000 (19:08 +0000)]
[LCSSA] Use range for loops; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251248
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 17:40:54 +0000 (17:40 +0000)]
[X86][SSE4A] Fix for EXTRQI shuffle lowering.
Incorrect range test - found during fuzz testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251245
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 15:39:22 +0000 (15:39 +0000)]
[X86][SSE] Refreshed tests (missing AVX512 patterns)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251238
91177308-0d34-0410-b5e6-
96231b3b80d8
Elena Demikhovsky [Sun, 25 Oct 2015 15:37:55 +0000 (15:37 +0000)]
Scalarizer for masked.gather and masked.scatter intrinsics.
When the target does not support these intrinsics they should be converted to a chain of scalar load or store operations.
If the mask is not constant, the scalarizer will build a chain of conditional basic blocks.
I added isLegalMaskedGather() isLegalMaskedScatter() APIs.
Differential Revision: http://reviews.llvm.org/D13722
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251237
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 15:32:04 +0000 (15:32 +0000)]
[X86][SSE] Added tests for shuffling through bitcasts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251236
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 12:15:00 +0000 (12:15 +0000)]
[X86][SSE] vector sext/zext tests - remove unnecessary mcpu arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251233
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 12:07:45 +0000 (12:07 +0000)]
[X86][SSE] shift/rotate tests - remove unnecessary mcpu arguments and regenerate/cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251232
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 11:55:10 +0000 (11:55 +0000)]
[X86] PMOV*X* tests - remove unnecessary mcpu arguments and regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251230
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sun, 25 Oct 2015 11:42:46 +0000 (11:42 +0000)]
[X86] Stack folding tests - just use mtriple - no need for mcpu in these tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251229
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 25 Oct 2015 08:14:05 +0000 (08:14 +0000)]
[X86] Use correct calling convention for MCU psABI libcalls
When using the MCU psABI, compiler-generated library calls should pass
some parameters in-register. However, since inreg marking for x86 is currently
done by the front end, it will not be applied to backend-generated calls.
This is a workaround for PR3997, which describes a similar issue for -mregparm.
Differential Revision: http://reviews.llvm.org/D13977
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251223
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Kuperstein [Sun, 25 Oct 2015 08:07:37 +0000 (08:07 +0000)]
[X86] Add support for elfiamcu triple
This adds support for the i?86-*-elfiamcu triple, which indicates the IAMCU psABI is used.
Differential Revision: http://reviews.llvm.org/D13977
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251222
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Oct 2015 03:15:29 +0000 (03:15 +0000)]
Remove two unnecessary conversions from MVT to EVT. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251219
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 25 Oct 2015 00:27:14 +0000 (00:27 +0000)]
Use MVT::SimpleValueType instead of MVT in template parameter. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251217
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 24 Oct 2015 23:23:25 +0000 (23:23 +0000)]
Simplify boolean conditional return statements in tools/llvm-symbolizer.
Patch by Richard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251216
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 24 Oct 2015 23:19:10 +0000 (23:19 +0000)]
Simplify boolean expressions in tools/llvm-objdump.
Patch by Richard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251215
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Sat, 24 Oct 2015 23:11:13 +0000 (23:11 +0000)]
Refactor: Simplify boolean conditional return statements in lib/CodeGen.
Patch by Richard.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251213
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 22:45:04 +0000 (22:45 +0000)]
[X86][SSE] Use lowerVectorShuffleWithUNPCK instead of custom matches.
Most 128-bit and 256-bit shuffles were manually matching UNPCK patterns - use lowerVectorShuffleWithUNPCK to be more thorough.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251211
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 24 Oct 2015 22:15:32 +0000 (22:15 +0000)]
[Support] Add comment to explain why we can't drop NDEBUG.
Discussed with: Benjamin Kramer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251210
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 24 Oct 2015 22:09:54 +0000 (22:09 +0000)]
[CodeGen] Get rid of NDEBUG to ensure structure stability.
I think it's fine to keep this fields around in terms of overhead,
I wasn't able to measure any substantial regression while running the
test suite, but, in case this causes some regression I'm ready to revert
and work on an alternative solution.
This was tested building with clang/gcc both in Debug and Release mode
and passes the test-suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251209
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 20:48:08 +0000 (20:48 +0000)]
[X86][SSE] lowerVectorShuffleWithUNPCK - use equivalent shuffle mask test.
Use isShuffleEquivalent to match UNPCK shuffles - better support for build vector inputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251207
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Sat, 24 Oct 2015 20:16:42 +0000 (20:16 +0000)]
Refactor: Simplify boolean conditional return statements in lib/Transforms/Vectorize (NFC).
Summary: Use clang-tidy to simplify boolean conditional return statements
Differential Revision: http://reviews.llvm.org/D10003
Patch by Richard<legalize@xmission.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251206
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 20:15:43 +0000 (20:15 +0000)]
Removed old FIXME - we do generate movddup for SSE3 and higher
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251205
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 20:06:18 +0000 (20:06 +0000)]
[DAGCombiner] Tidy up ConstantFP commutation. NFCI
Move ConstantFP canonicalization of commutative instructions to start of 2-op node creation (matches integer) - simplifies constant folding code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251203
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 24 Oct 2015 19:30:37 +0000 (19:30 +0000)]
Use all_of to simplify control flow. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251202
91177308-0d34-0410-b5e6-
96231b3b80d8
Yaron Keren [Sat, 24 Oct 2015 19:27:28 +0000 (19:27 +0000)]
Add libuuid to required system libraries list for mingw.
This list is produced by llvm-config --system-libs to be used
by external programs using the llvm libraries, such as creduce.
In r250501 llvm/Support/Windows/Path.inc started to use the constant
FOLDERID_Profile from libuuid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251201
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 24 Oct 2015 19:03:15 +0000 (19:03 +0000)]
Use find_if to simplify control flow. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251200
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 18:44:52 +0000 (18:44 +0000)]
[DAGCombiner] Generalize masking of constant rotates.
We don't need a mask of a rotation result to be a constant splat - any constant scalar/vector can be usefully folded.
Followup to D13851.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251197
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 24 Oct 2015 18:40:22 +0000 (18:40 +0000)]
Call the version of ConvertCostTableLookup that takes a statically sized array rather than pointer and size. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251196
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Sat, 24 Oct 2015 16:47:10 +0000 (16:47 +0000)]
X86ISelLowering: Support tail calls to/from callee pop functions
This enables tail calls with thiscall, stdcall, vectorcall and
fastcall functions.
Differential Revision: http://reviews.llvm.org/D13999
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251190
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 13:41:45 +0000 (13:41 +0000)]
Fix unused variable warning. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251189
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 24 Oct 2015 13:17:26 +0000 (13:17 +0000)]
[X86][XOP] Add support for lowering vector rotations
This patch adds support for lowering to the XOP VPROT / VPROTI vector bit rotation instructions.
This has required changes to the DAGCombiner rotation pattern matching to support vector types - so far I've only changed it to support splat vectors, but generalising this further is feasible in the future.
Differential Revision: http://reviews.llvm.org/D13851
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251188
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 24 Oct 2015 12:46:49 +0000 (12:46 +0000)]
[TblGen] ArrayRefize CodeGenSchedule. No functionality change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251187
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 24 Oct 2015 12:46:45 +0000 (12:46 +0000)]
[TblGen] ArrayRefize TGParser. No functional change intended.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251186
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sat, 24 Oct 2015 11:38:01 +0000 (11:38 +0000)]
[BasicAliasAnalysis] Simplify expression, no functional change.
(-1) - x + 1 is the same as -x.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251185
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 24 Oct 2015 06:42:42 +0000 (06:42 +0000)]
ScalarReplAggregates.cpp: Try to appease clash of anonymous::SROA in modules build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251181
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 24 Oct 2015 05:37:35 +0000 (05:37 +0000)]
Extract out getConstantRangeFromMetadata; NFC
The loop idiom creating a ConstantRange is repeated twice in the
codebase, time to give it a name and a home.
The loop is also repeated in `rangeMetadataExcludesValue`, but using
`getConstantRangeFromMetadata` there would not be an NFC -- the range
returned by `getConstantRangeFromMetadata` may contain a value that none
of the subranges did.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251180
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sat, 24 Oct 2015 05:37:28 +0000 (05:37 +0000)]
Fix whitespace issues in two places; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251179
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 24 Oct 2015 05:26:02 +0000 (05:26 +0000)]
llvm/Transforms/Utils/LoopVersioning.h requires llvm/Analysis/LoopAccessAnalysis.h for RuntimePointerChecking::PointerCheck.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251178
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Sat, 24 Oct 2015 01:16:40 +0000 (01:16 +0000)]
[libFuzzer] add -merge flag to merge corpora
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251168
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 24 Oct 2015 00:27:22 +0000 (00:27 +0000)]
Fix ADT/UniqueVector.h to resolve implicit dependency.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251165
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Sat, 24 Oct 2015 00:25:18 +0000 (00:25 +0000)]
llvm/module.modulemap: AVR.def should be textual header.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251163
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 24 Oct 2015 00:12:56 +0000 (00:12 +0000)]
AMDGPU: Print modifiers when dumping AMDGPUOperand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251160
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Laevsky [Fri, 23 Oct 2015 22:42:44 +0000 (22:42 +0000)]
[RS4GC] Rename stripDereferenceabilityInfo into stripNonValidAttributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251157
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 23 Oct 2015 21:48:05 +0000 (21:48 +0000)]
Add a RAW mode to StringTableBuilder.
In this mode it just tries to tail merge the strings without imposing any other
format constrains. It will not, for example, add a null byte between them.
Also add support for keeping a tentative size and offset if we decide to
not optimize after all.
This will be used shortly in lld for merging SHF_STRINGS sections.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251153
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Fri, 23 Oct 2015 21:13:01 +0000 (21:13 +0000)]
Revert rL251061 [SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251149
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 23 Oct 2015 20:37:08 +0000 (20:37 +0000)]
Handle non-constant shifts in computeKnownBits, and use computeKnownBits for constant folding in InstCombine/Simplify
First, the motivation: LLVM currently does not realize that:
((2072 >> (L == 0)) >> 7) & 1 == 0
where L is some arbitrary value. Whether you right-shift 2072 by 7 or by 8, the
lowest-order bit is always zero. There are obviously several ways to go about
fixing this, but the generic solution pursued in this patch is to teach
computeKnownBits something about shifts by a non-constant amount. Previously,
we would give up completely on these. Instead, in cases where we know something
about the low-order bits of the shift-amount operand, we can combine (and
together) the associated restrictions for all shift amounts consistent with
that knowledge. As a further generalization, I refactored all of the logic for
all three kinds of shifts to have this capability. This works well in the above
case, for example, because the dynamic shift amount can only be 0 or 1, and
thus we can say a lot about the known bits of the result.
This brings us to the second part of this change: Even when we know all of the
bits of a value via computeKnownBits, nothing used to constant-fold the result.
This introduces the necessary code into InstCombine and InstSimplify. I've
added it into both because:
1. InstCombine won't automatically pick up the associated logic in
InstSimplify (InstCombine uses InstSimplify, but not via the API that
passes in the original instruction).
2. Putting the logic in InstCombine allows the resulting simplifications to become
part of the iterative worklist
3. Putting the logic in InstSimplify allows the resulting simplifications to be
used by everywhere else that calls SimplifyInstruction (inlining, unrolling,
and many others).
And this requires a small change to our definition of an ephemeral value so
that we don't break the rest case from r246696 (where the icmp feeding the
@llvm.assume, is also feeding a br). Under the old definition, the icmp would
not be considered ephemeral (because it is used by the br), but this causes the
assume to remove itself (in addition to simplifying the branch structure), and
it seems more-useful to prevent that from happening.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251146
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Fri, 23 Oct 2015 20:30:02 +0000 (20:30 +0000)]
GVN: don't try to replace instruction with itself.
After some look-ahead PRE was added for GEPs, an instruction could end
up in the table of candidates before it was actually inspected. When
this happened the pass might decide it was the best candidate to
replace itself. This didn't go well.
Should fix PR25291
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251145
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 23 Oct 2015 20:15:35 +0000 (20:15 +0000)]
Fix the variable names to match the LLVM style.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251143
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 23 Oct 2015 20:09:57 +0000 (20:09 +0000)]
[SCEV] Fix stylistic issue in MatchBinaryAddToConst; NFCI
Instead of checking `(FlagsPresent & ExpectedFlags) != 0`, check
`(FlagsPresent & ExpectedFlags) == ExpectedFlags`. Right now they're
equivalent since `ExpectedFlags` can only be either `FlagNUW` or
`FlagNSW`, but if we ever pass in `ExpectedFlags` as `FlagNUW | FlagNSW`
then checking `(FlagsPresent & ExpectedFlags) != 0` would be wrong.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251142
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 23 Oct 2015 20:09:55 +0000 (20:09 +0000)]
[Inliner] Don't inline through callsites with operand bundles
Summary:
This change teaches the LLVM inliner to not inline through callsites
with unknown operand bundles. Currently all operand bundles are
"unknown" operand bundles but in the near future we will add support for
inlining through some select kinds of operand bundles.
Reviewers: reames, chandlerc, majnemer
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14001
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251141
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Bieneman [Fri, 23 Oct 2015 19:48:17 +0000 (19:48 +0000)]
[CMake] Fixing dependency issue with parallel make when building with LLVM_OPTIMIZED_TABLEGEN.
Patch by Alex Wang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251138
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 23 Oct 2015 19:35:38 +0000 (19:35 +0000)]
[X86] Clean up the tail call eligibility logic
Summary:
The logic here isn't straightforward because our support for
TargetOptions::GuaranteedTailCallOpt.
Also fix a bug where we were allowing tail calls to cdecl functions from
fastcall and vectorcall functions. We were special casing thiscall and
stdcall callers rather than checking for any convention that requires
clearing stack arguments before returning.
Reviewers: hans
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D14024
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251137
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 23 Oct 2015 18:46:43 +0000 (18:46 +0000)]
[RuntimeDyld][COFF] Fix a think-o in the handling of the IMAGE_REL_AMD64_ADDR64
relocation that was introduced in r250733.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251135
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Fri, 23 Oct 2015 18:37:58 +0000 (18:37 +0000)]
[libFuzzer] remove some old code; also make __sanitizer_get_total_unique_caller_callee_pairs weak so that newer libFuzzer works with older asan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251133
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 23 Oct 2015 18:07:58 +0000 (18:07 +0000)]
AMDGPU: Fix parsing of 32-bit literals with sign bit set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251132
91177308-0d34-0410-b5e6-
96231b3b80d8
Jonathan Roelofs [Fri, 23 Oct 2015 17:42:51 +0000 (17:42 +0000)]
Fix another reference to in-source builds
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251127
91177308-0d34-0410-b5e6-
96231b3b80d8
Artyom Skrobov [Fri, 23 Oct 2015 17:19:19 +0000 (17:19 +0000)]
[ARM] Renaming +t2dsp feature into +dsp, as discussed on llvm-dev
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251125
91177308-0d34-0410-b5e6-
96231b3b80d8
Oleg Ranevskyy [Fri, 23 Oct 2015 17:17:59 +0000 (17:17 +0000)]
[ARM CodeGen] @llvm.debugtrap call may be removed when restoring callee saved registers
Summary:
When ARMFrameLowering::emitPopInst generates a "pop" instruction to restore the callee saved registers, it checks if the LR register is among them. If so, the function may decide to remove the basic block's terminator and replace it with a "pop" to the PC register instead of LR.
This leads to a problem when the block's terminator is preceded by a "llvm.debugtrap" call. The MI iterator points to the trap in such a case, which is also a terminator. If the function decides to restore LR to PC, it erroneously removes the trap.
Reviewers: asl, rengolin
Subscribers: aemerson, jfb, rengolin, dschuff, llvm-commits
Differential Revision: http://reviews.llvm.org/D13672
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251123
91177308-0d34-0410-b5e6-
96231b3b80d8
Oleg Ranevskyy [Fri, 23 Oct 2015 17:10:44 +0000 (17:10 +0000)]
Test commit: fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251122
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 23 Oct 2015 16:52:22 +0000 (16:52 +0000)]
[llvm-readobj] Don't cast qualifiers away. Now gcc is happy again.
Reported by: mikael.holmen at ericsson.com
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251117
91177308-0d34-0410-b5e6-
96231b3b80d8
Joseph Tremoulet [Fri, 23 Oct 2015 15:06:05 +0000 (15:06 +0000)]
[CodeGen] Mark setjmp/catchret MBBs address-taken
Summary:
This ensures that BranchFolding (and similar) won't remove these blocks.
Also allow AsmPrinter::EmitBasicBlockStart to process MBBs which are
address-taken but do not have BBs that are address-taken, since otherwise
its call to getAddrLabelSymbolTableToEmit would fail an assertion on such
blocks. I audited the other callers of getAddrLabelSymbolTableToEmit
(and getAddrLabelSymbol); they all have BBs known to be address-taken
except for the call through getAddrLabelSymbol from
WinException::create32bitRef; that call is actually now unreachable, so
I've removed it and updated the signature of create32bitRef.
This fixes PR25168.
Reviewers: majnemer, andrew.w.kaylor, rnk
Subscribers: pgavlin, llvm-commits
Differential Revision: http://reviews.llvm.org/D13774
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251113
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Fri, 23 Oct 2015 14:17:03 +0000 (14:17 +0000)]
[BasicAA] Bugfix for r251016
If the loaded type sizes don't match the element type of the sequential type, all bets are off and the addresses may, indeed, overlap.
Surprisingly, this just got caught in one test, on one builder, out of the 30+ builders testing this change. Congratulations go to http://lab.llvm.org:8011/builders/clang-aarch64-lnt/builds/5205.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251112
91177308-0d34-0410-b5e6-
96231b3b80d8
James Molloy [Fri, 23 Oct 2015 10:41:38 +0000 (10:41 +0000)]
Revert "[AArch64]Merge halfword loads into a 32-bit load"
This reverts commit r250719. This introduced a codegen fault in SPEC2000.gcc, when compiled for Cortex-A53.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251108
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 23 Oct 2015 06:57:21 +0000 (06:57 +0000)]
[SCEV] Get rid of an unnecessary lambda; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251099
91177308-0d34-0410-b5e6-
96231b3b80d8
Zlatko Buljan [Fri, 23 Oct 2015 06:39:29 +0000 (06:39 +0000)]
[mips][microMIPS] Implement SHLL.PH, SHLL_S.PH, SHLL.QB, SHLLV.PH, SHLLV_S.PH, SHLLV.QB, SHLLV_S.W, SHLL_S.W, SHRA.QB and SHRA_R.QB instructions
Differential Revision: http://reviews.llvm.org/D13929
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251098
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 23 Oct 2015 06:33:47 +0000 (06:33 +0000)]
[SCEV] Fix a latent bug in `getPreStartForExtend`
I could not come up a way to test this -- I think this bug is latent
today, and will not actually result in a miscompile.
In `getPreStartForExtend`, SCEV constructs `PreStart` as a sum of all of
`SA`'s operands except `Op`. It also uses `SA`'s no-wrap flags, and
this is problematic because removing an element from an add expression
can make it signed-wrap. E.g. if `SA` was `(127 + 1 + -1)`, then it
could safely be `<nsw>` (since `sext(127) + sext(1) + sext(-1)` ==
`sext(127 + 1 + -1)`), but `(127 + 1)` (== `PreStart` if `Op` is `-1`)
is not `<nsw>`.
Transferring `<nuw>` from `SA` to `PreStart` is safe, as far as I can
tell.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251097
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Fri, 23 Oct 2015 06:05:55 +0000 (06:05 +0000)]
[AVR] Add ELF constants to headers
Also adds a 'trivial' ELF file. This was generated by assembling
and linking a file with the symbol main which contains a single
return instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251096
91177308-0d34-0410-b5e6-
96231b3b80d8
Saleem Abdulrasool [Fri, 23 Oct 2015 05:26:03 +0000 (05:26 +0000)]
Support, IR: silence -Wunused-parameter
If this is used outside of LLVM with -Werror, this would cause a failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251094
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Fri, 23 Oct 2015 04:22:58 +0000 (04:22 +0000)]
Add more intrumentation/runtime helper interfaces (NFC)
This patch converts the remaining references to literal
strings for names of profile runtime entites (such as
profile runtime hook, runtime hook use function, profile
init method, register function etc).
Also added documentation for all the new interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251093
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 23 Oct 2015 01:28:05 +0000 (01:28 +0000)]
[LangRef] Fix the doc for operand bundles
I accidentally messed this up after a merge conflict in a previous
commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251089
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 23 Oct 2015 01:04:45 +0000 (01:04 +0000)]
SLPVectorizer: AllSameOpcode* starts "true" only for instructions
r251085 wasn't as NFC as intended...
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251087
91177308-0d34-0410-b5e6-
96231b3b80d8
Mehdi Amini [Fri, 23 Oct 2015 00:46:17 +0000 (00:46 +0000)]
SLPVectorizer: refactor reorderInputsAccordingToOpcode (NFC)
This is intended to simplify the changes needed to solve PR25247.
From: Mehdi Amini <mehdi.amini@apple.com>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251085
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 23 Oct 2015 00:17:40 +0000 (00:17 +0000)]
[CodeGen] Remove usage of NDEBUG in header.
Moreover, this seems unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251081
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 22 Oct 2015 23:55:39 +0000 (23:55 +0000)]
[libFuzzer] use the indirect caller-callee counter as an independent search heuristic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251078
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 22 Oct 2015 22:56:45 +0000 (22:56 +0000)]
[libFuzzer] more refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251075
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 22 Oct 2015 22:50:47 +0000 (22:50 +0000)]
[libFuzzer] refactoring the code that checks the coverage. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251074
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Thu, 22 Oct 2015 21:51:09 +0000 (21:51 +0000)]
Minor bug fix in Profile Name Prefix interface
Exposed in uses by clang FE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251070
91177308-0d34-0410-b5e6-
96231b3b80d8
Kostya Serebryany [Thu, 22 Oct 2015 21:48:09 +0000 (21:48 +0000)]
[libFuzzer] remove the deprecated 'tokens' feature
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251069
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 22 Oct 2015 21:31:34 +0000 (21:31 +0000)]
LoopPass: Remove redoLoop, it isn't used. NFC
In r251064 I removed a logically unreachable call to `redoLoop`, and
now there aren't any callers of this API at all. Remove the needless
complexity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251067
91177308-0d34-0410-b5e6-
96231b3b80d8
Justin Bogner [Thu, 22 Oct 2015 21:21:32 +0000 (21:21 +0000)]
LoopPass: Simplify the API for adding a new loop. NFC
The insertLoop() API is only used to add new loops, and has confusing
ownership semantics. Simplify it by replacing it with addLoop().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251064
91177308-0d34-0410-b5e6-
96231b3b80d8
Chen Li [Thu, 22 Oct 2015 20:48:38 +0000 (20:48 +0000)]
[SimplifyCFG] Extend SimplifyResume to handle phi of trivial landing pad.
Summary: Currently SimplifyResume can convert an invoke instruction to a call instruction if its landing pad is trivial. In practice we could have several invoke instructions with trivial landing pads and share a common rethrow block, and in the common rethrow block, all the landing pads join to a phi node. The patch extends SimplifyResume to check the phi of landing pad and their incoming blocks. If any of them is trivial, remove it from the phi node and convert the invoke instruction to a call instruction.
Reviewers: hfinkel, reames
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D13718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251061
91177308-0d34-0410-b5e6-
96231b3b80d8
Xinliang David Li [Thu, 22 Oct 2015 20:32:12 +0000 (20:32 +0000)]
Add helper functions and remove hard coded references to instProf related name/name-prefixes
This is a clean up patch that defines instr prof section and variable
name prefixes in a common header with access helper functions.
clang FE change will be done as a follow up once this patch is in.
Differential Revision: http://reviews.llvm.org/D13919
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251058
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 22 Oct 2015 20:29:08 +0000 (20:29 +0000)]
[Sink] Don't check BB.empty()
As an invariant, BasicBlocks cannot be empty when passed to a transform.
This is not the case for MachineBasicBlocks and the Sink pass was ported
from the MachineSink pass which would explain the check's existence.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251057
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Thu, 22 Oct 2015 20:07:28 +0000 (20:07 +0000)]
[ASan] Enable instrumentation of dynamic allocas by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251056
91177308-0d34-0410-b5e6-
96231b3b80d8