OSDN Git Service

android-x86/external-llvm.git
7 years agoTemporarily revert "Update branch coalescing to be a PowerPC specific pass"
Eric Christopher [Thu, 31 Aug 2017 05:56:16 +0000 (05:56 +0000)]
Temporarily revert "Update branch coalescing to be a PowerPC specific pass"
From comments and code review it wasn't intended to be enabled by default yet.

This reverts commit r311588.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312214 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Don't assert in TTI with fp32 denorms enabled
Matt Arsenault [Thu, 31 Aug 2017 05:47:00 +0000 (05:47 +0000)]
AMDGPU: Don't assert in TTI with fp32 denorms enabled

Also refine for f16 and rcp cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312213 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "llvm-mt: Fix release of OutputDoc"
Vitaly Buka [Thu, 31 Aug 2017 05:32:36 +0000 (05:32 +0000)]
Revert "llvm-mt: Fix release of OutputDoc"

Multiple bots are broken.

This reverts commit r312207.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312212 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agollvm-mt: Fix release of OutputDoc
Vitaly Buka [Thu, 31 Aug 2017 02:38:58 +0000 (02:38 +0000)]
llvm-mt: Fix release of OutputDoc

Summary:
xmlDoc needs to be released with xmlFreeDoc.
Reset root element before release to avoid release of CombinedRoot owned
by CombinedDoc,

Reviewers: ecbeckmann, rnk, zturner, ruiu

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37321

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312207 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Use set for tracked registers
Matt Arsenault [Thu, 31 Aug 2017 01:53:09 +0000 (01:53 +0000)]
AMDGPU: Use set for tracked registers

The majority of the time spent in the pass checking
for the register reads. Rather than searching all of
the defined registers for uses in each instruction,
use a set of defined registers and check the operands
of the instruction.

This process still is algorithmically not great,
but with the additional trick of skipping the analysis
for addresses with one use, this brings one slow
testcase into a reasonable range.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312206 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Add a comment about member variable dependencies to OrcMCJITReplacement.
Lang Hames [Thu, 31 Aug 2017 01:09:56 +0000 (01:09 +0000)]
[Orc] Add a comment about member variable dependencies to OrcMCJITReplacement.

The comment explains the reason behind the change in member variable order in
r312086.

Thanks to Philip Reames for the suggestion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312205 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[XRay][tools] Fix an accounting bug in llvm-xray account
Dean Michael Berris [Thu, 31 Aug 2017 01:07:24 +0000 (01:07 +0000)]
[XRay][tools] Fix an accounting bug in llvm-xray account

Summary:
Before this patch, llvm-xray account will assume that thread stacks will
not be empty. Unfortunately there are cases where an instrumented
function will see a call to `fork()` which will cause the child process
to not see the start of the function, but only see the end of the
function. The tooling cannot assume that threads will always have
perfect stacks, and so we change it to support this reality.

Reviewers: dblaikie

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31870

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312204 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agocmake: Invent add_llvm_fuzzer to set up fuzzer targets
Justin Bogner [Thu, 31 Aug 2017 00:36:33 +0000 (00:36 +0000)]
cmake: Invent add_llvm_fuzzer to set up fuzzer targets

This moves the cmake configuration for fuzzers in LLVM to a new macro,
add_llvm_fuzzer. This will make it easier to keep things consistent
while implementing llvm.org/pr34314.

I've also made a couple of minor functional changes here:

- the fuzzers now use add_llvm_executable rather than add_llvm_tool.
  This means they won't create install targets and stuff like that,
  because those made little sense for these fuzzers.
- I've grouped these under "Fuzzers" rather than in with "Tools" for
  people who build with IDEs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312200 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "Revert r312139 "Verifier: Verify the correctness of fragment expressions...
Adrian Prantl [Thu, 31 Aug 2017 00:07:33 +0000 (00:07 +0000)]
Revert "Revert r312139 "Verifier: Verify the correctness of fragment expressions attached to globals.""

This reverts commit r312182 after fixing PR34390.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312197 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoDon't add a fragment expression when GlobalSRA splits up a single-member struct
Adrian Prantl [Thu, 31 Aug 2017 00:06:18 +0000 (00:06 +0000)]
Don't add a fragment expression when GlobalSRA splits up a single-member struct

Fixes PR34390.

https://bugs.llvm.org/show_bug.cgi?id=34390

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312196 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agollvm-isel-fuzzer: Stop including FuzzerInterface.h
Justin Bogner [Thu, 31 Aug 2017 00:01:28 +0000 (00:01 +0000)]
llvm-isel-fuzzer: Stop including FuzzerInterface.h

All this does is forward declare the interface functions (and make
sure that they're `extern "C"`), but since we're using libFuzzer from
the toolchain it doesn't make sense to include the local copy of the
interface.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312195 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MachineOutliner] Add missed optimization remarks for the outliner.
Jessica Paquette [Wed, 30 Aug 2017 23:31:49 +0000 (23:31 +0000)]
[MachineOutliner] Add missed optimization remarks for the outliner.

This adds missed optimization remarks which report viable candidates that
were not outlined because they would increase code size.

Other remarks will come in separate commits.

This will help to diagnose code size regressions and changes in outliner
behaviour in projects using the outliner.

https://reviews.llvm.org/D37085

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312194 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[yaml2obj][ELF] Make symbols optional for relocations
Petr Hosek [Wed, 30 Aug 2017 23:13:31 +0000 (23:13 +0000)]
[yaml2obj][ELF] Make symbols optional for relocations

Some kinds of relocations do not have symbols, like R_X86_64_RELATIVE
for instance. I would like to test this case in D36554 but currently
can't because symbols are required by yaml2obj. The other option is
using the empty symbol but that doesn't seem quite right to me.

This change makes the Symbol field of Relocation optional and in the
case where the user does not specify a symbol name the Symbol index is 0.

Patch by Jake Ehrlich

