OSDN Git Service
Matthias Braun [Mon, 1 May 2017 22:32:25 +0000 (22:32 +0000)]
MachineFrameInfo: Track whether MaxCallFrameSize is computed yet; NFC
This tracks whether MaxCallFrameSize is computed yet. Ideally we would
assert and fail when the value is queried before it is computed, however
this fails various targets that need to be fixed first.
Differential Revision: https://reviews.llvm.org/D32570
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301851
91177308-0d34-0410-b5e6-
96231b3b80d8
NAKAMURA Takumi [Mon, 1 May 2017 22:31:43 +0000 (22:31 +0000)]
llvm-link: Add BitReader to deps corresponding to r301832.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301850
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Mon, 1 May 2017 22:26:28 +0000 (22:26 +0000)]
[NewGVN] Don't derive incorrect implications.
In the testcase attached, we believe %tmp1 implies %tmp4.
where:
br i1 %tmp1, label %bb2, label %bb7
br i1 %tmp4, label %bb5, label %bb7
because Wwhile looking at PredicateInfo stuffs we end up calling
isImpliedTrueByMatchingCmp() with the arguments backwards.
Differential Revision: https://reviews.llvm.org/D32718
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301849
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 1 May 2017 22:25:42 +0000 (22:25 +0000)]
[InstCombine] check one-use before applying DeMorgan nor/nand folds
If we have ~(~X & Y), it only makes sense to transform it to (X | ~Y) when we do not need
the intermediate (~X & Y) value. In that case, we would need an extra instruction to
generate ~Y + 'or' (as shown in the test changes).
It's ok if we have multiple uses of ~X or Y, however. In those cases, we may not reduce the
instruction count or critical path, but we might improve throughput because we can generate
~X and ~Y in parallel. Whether that actually makes perf sense or not for a target is something
we can't answer in IR.
Differential Revision: https://reviews.llvm.org/D32703
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301848
91177308-0d34-0410-b5e6-
96231b3b80d8
Greg Clayton [Mon, 1 May 2017 22:07:02 +0000 (22:07 +0000)]
Adds initial llvm-dwarfdump --verify support with unit tests.
lldb-dwarfdump gets a new "--verify" option that will verify a single file's DWARF debug info and will print out any errors that it finds. It will return an non-zero exit status if verification fails, and a zero exit status if verification succeeds. Adding the --quiet option will suppress any output the STDOUT or STDERR.
The first part of the verify does the following:
- verifies that all CU relative references (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata) have valid CU offsets
- verifies that all DW_FORM_ref_addr references have valid .debug_info offsets
- verifies that all DW_AT_ranges attributes have valid .debug_ranges offsets
- verifies that all DW_AT_stmt_list attributes have valid .debug_line offsets
- verifies that all DW_FORM_strp attributes have valid .debug_str offsets
Unit tests were added for each of the above cases.
Differential Revision: https://reviews.llvm.org/D32707
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301844
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 1 May 2017 22:04:36 +0000 (22:04 +0000)]
Bitcode: Make the summary reader responsible for merging. NFCI.
This is to prepare for an upcoming change which uses pointers instead of
GUIDs to represent references.
Differential Revision: https://reviews.llvm.org/D32469
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301843
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 1 May 2017 21:56:05 +0000 (21:56 +0000)]
[APInt] In operator!, handle single word case by comparing VAL to 0 directly and handle multiword case by comparing countLeadingZerosSlowCase() to BitWidth.
We were using operator=(0) which implicitly calls countLeadingZeros but only to compare with 64 to determine if we can compare VAL or pVal[0] to uint64_t. By handling the multiword case with countLeadingZerosSlowCase==BitWidth we can prevent a load of pVal[0] from being inserted inline at each call site. This saves a little bit of code size.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301842
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 1 May 2017 21:53:19 +0000 (21:53 +0000)]
[AArch64] Move GISel accessor initialization from TargetMachine to Subtarget.
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301841
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 1 May 2017 21:16:44 +0000 (21:16 +0000)]
[APInt] Fix copy/paste mistake in comment for isNullValue. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301838
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 1 May 2017 20:57:20 +0000 (20:57 +0000)]
IPO: Add missing build dep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301835
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Mon, 1 May 2017 20:56:35 +0000 (20:56 +0000)]
[X86][AVX] Rename LowerVectorBroadcast to lowerBuildVectorAsBroadcast. NFCI.
Since the shuffle refactor, this is only used during BUILD_VECTOR lowering.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301834
91177308-0d34-0410-b5e6-
96231b3b80d8
Peter Collingbourne [Mon, 1 May 2017 20:42:32 +0000 (20:42 +0000)]
Object: Remove ModuleSummaryIndexObjectFile class.
Differential Revision: https://reviews.llvm.org/D32195
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301832
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 1 May 2017 20:16:35 +0000 (20:16 +0000)]
[Hexagon] Replace CVI_VM_CUR_LD type with CVI_VM_LD
A .cur instruction can be identified by checking isCVINew() && mayLoad().
Patch by Colin LeMahieu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301829
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 1 May 2017 20:10:41 +0000 (20:10 +0000)]
[Hexagon] Improving error reporting for writing to read only registers
Patch by Colin LeMahieu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301828
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 1 May 2017 20:06:01 +0000 (20:06 +0000)]
[Hexagon] Give better error messages for solo instruction errors
Patch by Colin LeMahieu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301827
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Mon, 1 May 2017 19:41:43 +0000 (19:41 +0000)]
[Hexagon] Improve shuffle error reporting
Patch by Colin LeMahieu.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301823
91177308-0d34-0410-b5e6-
96231b3b80d8
Tim Northover [Mon, 1 May 2017 17:50:15 +0000 (17:50 +0000)]
X86: initialize a few subtarget variables.
Otherwise an indeterminate value gets read, causing a bunch of UBSan failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301819
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 1 May 2017 17:36:12 +0000 (17:36 +0000)]
Use a 2 bit pointer in ValueHandleBase::PrevPair; NFC
This was an omission in r301813. I had made the supporting changes to
make this happen, but I forgot to actually update the PrevPair
declaration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301817
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Mon, 1 May 2017 17:15:37 +0000 (17:15 +0000)]
Take indirect branch into account as well when folding.
We may not be able to rewrite indirect branch target, but we also want to take it into
account when folding, i.e. if it and all its successor's predecessors go to the same
destination, we can fold, i.e. no need to thread.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301816
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 1 May 2017 17:07:56 +0000 (17:07 +0000)]
Use WeakVH instead of WeakTrackingVH in AliasSetTracker's UnkownInsts
In cases where an instruction (a call site, say) is RAUW'ed with some
other value (this is possible via the `returned` attribute, for
instance), we want the slot in UnknownInsts to point to the original
Instruction we wanted to track, not the value it got replaced by.
Fixes PR32587.
This relands r301426.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301814
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 1 May 2017 17:07:54 +0000 (17:07 +0000)]
Add a new WeakVH value handle; NFC
This relands r301425.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301813
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 1 May 2017 17:07:49 +0000 (17:07 +0000)]
Rename WeakVH to WeakTrackingVH; NFC
This relands r301424.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301812
91177308-0d34-0410-b5e6-
96231b3b80d8
Derek Schuff [Mon, 1 May 2017 16:49:39 +0000 (16:49 +0000)]
[WebAssembly] Fix use of SDNodeFlags after API change in r301803
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301811
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Mon, 1 May 2017 16:46:39 +0000 (16:46 +0000)]
[PDB/CodeView] Rename some classes.
In preparation for introducing writing capabilities for each of
these classes, I would like to adopt a Foo / FooRef naming
convention, where Foo indicates that the class can manipulate and
serialize Foos, and FooRef indicates that it is an immutable view of
an existing Foo. In other words, Foo is a writer and FooRef is a
reader. This patch names some existing readers to conform to the
FooRef convention, while offering no functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301810
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Mon, 1 May 2017 16:28:58 +0000 (16:28 +0000)]
Emulate TrackingVH using WeakVH
Summary:
This frees up one slot in the HandleBaseKind enum, which I will use
later to add a new kind of value handle. The size of the
HandleBaseKind enum is important because we store a HandleBaseKind in
the low two bits of a (in the worst case) 4 byte aligned pointer.
Reviewers: davide, chandlerc
Subscribers: mcrosier, llvm-commits
Differential Revision: https://reviews.llvm.org/D32634
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301809
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Mon, 1 May 2017 16:19:59 +0000 (16:19 +0000)]
[JumpThread] Add some assertions for expected ConstantInt/BlockAddress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301808
91177308-0d34-0410-b5e6-
96231b3b80d8
Gabor Horvath [Mon, 1 May 2017 16:18:42 +0000 (16:18 +0000)]
Remove unnecessary conditions as suggested by clang-tidy. NFC
Patch by: Gergely Angeli!
Differential Revision: https://reviews.llvm.org/D31936
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301807
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 1 May 2017 16:08:06 +0000 (16:08 +0000)]
[SelectionDAG] Use known ones to provide a better bound for the known zeros for CTTZ/CTLZ operations.
This is the SelectionDAG version of D32521. If know where at least one 1 is located in the input to these intrinsics we can place an upper bound on the number of bits needed to represent the count and thus increase the number of known zeros in the output.
I think we can also refine this further for CTTZ_UNDEF/CTLZ_UNDEF by assuming that the answer will never be BitWidth. I've left this out for now because it caused other test failures across multiple targets. Usually because of turning ADD into OR based on this new information.
I'll fix CTPOP in a future patch.
Differential Revision: https://reviews.llvm.org/D32692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301806
91177308-0d34-0410-b5e6-
96231b3b80d8
Xin Tong [Mon, 1 May 2017 15:34:17 +0000 (15:34 +0000)]
[JumpThread] Do RAUW in case Cond folds to a constant in the CFG
Summary: [JumpThread] Do RAUW in case Cond folds to a constant in the CFG
Reviewers: sanjoy
Reviewed By: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32407
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301804
91177308-0d34-0410-b5e6-
96231b3b80d8
Amara Emerson [Mon, 1 May 2017 15:17:51 +0000 (15:17 +0000)]
Generalize the specialized flag-carrying SDNodes by moving flags into SDNode.
This removes BinaryWithFlagsSDNode, and flags are now all passed by value.
Differential Revision: https://reviews.llvm.org/D32527
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301803
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 1 May 2017 14:52:17 +0000 (14:52 +0000)]
[InstCombine] add multi-use variants for DeMorgan folds; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301802
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 1 May 2017 14:20:30 +0000 (14:20 +0000)]
[InstCombine] use FileCheck and auto-generate checks; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301801
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Mon, 1 May 2017 14:10:59 +0000 (14:10 +0000)]
[InstCombine] consolidate more DeMorgan tests; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301800
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Mon, 1 May 2017 14:00:54 +0000 (14:00 +0000)]
Fix test for altmacro
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301799
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zuckerman [Mon, 1 May 2017 13:20:12 +0000 (13:20 +0000)]
[LLVM][inline-asm] Altmacro absolute expression '%' feature
In this patch, I introduce a new alt macro feature.
This feature adds meaning for the % when using it as a prefix to the calling macro arguments.
In the altmacro mode, the percent sign '%' before an absolute expression convert the expression first to a string.
As described in the https://sourceware.org/binutils/docs-2.27/as/Altmacro.html
"Expression results as strings
You can write `%expr' to evaluate the expression expr and use the result as a string."
expression assumptions:
1. '%' can only evaluate an absolute expression.
2. Altmacro '%' must be the first character of the evaluated expression.
3. If no '%' is located before the expression, a regular module operation is expected.
4. The result of Absolute Expressions can be only integer.
Differential Revision: https://reviews.llvm.org/D32526
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301797
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Mon, 1 May 2017 09:48:55 +0000 (09:48 +0000)]
[AVR] Implement non-constant bit rotations
This lets us do bit rotations of variable amount.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301794
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 1 May 2017 08:11:02 +0000 (08:11 +0000)]
[GlobalISel][X86] rename test file. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301793
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 1 May 2017 07:06:08 +0000 (07:06 +0000)]
[GlobalISel][X86] Prioritize Tablegen-erated instruction selection. NFC
Summary:
Prioritizes Tablegen-erated instruction selection over C++ instruction selection.
Remove G_ADD/G_SUB C++ selection - implemented by Tablegen.
Reviewers: dsanders, zvi, guyblank
Reviewed By: guyblank
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32677
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301792
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Mon, 1 May 2017 06:33:17 +0000 (06:33 +0000)]
[X86] Add tests for opportunities to improve known bits for CTTZ and CTLZ.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301791
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 1 May 2017 06:30:16 +0000 (06:30 +0000)]
[GlobalISel][X86] G_SEXT/G_ZEXT support.
Reviewers: zvi, guyblank
Reviewed By: zvi
Subscribers: rovka, llvm-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D32591
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301790
91177308-0d34-0410-b5e6-
96231b3b80d8
Igor Breger [Mon, 1 May 2017 06:08:32 +0000 (06:08 +0000)]
[GlobalISel][X86] G_LOAD/G_STORE pointer selection support.
Summary: [GlobalISel][X86] G_LOAD/G_STORE pointer selection support.
Reviewers: zvi, guyblank
Reviewed By: zvi, guyblank
Subscribers: dberris, rovka, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D32217
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301788
91177308-0d34-0410-b5e6-
96231b3b80d8
Dylan McKay [Sun, 30 Apr 2017 23:33:52 +0000 (23:33 +0000)]
[AVR] Fix a bug so that we now emit R_AVR_16 fixups with the correct offset
Before this, the LDS/STS instructions would have their opcodes
overwritten while linking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301782
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 30 Apr 2017 22:44:51 +0000 (22:44 +0000)]
[DAGCombiner] shrink/widen a vselect to match its condition operand size (PR14657)
We discussed shrinking/widening of selects in IR in D26556, and I'll try to get back to that
patch eventually. But I'm hoping that this transform is less iffy in the DAG where we can check
legality of the select that we want to produce.
A few things to note:
1. We can't wait until after legalization and do this generically because (at least in the x86
tests from PR14657), we'll have PACKSS and bitcasts in the pattern.
2. This might benefit more of the SSE codegen if we lifted the legal-or-custom requirement, but
that requires a closer look to make sure we don't end up worse.
3. There's a 'vblendv' opportunity that we're missing that results in andn/and/or in some cases.
That should be fixed next.
4. I'm assuming that AVX1 offers the worst of all worlds wrt uneven ISA support with multiple
legal vector sizes, but if there are other targets like that, we should add more tests.
5. There's a codegen miracle in the multi-BB tests from PR14657 (the gcc auto-vectorization tests):
despite IR that is terrible for the target, this patch allows us to generate the optimal loop
code because something post-ISEL is hoisting the splat extends above the vector loops.
Differential Revision: https://reviews.llvm.org/D32620
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301781
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Sun, 30 Apr 2017 19:41:19 +0000 (19:41 +0000)]
Rename isKnownNotFullPoison to programUndefinedIfPoison; NFC
Summary:
programUndefinedIfPoison makes more sense, given what the function
does; and I'm about to add a function with a name similar to
isKnownNotFullPoison (so do the rename to avoid confusion).
Reviewers: broune, majnemer, bjarke.roune
Reviewed By: broune
Subscribers: mcrosier, llvm-commits, mzolotukhin
Differential Revision: https://reviews.llvm.org/D30444
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301776
91177308-0d34-0410-b5e6-
96231b3b80d8
Amaury Sechet [Sun, 30 Apr 2017 19:24:09 +0000 (19:24 +0000)]
Do not legalize large add with addc/adde, introduce addcarry and do it with uaddo/addcarry
Summary: As per discution on how to get better codegen an large int legalization, it became clear that using a glue for the carry was preventing several desirable optimizations. Passing the carry down as a value allow for more flexibility.
Reviewers: jyknight, nemanjai, mkuper, spatel, RKSimon, zvi, bkramer
Subscribers: igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D29872
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301775
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Sun, 30 Apr 2017 18:57:12 +0000 (18:57 +0000)]
[InstCombine] consolidate tests for DeMorgan folds; NFC
I'm proposing to add tests and change behavior in D32665.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301774
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Sun, 30 Apr 2017 17:24:52 +0000 (17:24 +0000)]
[docs] Simplify some language for Error/cantFail in the programmer's manual.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301773
91177308-0d34-0410-b5e6-
96231b3b80d8
Guy Blank [Sun, 30 Apr 2017 12:47:57 +0000 (12:47 +0000)]
[MVT] fix typo in size of v1i8 MVT.
Ths issue was found in the review of another patch https://reviews.llvm.org/D32540
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301770
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 30 Apr 2017 07:45:01 +0000 (07:45 +0000)]
[APInt] Remove support for wrapping from APInt::setBits.
This features isn't used anywhere in tree. It's existence seems to be preventing selfhost builds from inlining any of the setBits methods including setLowBits, setHighBits, and setBitsFrom. This is because the code makes the method recursive.
If anyone needs this feature in the future we could consider adding a setBitsWithWrap method. This way only the calls that need it would pay for it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301769
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 30 Apr 2017 07:44:58 +0000 (07:44 +0000)]
[APInt] Replace calls to setBits with more specific calls to setBitsFrom and setLowBits where possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301768
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 30 Apr 2017 07:44:55 +0000 (07:44 +0000)]
[X86] Clear KnownBits instead of reconstructing it. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301767
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Sun, 30 Apr 2017 06:25:04 +0000 (06:25 +0000)]
InstructionSimplify: Canonicalize shuffle operands. NFC-ish.
Summary:
Apply canonicalization rules:
1. Input vectors with no elements selected from can be replaced with undef.
2. If only one input vector is constant it shall be the second one.
This allows constant-folding to cover more ad-hoc simplifications that
were in place and avoid duplication for RHS and LHS checks.
There are more rules we may want to add in the future when we see a
justification. e.g. mask elements that select undef elements can be
replaced with undef.
Reviewers: spatel, RKSimon, andreadb, davide
Reviewed By: spatel, RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32338
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301766
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Sun, 30 Apr 2017 06:10:54 +0000 (06:10 +0000)]
InstructionSimplify: One getShuffleMask() replacing multiple getMaskValue(). NFC.
Summary: This is a preparatory step for D32338.
Reviewers: RKSimon, spatel
Reviewed By: RKSimon, spatel
Subscribers: spatel, llvm-commits
Differential Revision: https://reviews.llvm.org/D32388
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301765
91177308-0d34-0410-b5e6-
96231b3b80d8
Zvi Rackover [Sun, 30 Apr 2017 06:06:26 +0000 (06:06 +0000)]
InstructionSimplify: Simplify a shuffle with a undef mask to undef
Summary:
Following the discussion in pr32486, adding the simplification:
shuffle %x, %y, undef -> undef
Reviewers: spatel, RKSimon, andreadb, davide
Reviewed By: spatel
Subscribers: jroelofs, davide, llvm-commits
Differential Revision: https://reviews.llvm.org/D32293
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301764
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Atanasyan [Sun, 30 Apr 2017 04:27:23 +0000 (04:27 +0000)]
[mips] Emit R_MICROMIPS_TLS_GOTTPREL relocation for %gottprel in case of microMIPS
In case of microMIPS mode %gottprel operator should emit microMIPS
relocation R_MICROMIPS_TLS_GOTTPREL, not R_MIPS_TLS_GOTTPREL.
Differential Revision: http://reviews.llvm.org/D32617
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301763
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sun, 30 Apr 2017 00:44:05 +0000 (00:44 +0000)]
[ConstantRange] Fix a couple cases where we were possibly throwing away an APInt allocation we could reuse. NFC
This uses setAllBits to replace getMaxValue and operator=(uint64_t) instead of constructing an APInt from uint64_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301761
91177308-0d34-0410-b5e6-
96231b3b80d8
Dimitry Andric [Sat, 29 Apr 2017 23:45:30 +0000 (23:45 +0000)]
Include <cstdio> in PrettyStackTrace.cpp, since it uses vsnprintf(3).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301760
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Sat, 29 Apr 2017 19:46:27 +0000 (19:46 +0000)]
[globalisel][tablegen] Fix the test after silencing the unused variable warning in r301755.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301756
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Sat, 29 Apr 2017 19:10:19 +0000 (19:10 +0000)]
[globalisel][tablegen] Silence unused variable warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301755
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 17:59:41 +0000 (17:59 +0000)]
[ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301753
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 17:46:13 +0000 (17:46 +0000)]
[ConstantRange] Replace getMaxValue+zext with getLowBitsSet. Replace zero-init+setBit with getOneBitSet. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301752
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 17:46:11 +0000 (17:46 +0000)]
[ConstantRange] Use APInt::operator-= to remove temporary APInts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301751
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Sanders [Sat, 29 Apr 2017 17:30:09 +0000 (17:30 +0000)]
[globalisel][tablegen] Compute available feature bits correctly.
Summary:
Predicate<> now has a field to indicate how often it must be recomputed.
Currently, there are two frequencies, per-module (RecomputePerFunction==0)
and per-function (RecomputePerFunction==1). Per-function predicates are
currently recomputed more frequently than necessary since the only predicate
in this category is cheap to test. Per-module predicates are now computed in
getSubtargetImpl() while per-function predicates are computed in selectImpl().
Tablegen now manages the PredicateBitset internally. It should only be
necessary to add the required includes.
Also fixed a problem revealed by the test case where
constrainSelectedInstRegOperands() would attempt to tie operands that
BuildMI had already tied.
Reviewers: ab, qcolombet, t.p.northover, rovka, aditya_nandakumar
Reviewed By: rovka
Subscribers: kristof.beyls, igorb, llvm-commits
Differential Revision: https://reviews.llvm.org/D32491
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301750
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 29 Apr 2017 17:15:12 +0000 (17:15 +0000)]
[X86][AVX] Added codegen tests for _mm256_zext* helper intrinsics (PR32839)
Not great codegen, especially as VEX moves support implicit zeroing of upper bits....
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301748
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 16:43:11 +0000 (16:43 +0000)]
[KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state
Summary: This patch adds isNegative, isNonNegative for querying whether the sign bit is known. It also adds makeNegative and makeNonNegative for controlling the sign bit.
Reviewers: RKSimon, spatel, davide
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D32651
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301747
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Dardis [Sat, 29 Apr 2017 16:31:40 +0000 (16:31 +0000)]
[mips][FastISel] Fix a nullptr deference.
r301392 introduced a potential nullptr deference causing compilation
failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301746
91177308-0d34-0410-b5e6-
96231b3b80d8
Simon Pilgrim [Sat, 29 Apr 2017 14:29:06 +0000 (14:29 +0000)]
[X86][SSE] Add initial <2 x half> tests for PR31088
As discussed on D32391, test X86/X64 SSE2 and X64 F16C.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301744
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 07:24:13 +0000 (07:24 +0000)]
[ConstantRange] Use ternary operator instead of 'if' to avoid copying an APInt and then possibly copying over it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301741
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 06:40:47 +0000 (06:40 +0000)]
[ConstantRange] Add std::move to a bunch of places that pass local APInts to ConstantRange constructor.
The ConstantRange constructor takes APInt by value so without these moves we are making copies.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301740
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 29 Apr 2017 05:30:19 +0000 (05:30 +0000)]
Remove unused private field.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301738
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 05:24:34 +0000 (05:24 +0000)]
[ConstantRange] Remove a temporary APInt I meant to delete in r300621. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301737
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Sat, 29 Apr 2017 05:08:52 +0000 (05:08 +0000)]
[ConstantRange] Improve the efficiency of one of the ConstantRange constructors.
We were default constructing the Lower/Upper APInts. Then creating min or max value, then doing a move assignment to Lower and copy assignment to upper. The copy assignment operator in particular has an out of line function call that has to examine whether or not a previous allocation exists that can be reused which of course it can't in this case.
The new code creates the min/max value first, move constructs Lower from it then copy constructs Upper from Lower.
This also seems to have convinced a self host build that this constructor can be inlined more readily into other methods in ConstantRange.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301736
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Sat, 29 Apr 2017 01:26:34 +0000 (01:26 +0000)]
AMDGPU: Fix copies from physical registers in SIFixSGPRCopies
This would assert when there were multiple defs of
a physical register.
We just need to move all of the users of it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301730
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 29 Apr 2017 01:13:21 +0000 (01:13 +0000)]
[llvm-pdbdump] Abstract some of the YAML/Raw printing code.
There is a lot of duplicate code for printing line info between
YAML and the raw output printer. This introduces a base class
that can be shared between the two, and makes some minor
cleanups in the process.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301728
91177308-0d34-0410-b5e6-
96231b3b80d8
Akira Hatanaka [Sat, 29 Apr 2017 00:23:11 +0000 (00:23 +0000)]
[ObjCARC] Do not move a release between a call and a
retainAutoreleasedReturnValue that retains the returned value.
This commit fixes a bug in ARC optimizer where it moves a release
between a call and a retainAutoreleasedReturnValue, causing the returned
object to be released before the retainAutoreleasedReturnValue can
retain it.
This commit accomplishes that by doing a lookahead and checking whether
the call prevents the release from moving upwards. In the long term, we
should treat the region between the retainAutoreleasedReturnValue and
the call as a critical section and disallow moving anything there
(possibly using operand bundles).
rdar://problem/
20449878
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301724
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 29 Apr 2017 00:18:26 +0000 (00:18 +0000)]
[LoopUnswitch] Make DEBUG output more readable (part 2).
I fixed my miscompile in r301722 and I hope I don't have to take
a look at this code again now that Chandler has a new LoopUnswitch
pass, but maybe this could be of use for somebody else in the
meanwhile.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301723
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Sat, 29 Apr 2017 00:12:18 +0000 (00:12 +0000)]
[LoopUnswitch] Don't remove instructions with side effects.
This fixes PR32818.
Differential Revision: https://reviews.llvm.org/D32664
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301722
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Sat, 29 Apr 2017 00:03:32 +0000 (00:03 +0000)]
[llvm-readobj] Fix incorrect printing of CV column info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301720
91177308-0d34-0410-b5e6-
96231b3b80d8
Duncan P. N. Exon Smith [Fri, 28 Apr 2017 23:59:53 +0000 (23:59 +0000)]
Fuzzer: Mark test/cxxstring.test UNSUPPORTED: windows
This has been mysteriously failing since r301593, which cleaned up the
types of things like size_t and SIZE_MAX for freestanding targets. Reid
and Kostya suggested marking it as UNSUPPORTED on windows, given that no
one has been able to reproduce locally.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301719
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 28 Apr 2017 23:41:36 +0000 (23:41 +0000)]
[llvm-readobj] Use LLVMDebugInfoCodeView to parse line tables.
The llvm-readobj parsing code currently exists in our CodeView
library, so we use that to parse instead of re-writing the logic
in the tool.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301718
91177308-0d34-0410-b5e6-
96231b3b80d8
Zachary Turner [Fri, 28 Apr 2017 23:29:33 +0000 (23:29 +0000)]
[Support] Provide unsafe random access for VarStreamArray.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301716
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 28 Apr 2017 23:14:33 +0000 (23:14 +0000)]
[InstCombine] add tests to show potentially bogus application of DeMorgan (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301714
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 28 Apr 2017 23:11:16 +0000 (23:11 +0000)]
Remove set but unused variable in BitcodeReader.cpp. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301713
91177308-0d34-0410-b5e6-
96231b3b80d8
Hans Wennborg [Fri, 28 Apr 2017 23:01:32 +0000 (23:01 +0000)]
Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This broke the Clang build. (Clang-side patch missing?)
Original commit message:
> [IR] Make add/remove Attributes use AttrBuilder instead of
> AttributeList
>
> This change cleans up call sites and avoids creating temporary
> AttributeList objects.
>
> NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301712
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 28 Apr 2017 22:52:41 +0000 (22:52 +0000)]
InferAddressSpaces: Search constant expressions for addrspacecasts
These are pretty common when using local memory, and the 64-bit generic
addressing is much more expensive to compute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301711
91177308-0d34-0410-b5e6-
96231b3b80d8
Adrian Prantl [Fri, 28 Apr 2017 22:25:46 +0000 (22:25 +0000)]
Remove line and file from DINamespace.
Fixes the issue highlighted in
http://lists.llvm.org/pipermail/cfe-dev/2014-June/037500.html.
The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
prevent LLVM from uniquing types that are in the same namespace. They
also don't carry any meaningful information.
rdar://problem/
17484998
Differential Revision: https://reviews.llvm.org/D32648
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301706
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 28 Apr 2017 22:18:19 +0000 (22:18 +0000)]
InferAddressSpaces: Avoid looking up deleted values
While looking at pure addressing expressions, it's possible
for the value to appear later in Postorder.
I haven't been able to come up with a testcase where this
exhibits an actual issue, but if you insert a dump before
the value map lookup, a few testcases crash.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301705
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 28 Apr 2017 22:18:08 +0000 (22:18 +0000)]
InferAddressSpaces: Infer from just addrspacecasts
Eliminates some more cases where some subset of the addressing
computation remains flat. Some cases with addrspacecasts
in nested constant expressions are still left behind however.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301704
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael Zolotukhin [Fri, 28 Apr 2017 22:14:27 +0000 (22:14 +0000)]
[SCEV] Use early exit in createAddRecFromPHI. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301703
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Berlin [Fri, 28 Apr 2017 22:05:55 +0000 (22:05 +0000)]
LoopRotate: Fix use after scope bug
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301702
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 28 Apr 2017 21:57:53 +0000 (21:57 +0000)]
[RDF] Correctly calculate lane masks for defs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301700
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 28 Apr 2017 21:56:33 +0000 (21:56 +0000)]
Properly handle PHIs with subregisters in UnreachableBlockElim
When a PHI operand has a subregister, create a COPY instead of simply
replacing the PHI output with the input it.
Differential Revision: https://reviews.llvm.org/D32650
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301699
91177308-0d34-0410-b5e6-
96231b3b80d8
Krzysztof Parzyszek [Fri, 28 Apr 2017 21:54:11 +0000 (21:54 +0000)]
[Hexagon] Do not move a block if it is on a fall-through path
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301698
91177308-0d34-0410-b5e6-
96231b3b80d8
Reid Kleckner [Fri, 28 Apr 2017 21:48:28 +0000 (21:48 +0000)]
[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList
This change cleans up call sites and avoids creating temporary
AttributeList objects.
NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301697
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 28 Apr 2017 21:48:09 +0000 (21:48 +0000)]
[ConstantRange] Use APInt::isNullValue rather than APInt::isMinValue where it would make more sense to thing of 0 as 0 rather than the minimum unsigned value. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301696
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 28 Apr 2017 21:48:06 +0000 (21:48 +0000)]
[APInt] Add an isNullValue method to check for all bits being zero. Use it in a couple internal methods where it makes more sense than isMinValue or !getBoolValue. NFC
I used Null rather than Zero to match the getNullValue method name.
There are some other places outside APInt where isNullValue would be more readable than isMinValue even though they do the same thing. I'll update those in future patches.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301695
91177308-0d34-0410-b5e6-
96231b3b80d8
Craig Topper [Fri, 28 Apr 2017 21:48:03 +0000 (21:48 +0000)]
[ConstantRange] Use const references to prevent a couple APInt copies. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301694
91177308-0d34-0410-b5e6-
96231b3b80d8
Davide Italiano [Fri, 28 Apr 2017 21:30:50 +0000 (21:30 +0000)]
[LoopUnswitch] Make DEBUG output more readable.
While debugging a miscompile I realized loopunswitch doesn't
put newlines when printing the instruction being replacement.
Ending up with a single line with many instruction replaced isn't
the best for readability and/or mental sanity.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301692
91177308-0d34-0410-b5e6-
96231b3b80d8
Sam Clegg [Fri, 28 Apr 2017 21:22:38 +0000 (21:22 +0000)]
[WebAssembly] Add size of section header to data relocation offsets.
Also, add test for data relocations and fix addend to
be signed.
Subscribers: jfb, dschuff
Differential Revision: https://reviews.llvm.org/D32513
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301690
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 28 Apr 2017 21:13:09 +0000 (21:13 +0000)]
[ValueTracking] Teach isSafeToSpeculativelyExecute() about the speculatable attribute
Patch by Tom Stellard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301688
91177308-0d34-0410-b5e6-
96231b3b80d8