Differential Revision: https://reviews.llvm.org/D37276

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312192 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove some code from fast isel that is no longer needed with i1 being an illeg...
Craig Topper [Wed, 30 Aug 2017 23:05:54 +0000 (23:05 +0000)]
[X86] Remove some code from fast isel that is no longer needed with i1 being an illegal type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312190 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Matt Morehouse [Wed, 30 Aug 2017 22:49:31 +0000 (22:49 +0000)]
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer

Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Only enable on Linux.

Reviewers: vitalybuka, kcc, george.karpenkov

Reviewed By: kcc

Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D37156

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312185 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r312139 "Verifier: Verify the correctness of fragment expressions attached...
Hans Wennborg [Wed, 30 Aug 2017 22:41:27 +0000 (22:41 +0000)]
Revert r312139 "Verifier: Verify the correctness of fragment expressions attached to globals."

This caused PR34390.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312182 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Replace fixed-size SmallSet with a bitset.
Benjamin Kramer [Wed, 30 Aug 2017 22:28:30 +0000 (22:28 +0000)]
[ARM] Replace fixed-size SmallSet with a bitset.

It's smaller. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312180 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Correct operand types for v_mad_mix*
Matt Arsenault [Wed, 30 Aug 2017 22:18:40 +0000 (22:18 +0000)]
AMDGPU: Correct operand types for v_mad_mix*

These aren't really packed instructions, so the default
op_sel_hi should be 0 since this indicates a conversion.
The operand types are scalar values that behave similar
to an f16 scalar that may be converted to f32.

Doesn't change the default printing for op_sel_hi, just
the parsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312179 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert r312154 "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source...
Hans Wennborg [Wed, 30 Aug 2017 22:11:37 +0000 (22:11 +0000)]
Revert r312154 "Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding""

It caused PR34387: Assertion failed: (RegNo < NumRegs && "Attempting to access record for invalid register number!")

> Issues identified by buildbots addressed since original review:
> - Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
> - The pass no longer forwards COPYs to physical register uses, since
>   doing so can break code that implicitly relies on the physical
>   register number of the use.
> - The pass no longer forwards COPYs to undef uses, since doing so
>   can break the machine verifier by creating LiveRanges that don't
>   end on a use (since the undef operand is not considered a use).
>
>   [MachineCopyPropagation] Extend pass to do COPY source forwarding
>
>   This change extends MachineCopyPropagation to do COPY source forwarding.
>
>   This change also extends the MachineCopyPropagation pass to be able to
>   be run during register allocation, after physical registers have been
>   assigned, but before the virtual registers have been re-written, which
>   allows it to remove virtual register COPY LiveIntervals that become dead
>   through the forwarding of all of their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312178 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSimplify writeArchive return type.
Rui Ueyama [Wed, 30 Aug 2017 22:11:03 +0000 (22:11 +0000)]
Simplify writeArchive return type.

writeArchive returned a pair, but the first element of the pair is always
its first argument on failure, so it doesn't make sense to return it from
the function. This patch change the return type so that it does't return it.

Differential Revision: https://reviews.llvm.org/D37313

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312177 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix test after rL312144
Konstantin Zhuravlyov [Wed, 30 Aug 2017 21:59:14 +0000 (21:59 +0000)]
Fix test after rL312144

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312176 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] add more vector demand examples; NFC
Sanjay Patel [Wed, 30 Aug 2017 21:11:46 +0000 (21:11 +0000)]
[InstCombine] add more vector demand examples; NFC

See D37236 for discussion. It seems unlikely that we actually want/need
to do this kind of folding in InstCombine in the long run, but moving
everything will be a bigger follow-up step.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312172 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSelectionDAG: Emit correct debug info for multi-register function arguments.
Adrian Prantl [Wed, 30 Aug 2017 20:51:20 +0000 (20:51 +0000)]
SelectionDAG: Emit correct debug info for multi-register function arguments.

Previously we would just describe the first register and then call it
quits. This patch emits fragment expressions for each register.

<rdar://problem/34075307>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312169 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[IR] Don't print "!DIExpression() = !DIExpression()" when dumping
Reid Kleckner [Wed, 30 Aug 2017 20:40:36 +0000 (20:40 +0000)]
[IR] Don't print "!DIExpression() = !DIExpression()" when dumping

Now that we print DIExpressions inline everywhere, we don't need to
print them once as an operand and again as a value. This is only really
visible when calling dump() or print() directly on a DIExpression during
debugging.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312168 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRefactor DIBuilder::createFragmentExpression into a static DIExpression member
Adrian Prantl [Wed, 30 Aug 2017 20:04:17 +0000 (20:04 +0000)]
Refactor DIBuilder::createFragmentExpression into a static DIExpression member

NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312165 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] Use Swift error registers on non-Darwin targets
Brian Gesiak [Wed, 30 Aug 2017 20:03:54 +0000 (20:03 +0000)]
[ARM] Use Swift error registers on non-Darwin targets

Summary:
Remove a check for `ARMSubtarget::isTargetDarwin` when determining
whether to use Swift error registers, so that Swift errors work
properly on non-Darwin ARM32 targets (specifically Android).

Before this patch, generated code would save and restores ARM register r8 at
the entry and returns of a function that throws. As r8 is used as a virtual
return value for the object being thrown, this gets overwritten by the restore,
and calling code is unable to catch the error. In turn this caused Swift code
that used `do`/`try`/`catch` to work improperly on Android ARM32 targets.

Addresses Swift bug report https://bugs.swift.org/browse/SR-5438.

Patch by John Holdsworth.

Reviewers: manmanren, rjmccall, aschwaighofer

Reviewed By: aschwaighofer

Subscribers: srhines, aschwaighofer, aemerson, javed.absar, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D35835

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312164 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Update debug info test after r312144
Derek Schuff [Wed, 30 Aug 2017 19:54:08 +0000 (19:54 +0000)]
[WebAssembly] Update debug info test after r312144

Add the expr field to the DIGlobalVariableExpression

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312163 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Make sure we add the correct user if we swapped the comparison operands
Daniel Berlin [Wed, 30 Aug 2017 19:53:23 +0000 (19:53 +0000)]
NewGVN: Make sure we add the correct user if we swapped the comparison operands

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312162 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoNewGVN: Allow simplification into variables
Daniel Berlin [Wed, 30 Aug 2017 19:52:39 +0000 (19:52 +0000)]
NewGVN: Allow simplification into variables

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312161 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GISel]: Add a clean up combiner during legalization.
Aditya Nandakumar [Wed, 30 Aug 2017 19:32:59 +0000 (19:32 +0000)]
[GISel]: Add a clean up combiner during legalization.

Added a combiner which can clean up truncs/extends that are created in
order to make the types work during legalization.

Also moved the combineMerges to the LegalizeCombiner.

https://reviews.llvm.org/D36880

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312158 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GVNSink] Remove dependency on SmallPtrSet iteration order.
Benjamin Kramer [Wed, 30 Aug 2017 18:46:37 +0000 (18:46 +0000)]
[GVNSink] Remove dependency on SmallPtrSet iteration order.

Found by LLVM_ENABLE_REVERSE_ITERATION.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312156 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"
Geoff Berry [Wed, 30 Aug 2017 18:41:07 +0000 (18:41 +0000)]
Re-enable "[MachineCopyPropagation] Extend pass to do COPY source forwarding"

Issues identified by buildbots addressed since original review:
- Fixed ARMLoadStoreOptimizer bug exposed by this change in r311907.
- The pass no longer forwards COPYs to physical register uses, since
  doing so can break code that implicitly relies on the physical
  register number of the use.
- The pass no longer forwards COPYs to undef uses, since doing so
  can break the machine verifier by creating LiveRanges that don't
  end on a use (since the undef operand is not considered a use).

  [MachineCopyPropagation] Extend pass to do COPY source forwarding

  This change extends MachineCopyPropagation to do COPY source forwarding.

  This change also extends the MachineCopyPropagation pass to be able to
  be run during register allocation, after physical registers have been
  assigned, but before the virtual registers have been re-written, which
  allows it to remove virtual register COPY LiveIntervals that become dead
  through the forwarding of all of their uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312154 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove unneed AVX512 check from fast isel.
Craig Topper [Wed, 30 Aug 2017 18:08:58 +0000 (18:08 +0000)]
[X86] Remove unneed AVX512 check from fast isel.

This is no longer necessary now that i1 is illegal.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312146 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[WebAssembly] Add target feature for atomics
Derek Schuff [Wed, 30 Aug 2017 18:07:45 +0000 (18:07 +0000)]
[WebAssembly] Add target feature for atomics

Summary:
This tracks the WebAssembly threads feature proposal at
https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.md

Differential Revision: https://reviews.llvm.org/D37300

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312145 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoCanonicalize the representation of empty an expression in DIGlobalVariableExpression
Adrian Prantl [Wed, 30 Aug 2017 18:06:51 +0000 (18:06 +0000)]
Canonicalize the representation of empty an expression in DIGlobalVariableExpression

This change simplifies code that has to deal with
DIGlobalVariableExpression and mirrors how we treat DIExpressions in
debug info intrinsics. Before this change there were two ways of
representing empty expressions on globals, a nullptr and an empty
!DIExpression().

If someone needs to upgrade out-of-tree testcases:
  perl -pi -e 's/(!DIGlobalVariableExpression\(var: ![0-9]*)\)/\1, expr: !DIExpression())/g' <MYTEST.ll>
will catch 95%.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312144 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[codeview] make DbgVariableLocation::extractFromMachineInstruction use Optional
Bob Haarman [Wed, 30 Aug 2017 17:50:21 +0000 (17:50 +0000)]
[codeview] make DbgVariableLocation::extractFromMachineInstruction use Optional

Summary:
DbgVariableLocation::extractFromMachineInstruction originally
returned a boolean indicating success. This change makes it return
an Optional<DbgVariableLocation> so we cannot try to access the fields
of the struct if they aren't valid.

Reviewers: aprantl, rnk, zturner

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D37279

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312143 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agodocs: remove dead doxygen tarball link
Hans Wennborg [Wed, 30 Aug 2017 17:40:28 +0000 (17:40 +0000)]
docs: remove dead doxygen tarball link

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312142 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoVerifier: Verify the correctness of fragment expressions attached to globals.
Adrian Prantl [Wed, 30 Aug 2017 16:49:21 +0000 (16:49 +0000)]
Verifier: Verify the correctness of fragment expressions attached to globals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312139 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] Don't use 32-bit elements version of AND/OR/XOR/ANDN during isel unless...
Craig Topper [Wed, 30 Aug 2017 16:38:33 +0000 (16:38 +0000)]
[AVX512] Don't use 32-bit elements version of AND/OR/XOR/ANDN during isel unless we're matching a masked op or broadcast

Selecting 32-bit element logical ops without a select or broadcast requires matching a bitconvert on the inputs to the and. But that's a weird thing to rely on. It's entirely possible that one of the inputs doesn't have a bitcast and one does.

Since there's no functional difference, just remove the extra patterns and save some isel table size.

Differential Revision: https://reviews.llvm.org/D36854

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312138 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Remove GCCBuiltin for some intrinsics that aren't used by clang. Add TODO to...
Craig Topper [Wed, 30 Aug 2017 16:28:09 +0000 (16:28 +0000)]
[X86] Remove GCCBuiltin for some intrinsics that aren't used by clang. Add TODO to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312136 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[GlobalISel][X86] Support variadic function call.
Igor Breger [Wed, 30 Aug 2017 15:10:15 +0000 (15:10 +0000)]
[GlobalISel][X86] Support variadic function call.

Summary: Support variadic function call. Port the implementation from X86FastISel.

Reviewers: zvi, guyblank, oren_ben_simhon

Reviewed By: guyblank

Subscribers: rovka, kristof.beyls, llvm-commits

Differential Revision: https://reviews.llvm.org/D37261

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312130 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRe-land MachineInstr: Reason locally about some memory objects before going to AA.
Balaram Makam [Wed, 30 Aug 2017 14:57:12 +0000 (14:57 +0000)]
Re-land MachineInstr: Reason locally about some memory objects before going to AA.

Summary:
Reverts r311008 to reinstate r310825 with a fix.

Refine alias checking for pseudo vs value to be conservative.
This fixes the original failure in builtbot unittest SingleSource/UnitTests/2003-07-09-SignedArgs.

Reviewers: hfinkel, nemanjai, efriedma

Reviewed By: efriedma

Subscribers: bjope, mcrosier, nhaehnle, javed.absar, llvm-commits

Differential Revision: https://reviews.llvm.org/D36900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312126 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] remove unnecessary vector select fold; NFCI
Sanjay Patel [Wed, 30 Aug 2017 14:04:57 +0000 (14:04 +0000)]
[InstCombine] remove unnecessary vector select fold; NFCI

This code is double-dead:
1. We simplify all selects with constant true/false condition in InstSimplify.
   I've minimized/moved the tests to show that works as expected.
2. All remaining vector selects with a constant condition are canonicalized to
   shufflevector, so we really can't see this pattern.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312123 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofix more typos; NFC
Sanjay Patel [Wed, 30 Aug 2017 13:19:23 +0000 (13:19 +0000)]
fix more typos; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312120 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agofix typos; NFC
Sanjay Patel [Wed, 30 Aug 2017 13:16:25 +0000 (13:16 +0000)]
fix typos; NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312119 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[MIPS] Add support to match more patterns for BBIT instruction
Strahinja Petrovic [Wed, 30 Aug 2017 11:25:38 +0000 (11:25 +0000)]
[MIPS] Add support to match more patterns for BBIT instruction

This patch supports one more pattern for bbit0 and bbit1
instructions, CBranchBitNum class is expanded  so it can
take 32 bit immidate.

Differential Revision: https://reviews.llvm.org/D36222

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312111 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Fold insert sequence if first ins has multiple users.
Florian Hahn [Wed, 30 Aug 2017 10:54:21 +0000 (10:54 +0000)]
[InstCombine] Fold insert sequence if first ins has multiple users.

Summary:
If the first insertelement instruction has multiple users and inserts at
position 0, we can re-use this instruction when folding a chain of
insertelement instructions. As we need to generate the first
insertelement instruction anyways, this should be a strict improvement.

We could get rid of the restriction of inserting at position 0 by
creating a different shufflemask, but it is probably worth to keep the
first insertelement instruction with position 0, as this is easier to do
efficiently than at other positions I think.

Reviewers: grosser, mkuper, fpetrogalli, efriedma

Reviewed By: fpetrogalli

Subscribers: gareevroman, llvm-commits

Differential Revision: https://reviews.llvm.org/D37064

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312110 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AArch64] allow v4f16 types when FullFP16 is supported
Sjoerd Meijer [Wed, 30 Aug 2017 08:38:13 +0000 (08:38 +0000)]
[AArch64] allow v4f16 types when FullFP16 is supported

Support for scalars was committed in r311154, this adds support for allowing
v4f16 vector types (thus avoiding conversions from/to single precision for
these types).

Differential Revision: https://reviews.llvm.org/D37145

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312104 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86][Skylake] Fixing duplicated prefixes in the run command of Code Gen regression...
Gadi Haber [Wed, 30 Aug 2017 08:08:50 +0000 (08:08 +0000)]
[X86][Skylake] Fixing duplicated prefixes in the run command of Code Gen regression tests

NFC.
Replaced duplicated HASWELL prefixes in run commands in the X86 Code Gen regression tests by the SKYLAKE prefix when the -mcpu is set to skylake.
The fix is needed in preparation of an upcoming patch containing the Skylake scheduling info.

Reviewers: zvi, RKSimon, aymanmus, igorb

Differential Revision: https://reviews.llvm.org/D37258

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312103 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] Correct isel patterns to support selecting masked vbroadcastf32x2/vbroadcast...
Craig Topper [Wed, 30 Aug 2017 07:48:39 +0000 (07:48 +0000)]
[AVX512] Correct isel patterns to support selecting masked vbroadcastf32x2/vbroadcasti32x2

Summary:
This patch adjusts the patterns to make the result type of the broadcast node vXf64/vXi64. Then adds a bitcast to vXi32 after that. Intrinsic lowering was also adjusted to generate this new pattern.

Fixes PR34357

We should probably just drop the intrinsic entirely and use native IR, but I'll leave that for a future patch.

Any idea what instruction we should be lowering the floating point 128-bit result version of this pattern to?  There's a 128-bit v2i32 integer broadcast but not an fp one.

Reviewers: aymanmus, zvi, igorb

Reviewed By: aymanmus

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37286

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312101 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AVX512] Use 256-bit extract instructions for extracting bits [255:128] from a 512...
Craig Topper [Wed, 30 Aug 2017 07:26:12 +0000 (07:26 +0000)]
[AVX512] Use 256-bit extract instructions for extracting bits [255:128] from a 512-bit register

This enables the use of a smaller encoding by using a VEX instruction when possible.

Differential Revision: https://reviews.llvm.org/D37092

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312100 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Apply SlowIncDec feature to Sandybridge/Ivybridge CPUs as well
Craig Topper [Wed, 30 Aug 2017 05:00:35 +0000 (05:00 +0000)]
[X86] Apply SlowIncDec feature to Sandybridge/Ivybridge CPUs as well

Currently we start applying this on Haswell and newer. I don't believe anything changed in the Haswell architecture to make this the right cutoff point. The partial flag handling around this has been roughly the same since Sandybridge.

Differential Revision: https://reviews.llvm.org/D37250

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312099 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cfi] Fixed non-determinism in codegen due to DenseSet iteration order
Mandeep Singh Grang [Wed, 30 Aug 2017 04:47:21 +0000 (04:47 +0000)]
[cfi] Fixed non-determinism in codegen due to DenseSet iteration order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312098 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Provide a separate feature bit for macro fusion support instead of basing it...
Craig Topper [Wed, 30 Aug 2017 04:34:48 +0000 (04:34 +0000)]
[X86] Provide a separate feature bit for macro fusion support instead of basing it on the AVX flag

Summary:
Currently we determine if macro fusion is supported based on the AVX flag as a proxy for the processor being Sandy Bridge".

This is really strange as now AMD supports AVX. It also means if user explicitly disables AVX we disable macro fusion.

This patch adds an explicit macro fusion feature. I've also enabled for the generic 64-bit CPU (which doesn't have AVX)

This is probably another candidate for being in the MI layer, but for now I at least wanted to correct the overloading of the AVX feature.

Reviewers: spatel, chandlerc, RKSimon, zvi

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37280

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312097 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Don't look for DS merge candidates with one use address
Matt Arsenault [Wed, 30 Aug 2017 03:26:18 +0000 (03:26 +0000)]
AMDGPU: Don't look for DS merge candidates with one use address

The merge is only possible if the base address register is the
same for the two instructions. If there is only the one use,
there's no point in doing an expensive forward scan checking
for memory interference looking for a merge candidate.

This gives a signficant improvement in one extreme testcase.
The code to do the scan is still algorithmically terrible,
so this is still the slowest pass in that example.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312096 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[AMDGPU] Use v_max_f* for fcanonicalize
Stanislav Mekhanoshin [Wed, 30 Aug 2017 03:03:38 +0000 (03:03 +0000)]
[AMDGPU] Use v_max_f* for fcanonicalize

If denorms are not flushed we can use max instead of multiplication
by 1. For double that is simply faster, while for float and half
it is shorter, because mul uses constant bus and VOP3.

Differential Revision: https://reviews.llvm.org/D36856

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312095 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[TableGen] Fix a range based for loop to take the value by reference so that Simplify...
Craig Topper [Wed, 30 Aug 2017 02:05:03 +0000 (02:05 +0000)]
[TableGen] Fix a range based for loop to take the value by reference so that SimplifyTree can modify the copy in the array if its needs to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312088 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Select clamp pattern with v2f16
Matt Arsenault [Wed, 30 Aug 2017 01:20:17 +0000 (01:20 +0000)]
AMDGPU: Select clamp pattern with v2f16

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312087 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Orc] Fix member variable ordering issue in OrcMCJITReplacement.
Lang Hames [Wed, 30 Aug 2017 00:47:42 +0000 (00:47 +0000)]
[Orc] Fix member variable ordering issue in OrcMCJITReplacement.

https://reviews.llvm.org/D36888

From that review description:

When an OrcMCJITReplacement object gets destructed, LazyEmitLayer may still
contain a shared_ptr of a module, which requires ShouldDelete in the deleter.
But ShouldDelete gets destructed before LazyEmitLayer due to the order of
declaration in OrcMCJITReplacement, which leads to a crash, when the destructor
of LazyEmitLayer is executed.  Changing the order of declaration fixes this.

Patch by Moritz Kroll. Thanks Moritz!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312086 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Error] Add an optional error message to cantFail.
Lang Hames [Tue, 29 Aug 2017 23:29:09 +0000 (23:29 +0000)]
[Error] Add an optional error message to cantFail.

cantFail is the moral equivalent of an assertion that the wrapped call must
return a success value. This patch allows clients to include an associated
error message (the same way they would for an assertion for llvm_unreachable).

If the error message is not specified it will default to: "Failure value
returned from cantFail wrapped call".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312066 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Finish the subtarget and predicate implementation of CLWB.
Craig Topper [Tue, 29 Aug 2017 23:13:36 +0000 (23:13 +0000)]
[X86] Finish the subtarget and predicate implementation of CLWB.

We don't have an intrinsic implemented for this instruction yet, but it looked odd that we were missing the accessor method from the subtarget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312064 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[codeview] add missing break in CodeGen/AsmPrinter/DebugHandlerBase.cpp
Bob Haarman [Tue, 29 Aug 2017 22:54:31 +0000 (22:54 +0000)]
[codeview] add missing break in CodeGen/AsmPrinter/DebugHandlerBase.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312055 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cfi] Avoid branch veneers in jump tables when possible.
Evgeniy Stepanov [Tue, 29 Aug 2017 22:40:19 +0000 (22:40 +0000)]
[cfi] Avoid branch veneers in jump tables when possible.

Summary:
When jumptable encoding does not match target code encoding (arm vs
thumb), a veneer is inserted by the linker. We can not avoid this
in all cases, because entries within one jumptable must have the same
encoding, but we can make it less common by selecting the jumptable
encoding to match the majority of its targets.

This change only covers FullLTO, and not ThinLTO.

Reviewers: pcc

Subscribers: aemerson, mehdi_amini, javed.absar, kristof.beyls, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D37171

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312054 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings...
Eugene Zelenko [Tue, 29 Aug 2017 22:32:07 +0000 (22:32 +0000)]
[CodeGen] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312053 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cfi] Build __cfi_check as Thumb when applicable.
Evgeniy Stepanov [Tue, 29 Aug 2017 22:29:15 +0000 (22:29 +0000)]
[cfi] Build __cfi_check as Thumb when applicable.

Summary:
Cross-DSO CFI needs all __cfi_check exports to use the same encoding
(ARM vs Thumb).

Reviewers: pcc

Subscribers: aemerson, srhines, kristof.beyls, hiraditya, llvm-commits

Differential Revision: https://reviews.llvm.org/D37243

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312052 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix the dwarfdump test so that it passes in its new location
Reid Kleckner [Tue, 29 Aug 2017 22:25:16 +0000 (22:25 +0000)]
Fix the dwarfdump test so that it passes in its new location

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312051 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoMove dwarfdump test to DebugInfo/X86 now that it looks for x86 register names
Reid Kleckner [Tue, 29 Aug 2017 22:16:11 +0000 (22:16 +0000)]
Move dwarfdump test to DebugInfo/X86 now that it looks for x86 register names

Otherwise this test will fail on bots (like the hexagon bot) that don't
enable the x86 backend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312050 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer"
Matt Morehouse [Tue, 29 Aug 2017 21:56:56 +0000 (21:56 +0000)]
Revert "[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer"

This reverts r312026 due to bot breakage.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312047 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopUnswitch] Fix a simple bug which disables loop unswitch for select statement
Wei Mi [Tue, 29 Aug 2017 21:45:11 +0000 (21:45 +0000)]
[LoopUnswitch] Fix a simple bug which disables loop unswitch for select statement

This is to fix PR34257. rL309059 takes an early return when FindLIVLoopCondition
fails to find a loop invariant condition. This is wrong and it will disable loop
unswitch for select. The patch fixes the bug.

Differential Revision: https://reviews.llvm.org/D36985

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312045 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix indentation of find_first_existing_vc_file
Reid Kleckner [Tue, 29 Aug 2017 21:44:46 +0000 (21:44 +0000)]
Fix indentation of find_first_existing_vc_file

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312044 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[cmake] Stop putting the revision info in LLVM_VERSION_STRING
Reid Kleckner [Tue, 29 Aug 2017 21:44:21 +0000 (21:44 +0000)]
[cmake] Stop putting the revision info in LLVM_VERSION_STRING

Summary:
This reduces the number of build actions after a no-op commit from
thousands to about six, which should be acceptable. If six actions is
still too many, developers can disable the LLVM_APPEND_VC_REV cmake
option.

llvm-config.h is a widely included header that should rarely change.
Before this patch, it would change after every re-configure. Very few
users of llvm-config.h need to know the precise version, and those that
do can migrate to incorporating LLVM_REVISION as provided by
llvm/Support/VCSRevision.h.

This should bring LLVM back to the behavior that it had before r306858
from June 30 2017. Most LLVM tools will now print a version string like
"6.0.0svn" instead of "6.0.0-git-c40c2a23de4".

Fixes PR34308

Reviewers: pcc, rafael, hans

Subscribers: mgorny, llvm-commits

Differential Revision: https://reviews.llvm.org/D37272

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312043 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[dwarfdump] Pretty print location expressions and location lists
Reid Kleckner [Tue, 29 Aug 2017 21:41:21 +0000 (21:41 +0000)]
[dwarfdump] Pretty print location expressions and location lists

Summary:
Based on Fred's patch here: https://reviews.llvm.org/D6771

I can't seem to commandeer the old review, so I'm creating a new one.

With that change the locations exrpessions are pretty printed inline in the
DIE tree. The output looks like this for debug_loc entries:

    DW_AT_location [DW_FORM_data4]        (0x00000000
       0x0000000000000001 - 0x000000000000000b: DW_OP_consts +3
       0x000000000000000b - 0x0000000000000012: DW_OP_consts +7
       0x0000000000000012 - 0x000000000000001b: DW_OP_reg0 RAX, DW_OP_piece 0x4
       0x000000000000001b - 0x0000000000000024: DW_OP_breg5 RDI+0)

And like this for debug_loc.dwo entries:
    DW_AT_location [DW_FORM_sec_offset]   (0x00000000
      Addr idx 2 (w/ length 190): DW_OP_consts +0, DW_OP_stack_value
      Addr idx 3 (w/ length 23): DW_OP_reg0 RAX, DW_OP_piece 0x4)

Simple locations without ranges are printed inline:

   DW_AT_location [DW_FORM_block1]       (DW_OP_reg4 RSI, DW_OP_piece 0x4, DW_OP_bit_piece 0x20 0x0)

The debug_loc(.dwo) dumping in changed accordingly to factor the code.

Reviewers: dblaikie, aprantl, friss

Subscribers: mgorny, javed.absar, hiraditya, llvm-commits, JDevlieghere

Differential Revision: https://reviews.llvm.org/D37123

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312042 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAMDGPU: Fix typo
Matt Arsenault [Tue, 29 Aug 2017 21:25:51 +0000 (21:25 +0000)]
AMDGPU: Fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312040 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoSimplify test case, so that it works for both trunk and release-5.0.
Joerg Sonnenberger [Tue, 29 Aug 2017 21:18:07 +0000 (21:18 +0000)]
Simplify test case, so that it works for both trunk and release-5.0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312038 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[NFC] clang-format llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
Bob Haarman [Tue, 29 Aug 2017 21:01:55 +0000 (21:01 +0000)]
[NFC] clang-format llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312035 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoReland r311957 [codeview] support more DW_OPs for more complete debug info
Bob Haarman [Tue, 29 Aug 2017 20:59:25 +0000 (20:59 +0000)]
Reland r311957 [codeview] support more DW_OPs for more complete debug info

Summary:
Some variables show up in Visual Studio as "optimized out" even in -O0
-Od builds. This change fixes two issues that would cause this to
happen. The first issue is that not all DIExpressions we generate were
recognized by the CodeView writer. This has been addressed by adding
support for DW_OP_constu, DW_OP_minus, and DW_OP_plus. The second
issue is that we had no way to encode DW_OP_deref in CodeView. We get
around that by changinge the type we encode in the debug info to be
a reference to the type in the source code.

This fixes PR34261.

The reland adds two extra checks to the original: It checks if the
DbgVariableLocation is valid before checking any of its fields, and
it only emits ranges with nonzero registers.

Reviewers: aprantl, rnk, zturner

Reviewed By: rnk

Subscribers: mgorny, llvm-commits, aprantl, hiraditya

Differential Revision: https://reviews.llvm.org/D36907

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312034 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[FunctionImport] Avoid unused variable warnings in Release builds
Benjamin Kramer [Tue, 29 Aug 2017 20:24:39 +0000 (20:24 +0000)]
[FunctionImport] Avoid unused variable warnings in Release builds

Just skip the entire block in NDEBUG. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312031 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SimplifyCFG] Fix for PR34219: Preserve alignment after merging conditional stores.
Alexey Bataev [Tue, 29 Aug 2017 20:06:24 +0000 (20:06 +0000)]
[SimplifyCFG] Fix for PR34219: Preserve alignment after merging conditional stores.

Summary:
If SimplifyCFG pass is able to merge conditional stores into single one,
it loses the alignment. This may lead to incorrect codegen. Patch
sets the alignment of the new instruction if it is set in the original
one.

Reviewers: jmolloy

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D36841

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312030 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-rc] Fix DIALOG(EX) parsing ability (parser, pt 5/8).
Marek Sokolowski [Tue, 29 Aug 2017 20:03:18 +0000 (20:03 +0000)]
[llvm-rc] Fix DIALOG(EX) parsing ability (parser, pt 5/8).

This fixes a use-after-free bug that was noticed by a sanitizer buildbot
(http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/7502).

Differential Revision: https://reviews.llvm.org/D37271

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312028 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[docs] Fix Scudo documentation error
Kostya Kortchinsky [Tue, 29 Aug 2017 19:54:19 +0000 (19:54 +0000)]
[docs] Fix Scudo documentation error

Summary: No Pygments lexer found for "none".

Reviewers: flowerhack

Reviewed By: flowerhack

Differential Revision: https://reviews.llvm.org/D37270

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312027 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer
Matt Morehouse [Tue, 29 Aug 2017 19:48:12 +0000 (19:48 +0000)]
[SanitizeCoverage] Enable stack-depth coverage for -fsanitize=fuzzer

Summary:
- Don't sanitize __sancov_lowest_stack.
- Don't instrument leaf functions.
- Add CoverageStackDepth to Fuzzer and FuzzerNoLink.
- Disable stack depth tracking on Mac.

Reviewers: vitalybuka, kcc, george.karpenkov

Reviewed By: kcc

Subscribers: kubamracek, cfe-commits, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D37156

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312026 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoUpdate Scudo allocator documentation.
Kostya Kortchinsky [Tue, 29 Aug 2017 19:42:50 +0000 (19:42 +0000)]
Update Scudo allocator documentation.

Summary:
QuarantineSizeMb is deprecated, and QuarantineChunksUpToSize has been added as a new tunable option.

Reviewers: cryptoad

Reviewed By: cryptoad

Differential Revision: https://reviews.llvm.org/D37238

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312025 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[InstCombine] Support vector splats in transformZExtICmp
Craig Topper [Tue, 29 Aug 2017 18:58:13 +0000 (18:58 +0000)]
[InstCombine] Support vector splats in transformZExtICmp

This patch adds splat support to transformZExtICmp. The test cases are vector versions of tests that failed when commenting out parts of the existing scalar code.

One test didn't vectorize optimize properly due to another bug so a TODO has been added.

Differential Revision: https://reviews.llvm.org/D37253

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312023 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[DAG] Bound loop dependence check in merge optimization.
Hans Wennborg [Tue, 29 Aug 2017 18:41:00 +0000 (18:41 +0000)]
[DAG] Bound loop dependence check in merge optimization.

The loop dependence check looks for dependencies between store merge
candidates not captured by the chain sub-DAG doing a check of
predecessors which may be very large. Conservatively bound number of
nodes checked for compilation time. (Resolves PR34326).

Landing on behalf of Nirav Dave to unblock the 5.0.0 release.

Differential Revision: https://reviews.llvm.org/D37220

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312022 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ThinLTO] Clean up stale alias import handling
Teresa Johnson [Tue, 29 Aug 2017 18:15:34 +0000 (18:15 +0000)]
[ThinLTO] Clean up stale alias import handling

Summary:
Remove some code that was no longer needed. The first FIXME is
stale since we long ago started using the index to drive importing,
rather than doing force importing based on linkage type. And
now with r309278, we no longer import any aliases.

Reviewers: dblaikie

Subscribers: inglorion, llvm-commits

Differential Revision: https://reviews.llvm.org/D37266

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312019 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LoopUnroll] Make the test for PR33437 actually useful.
Davide Italiano [Tue, 29 Aug 2017 17:24:09 +0000 (17:24 +0000)]
[LoopUnroll] Make the test for PR33437 actually useful.

I forgot to specify -unroll-loop-peel, making this test not
really effective. While here, adjust some details (naming and
run line). Thanks to Sanjoy and Michael Z. for pointing out in
their post-commit reviews.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312015 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[PGO] Fixed non-determinism with DenseSet storing function importing info.
Ana Pazos [Tue, 29 Aug 2017 17:13:24 +0000 (17:13 +0000)]
[PGO] Fixed non-determinism with DenseSet storing function importing info.

Summary:
r296498 introduced a DenseSet to store function importing info.

Using this container causes a test failure in
test/Transform/SampleProfile/import.ll when in Reverse Iteration mode.

This patch orders IDs before iterating through this container.

Reviewers: danielcdh, mgrang

Reviewed By: danielcdh

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D37246

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312012 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoFix build of llvm-mc-assemble/disassemble-fuzzer
Justin Bogner [Tue, 29 Aug 2017 17:08:44 +0000 (17:08 +0000)]
Fix build of llvm-mc-assemble/disassemble-fuzzer

Since these aren't built by default unless building with coverage (and
even then they aren't built for the check target) they've managed to
bit rot a little.

This just fixes the build. See llvm.org/pr34314 for the plan on making
sure these don't bit rot again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312011 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[llvm-rc] Add DIALOG(EX) parsing ability (parser, pt 5/8).
Marek Sokolowski [Tue, 29 Aug 2017 16:49:59 +0000 (16:49 +0000)]
[llvm-rc] Add DIALOG(EX) parsing ability (parser, pt 5/8).

This extends the set of resources parsed by llvm-rc by DIALOG and
DIALOGEX.

Additionally, three optional resource statements specific to these two
resources are added: CAPTION, FONT, and STYLE.

Thanks for Nico Weber for his original work in this area.

Differential Revision: https://reviews.llvm.org/D36905

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312009 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Fix copy pasto from r311841. Call getOnesVector instead of getZeroVector.
Craig Topper [Tue, 29 Aug 2017 15:29:36 +0000 (15:29 +0000)]
[X86] Fix copy pasto from r311841. Call getOnesVector instead of getZeroVector.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312006 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoAdd null check for promoted direct call
Dehao Chen [Tue, 29 Aug 2017 15:28:12 +0000 (15:28 +0000)]
Add null check for promoted direct call

Summary: We originally assume that in pgo-icp, the promoted direct call will never be null after strip point casts. However, stripPointerCasts is so smart that it could possibly return the value of the function call if it knows that the return value is always an argument. In this case, the returned value cannot cast to Instruction. In this patch, null check is added to ensure null pointer will not be accessed.

Reviewers: tejohnson, xur, davidxl, djasper

Reviewed By: tejohnson

Subscribers: llvm-commits, sanjoy

Differential Revision: https://reviews.llvm.org/D37252

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312005 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[SimplifyCFG] Update initial test for better testing of the fix for
Alexey Bataev [Tue, 29 Aug 2017 14:37:23 +0000 (14:37 +0000)]
[SimplifyCFG] Update initial test for better testing of the fix for
PR34219, NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312002 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[Instruction] add moveAfter() convenience function; NFCI
Sanjay Patel [Tue, 29 Aug 2017 14:07:48 +0000 (14:07 +0000)]
[Instruction] add moveAfter() convenience function; NFCI

As suggested in D37121, here's a wrapper for removeFromParent() + insertAfter(),
but implemented using moveBefore() for symmetry/efficiency.

Differential Revision: https://reviews.llvm.org/D37239

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@312001 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Add a test cases to demonstrate selecting GPR instructions when
Guy Blank [Tue, 29 Aug 2017 11:58:03 +0000 (11:58 +0000)]
[X86] Add a test cases to demonstrate selecting GPR instructions when
using mask based ones are more appropriate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311996 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[X86] Adding a test to demonstrate aggressive folding for LEA facotrization.
Jatin Bhateja [Tue, 29 Aug 2017 10:49:33 +0000 (10:49 +0000)]
[X86] Adding a test to demonstrate aggressive folding for LEA facotrization.

Differential Revision: https://reviews.llvm.org/D37257

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311994 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] - Tidy-up ARMAsmPrinter.cpp
Javed Absar [Tue, 29 Aug 2017 10:04:18 +0000 (10:04 +0000)]
[ARM] - Tidy-up ARMAsmPrinter.cpp

Change to range-loop where missing.

Reviwewed by: @fhahn, @asb
Differential Revision: https://reviews.llvm.org/D37199

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311993 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] GlobalISel: Select globals in PIC mode
Diana Picus [Tue, 29 Aug 2017 09:47:55 +0000 (09:47 +0000)]
[ARM] GlobalISel: Select globals in PIC mode

Support the selection of G_GLOBAL_VALUE in the PIC relocation model. For
simplicity we use the same pseudoinstructions for both Darwin and ELF:
(MOV|LDRLIT)_ga_pcrel(_ldr).

This is new for ELF, so it requires a small update to the ARM pseudo
expansion pass to make sure it adds the correct constant pool modifier
and add-current-address in the case of ELF.

Differential Revision: https://reviews.llvm.org/D36507

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311992 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[ARM] GlobalISel: Rename tests. NFC.
Diana Picus [Tue, 29 Aug 2017 09:00:58 +0000 (09:00 +0000)]
[ARM] GlobalISel: Rename tests. NFC.

The checks are complicated enough as it is, there's no use cramming PIC
in there as well...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311989 91177308-0d34-0410-b5e6-96231b3b80d8

7 years agoRevert "The current version of LLVM X86 disassembler incorrectly interprets some...
Eric Christopher [Tue, 29 Aug 2017 08:23:46 +0000 (08:23 +0000)]
Revert "The current version of LLVM X86 disassembler incorrectly interprets some possible sets of x86 prefixes. This patch is the first step to close PR7709 and PR17697. There will be next patch(es) to close relative PRs." temporarily while some regressions are addressed.

This reverts commit r311882.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311987 91177308-0d34-0410-b5e6-96231b3b80d8

7 years ago[LSR] Fix Shadow IV in case of integer overflow
Max Kazantsev [Tue, 29 Aug 2017 07:32:20 +0000 (07:32 +0000)]
[LSR] Fix Shadow IV in case of integer overflow

When LSR processes code like

  int accumulator = 0;
  for (int i = 0; i < N; i++) {
    accummulator += i;
    use((double) accummulator);
  }

It may decide to replace integer `accumulator` with a double Shadow IV to get rid
of casts.  The problem with that is that the `accumulator`'s value may overflow.
Starting from this moment, the behavior of integer and double accumulators
will differ.

This patch strenghtens up the conditions of Shadow IV mechanism applicability.
We only allow it for IVs that are proved to be `AddRec`s with `nsw`/`nuw` flag.

Differential Revision: https://reviews.llvm.org/D37209

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@311986 91177308-0d34-0410-b5e6-96231b3b80d8