platform/upstream/llvm.git
6 years ago[OpenCL] Check for invalid kernel arguments in array types
Alexey Sotkin [Tue, 31 Jul 2018 19:47:19 +0000 (19:47 +0000)]
[OpenCL] Check for invalid kernel arguments in array types

Summary:
OpenCL specification forbids use of several types as kernel arguments.
This patch improves existing diagnostic to look through arrays.

Patch by: Andrew Savonichev

Reviewers: Anastasia, yaxunl

Subscribers: yaxunl, Anastasia, cfe-commits

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

llvm-svn: 338427

6 years ago[CFG] [analyzer] Add construction contexts for returning C++ objects in ObjC++.
Artem Dergachev [Tue, 31 Jul 2018 19:46:14 +0000 (19:46 +0000)]
[CFG] [analyzer] Add construction contexts for returning C++ objects in ObjC++.

Like any normal funciton, Objective-C message can return a C++ object
in Objective-C++. Such object would require a construction context.

This patch, therefore, is an extension of r327343 onto Objective-C++.

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

llvm-svn: 338426

6 years ago[CFG] [analyzer] Add stubs for constructor and message argument constructors.
Artem Dergachev [Tue, 31 Jul 2018 19:39:37 +0000 (19:39 +0000)]
[CFG] [analyzer] Add stubs for constructor and message argument constructors.

CFG now correctly identifies construction context for temporaries constructed
for the purpose of passing into a function as an argument.

Such context is still not fully implemented because the information it provides
is not rich enough: it doens't contain information about argument index.
It will be addresssed later.

This patch is an extension of r330377 to C++ construct-expressions and
Objective-C message expressions which aren't call-expressions but require
similar handling. C++ new-expressions with placement arguments still remain to
be handled.

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

llvm-svn: 338425

6 years ago[DWARF] Change a test to ensure the creation of a __debug_ranges section.
Wolfgang Pieb [Tue, 31 Jul 2018 19:37:29 +0000 (19:37 +0000)]
[DWARF] Change a test to ensure the creation of a __debug_ranges section.

Reviewer: aprantl
llvm-svn: 338424

6 years ago[CodeView] Add coverage test for r338308 (Fixed crash in type merging)
Alexandre Ganea [Tue, 31 Jul 2018 19:30:03 +0000 (19:30 +0000)]
[CodeView] Add coverage test for r338308 (Fixed crash in type merging)

llvm-svn: 338423

6 years ago[analyzer] Reuse some code in simplifySVal().
Artem Dergachev [Tue, 31 Jul 2018 19:29:25 +0000 (19:29 +0000)]
[analyzer] Reuse some code in simplifySVal().

No functional change intended.

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

llvm-svn: 338422

6 years agoAMDGPU: Break 64-bit arguments into 32-bit pieces
Matt Arsenault [Tue, 31 Jul 2018 19:29:04 +0000 (19:29 +0000)]
AMDGPU: Break 64-bit arguments into 32-bit pieces

llvm-svn: 338421

6 years ago[analyzer] Don't try to simplify mixed Loc/NonLoc expressions.
Artem Dergachev [Tue, 31 Jul 2018 19:26:34 +0000 (19:26 +0000)]
[analyzer] Don't try to simplify mixed Loc/NonLoc expressions.

This fix is similar to r337769 and addresses a regression caused by r337167.

When an operation between a nonloc::LocAsInteger and a non-pointer symbol
is performed, the LocAsInteger-specific part of information is lost.
When the non-pointer symbol is collapsing into a constant, we cannot easily
re-evaluate the result, because we need to recover the missing
LocAsInteger-specific information (eg., integer type, or the very fact that
this pointer was at some point converted to an integer).

Add one more defensive check to prevent crashes on trying to simplify a
SymSymExpr with different Loc-ness of operands.

Differential Revision:

llvm-svn: 338420

6 years agoimport timespec and timespec_get into namespace std if we're under c++17 or later...
Marshall Clow [Tue, 31 Jul 2018 19:25:00 +0000 (19:25 +0000)]
import timespec and timespec_get into namespace std if we're under c++17 or later AND the underlying C library has them. Fixes PR#38220, but doesn't implement all of P0063 yet.

llvm-svn: 338419

6 years agoAMDGPU: Split wide vectors of i16/f16 into 32-bit regs on calls
Matt Arsenault [Tue, 31 Jul 2018 19:17:47 +0000 (19:17 +0000)]
AMDGPU: Split wide vectors of i16/f16 into 32-bit regs on calls

This improves code for the same reasons as scalarizing 32-bit
element vectors.

llvm-svn: 338418

6 years ago[CodeView] Minimal support for S_UNAMESPACE records
Alexandre Ganea [Tue, 31 Jul 2018 19:15:50 +0000 (19:15 +0000)]
[CodeView] Minimal support for S_UNAMESPACE records

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

llvm-svn: 338417

6 years agoAMDGPU: Scalarize vector argument types to calls
Matt Arsenault [Tue, 31 Jul 2018 19:05:14 +0000 (19:05 +0000)]
AMDGPU: Scalarize vector argument types to calls

When lowering calling conventions, prefer to decompose vectors
into the constitute register types. This avoids artifical constraints
to satisfy a wide super-register.

This improves code quality because now optimizations don't need to
deal with the super-register constraint. For example the immediate
folding code doesn't deal with 4 component reg_sequences, so by
breaking the register down earlier the existing immediate folding
code is able to work.

This also avoids the need for the shader input processing code
to manually split vector types.

llvm-svn: 338416

6 years ago[llvm-mca][docs] Replace "temporary" with "physical registers". NFC.
Matt Davis [Tue, 31 Jul 2018 18:59:46 +0000 (18:59 +0000)]
[llvm-mca][docs] Replace "temporary" with "physical registers". NFC.

llvm-svn: 338415

6 years agoFix riscv32-toolchain.c with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Tue, 31 Jul 2018 18:47:48 +0000 (18:47 +0000)]
Fix riscv32-toolchain.c with CLANG_DEFAULT_CXX_STDLIB

This configuration was (again) broken after r338385 because Clang
might be configured to always use libc++.

llvm-svn: 338414

6 years ago[OPENMP] Change linkage of offloading symbols to support dropping
Alexey Bataev [Tue, 31 Jul 2018 18:27:42 +0000 (18:27 +0000)]
[OPENMP] Change linkage of offloading symbols to support dropping
offload targets.

Changed the linkage of omp_offloading.img_start.<triple> and omp_offloading.img_end.<triple> symbols from external to external weak to allow dropping of some targets during linking.

llvm-svn: 338413

6 years ago[X86] WriteBSWAP sched classes are reg-reg only.
Simon Pilgrim [Tue, 31 Jul 2018 18:24:24 +0000 (18:24 +0000)]
[X86] WriteBSWAP sched classes are reg-reg only.

Don't declare them as X86SchedWritePair when the folded class will never be used.

Note: MOVBE (load/store endian conversion) instructions tend to have a very different behaviour to BSWAP.
llvm-svn: 338412

6 years agoIntroduce a new test macro TEST_HAS_C11_FEATURES which is set when the underlying...
Marshall Clow [Tue, 31 Jul 2018 18:23:57 +0000 (18:23 +0000)]
Introduce a new test macro TEST_HAS_C11_FEATURES which is set when the underlying C library has C11 features. In C++17, we use those features. <__config> defines a similar macro, _LIBCPP_HAS_C11_FEATURES, but we don't want to use that in the library-independent parts of the tests, so define the new one. Also add a libc++-specific test to make sure the two stay in sync.

llvm-svn: 338411

6 years ago[llvm-mca][docs] Improve the "How LLVM-MCA works" section.
Andrea Di Biagio [Tue, 31 Jul 2018 18:19:15 +0000 (18:19 +0000)]
[llvm-mca][docs] Improve the "How LLVM-MCA works" section.

llvm-svn: 338410

6 years agoSimplify. NFC.
Rui Ueyama [Tue, 31 Jul 2018 18:13:36 +0000 (18:13 +0000)]
Simplify. NFC.

llvm-svn: 338409

6 years agoRevert "[DebugInfo] Generate DWARF debug information for labels."
Vlad Tsyrklevich [Tue, 31 Jul 2018 18:10:37 +0000 (18:10 +0000)]
Revert "[DebugInfo] Generate DWARF debug information for labels."

This reverts commits r338390 and r338398, they were causing LSan
failures on the ASan bot.

llvm-svn: 338408

6 years ago[X86][SSE] Use ISD::MULHU for constant/non-zero ISD::SRL lowering (PR38151)
Simon Pilgrim [Tue, 31 Jul 2018 18:05:56 +0000 (18:05 +0000)]
[X86][SSE] Use ISD::MULHU for constant/non-zero ISD::SRL lowering (PR38151)

As was done for vector rotations, we can efficiently use ISD::MULHU for vXi8/vXi16 ISD::SRL lowering.

Shift-by-zero cases are still problematic (mainly on v32i8 due to extra AND/ANDN/OR or VPBLENDVB blend masks but v8i16/v16i16 aren't great either if PBLENDW fails) so I've limited this first patch to known non-zero cases if we can't easily use PBLENDW.

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

llvm-svn: 338407

6 years agoMake ICF log output order deterministic.
Rui Ueyama [Tue, 31 Jul 2018 18:04:58 +0000 (18:04 +0000)]
Make ICF log output order deterministic.

This patch does the same thing as r338153 for COFF.
Note that this patch affects only the order of log messages.
The output file is already deterministic.

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

llvm-svn: 338406

6 years ago[COFF, ARM64] Enable SEH for ARM64 Windows
Mandeep Singh Grang [Tue, 31 Jul 2018 17:42:05 +0000 (17:42 +0000)]
[COFF, ARM64] Enable SEH for ARM64 Windows

Reviewers: rnk, mstorsjo, ssijaric, haripul, TomTan

Reviewed By: rnk

Subscribers: kristof.beyls, chrib, cfe-commits

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

llvm-svn: 338405

6 years ago[llvm-mca][x86] Add 32-bit instruction resource tests
Simon Pilgrim [Tue, 31 Jul 2018 17:33:08 +0000 (17:33 +0000)]
[llvm-mca][x86] Add 32-bit instruction resource tests

These aren't exhaustive, but cover some instructions that are only available in 32-bit mode (where would we be without good BCD math performance?).

llvm-svn: 338404

6 years agoResubmit r338340 "[MS Demangler] Better demangling of template arguments."
Zachary Turner [Tue, 31 Jul 2018 17:16:44 +0000 (17:16 +0000)]
Resubmit r338340 "[MS Demangler] Better demangling of template arguments."

This broke the build with GCC, but has since been fixed.

llvm-svn: 338403

6 years ago[X86] Add pattern matching for PMADDUBSW
Craig Topper [Tue, 31 Jul 2018 17:12:08 +0000 (17:12 +0000)]
[X86] Add pattern matching for PMADDUBSW

Summary:
Similar to D49636, but for PMADDUBSW. This instruction has the additional complexity that the addition of the two products saturates to 16-bits rather than wrapping around. And one operand is treated as signed and the other as unsigned.

A C example that triggers this pattern

```
static const int N = 128;

int8_t A[2*N];
uint8_t B[2*N];
int16_t C[N];

void foo() {
  for (int i = 0; i != N; ++i)
    C[i] = MIN(MAX((int16_t)A[2*i]*(int16_t)B[2*i] + (int16_t)A[2*i+1]*(int16_t)B[2*i+1], -32768), 32767);
}
```

Reviewers: RKSimon, spatel, zvi

Reviewed By: RKSimon, zvi

Subscribers: llvm-commits

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

llvm-svn: 338402

6 years ago[X86] Add test cases that could use PMADDUBSW.
Craig Topper [Tue, 31 Jul 2018 17:12:06 +0000 (17:12 +0000)]
[X86] Add test cases that could use PMADDUBSW.

llvm-svn: 338401

6 years ago[X86] Preserve more liveness information in emitStackProbeInline
Francis Visoiu Mistrih [Tue, 31 Jul 2018 16:41:12 +0000 (16:41 +0000)]
[X86] Preserve more liveness information in emitStackProbeInline

This commit fixes two issues with the liveness information after the
call:

1) The code always spills RCX and RDX if InProlog == true, which results
in an use of undefined phys reg.
2) FinalReg, JoinReg, RoundedReg, SizeReg are not added as live-ins to
the basic blocks that use them, therefore they are seen undefined.

https://llvm.org/PR38376

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

llvm-svn: 338400

6 years ago[OPENMP] Prevent problems with linking of the static variables.
Alexey Bataev [Tue, 31 Jul 2018 16:40:15 +0000 (16:40 +0000)]
[OPENMP] Prevent problems with linking of the static variables.

No need to change the linkage, we can avoid the problem using special variable. That points to the original variable and, thus, prevent some of the optimizations that might break the compilation.

llvm-svn: 338399

6 years ago[DebugInfo] Fix build failed in 'clang-cmake-armv8-full'.
Hsiangkai Wang [Tue, 31 Jul 2018 16:22:09 +0000 (16:22 +0000)]
[DebugInfo] Fix build failed in 'clang-cmake-armv8-full'.

Builder clang-cmake-armv8-full failed due to the assembly 'comment'
notation is not '#' in the target. So, I use CHECK-SAME to avoid to
check the comment notation in the same line in the test case.

llvm-svn: 338398

6 years ago[Dominators] Make slow walks shorter
Jakub Kuderski [Tue, 31 Jul 2018 15:53:10 +0000 (15:53 +0000)]
[Dominators] Make slow walks shorter

Summary:
When DFS numbers are not yet calculated for a dominator tree, we have to walk it up to say whether one node dominates some other.

This patch makes the slow walks shorter by only walking until the level of the node we check against is reached. This is because a node cannot possibly dominate something higher in its tree.

When running opt with -O3, the patch results in:
* 25% fewer loop iterations for `opt` (fullLTO)
* 30% fewer loop iterations for sqlite

Reviewers: brzycki, asbirlea, chandlerc, NutshellySima, grosser

Reviewed By: NutshellySima

Subscribers: mehdi_amini, dexonsmith, llvm-commits

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

llvm-svn: 338396

6 years agoFix InstCombine address space assert
Ewan Crawford [Tue, 31 Jul 2018 15:53:03 +0000 (15:53 +0000)]
Fix InstCombine address space assert

Workaround bug where the InstCombine pass was asserting on the IR added in lit
test, where we have a bitcast instruction after a GEP from an addrspace cast.

The second bitcast in the test was getting combined into
`bitcast <16 x i32>* %0 to <16 x i32> addrspace(3)*`, which looks like it should
be an addrspace cast instruction instead. Otherwise if control flow is allowed
to continue as it is now we create a GEP instruction
`<badref> = getelementptr inbounds <16 x i32>, <16 x i32>* %0, i32 0`. However
because the type of this instruction doesn't match the address space we hit an
assert when replacing the bitcast with that GEP.

```
void llvm::Value::doRAUW(llvm::Value*, bool): Assertion `New->getType() == getType() && "replaceAllUses of value with new value of different type!"' failed.
```

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

llvm-svn: 338395

6 years ago[llvm-mca][docs] Always use `llvm-mca` in place of `MCA`.
Andrea Di Biagio [Tue, 31 Jul 2018 15:29:10 +0000 (15:29 +0000)]
[llvm-mca][docs] Always use `llvm-mca` in place of `MCA`.

llvm-svn: 338394

6 years ago[clang-tidy] add all clang-tidy modules to plugin
Jonas Toth [Tue, 31 Jul 2018 15:23:49 +0000 (15:23 +0000)]
[clang-tidy] add all clang-tidy modules to plugin

Summary:
This patch addresses PR38359 and adds all existing clang-tidy
modules to the plugin that can be used together with libclang.

Reviewers: alexfh, aaron.ballman, hokein, ilya-biryukov

Reviewed By: alexfh

Subscribers: srhines, mgorny, xazax.hun, cfe-commits

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

llvm-svn: 338393

6 years ago[InstCombine] regenerate checks and add tests for D50035; NFC
Sanjay Patel [Tue, 31 Jul 2018 15:07:32 +0000 (15:07 +0000)]
[InstCombine] regenerate checks and add tests for D50035; NFC

llvm-svn: 338392

6 years ago[DebugInfo][LCSSA] Preserve debug location in lcssa phis
Anastasis Grammenos [Tue, 31 Jul 2018 14:54:52 +0000 (14:54 +0000)]
[DebugInfo][LCSSA] Preserve debug location in lcssa phis

Summary:
When inserting lcssa Phi Nodes in the exit block
mak sure to preserve the original instructions DL.

Reviewers: vsk

Subscribers: JDevlieghere, llvm-commits

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

llvm-svn: 338391

6 years ago[DebugInfo] Generate DWARF debug information for labels.
Hsiangkai Wang [Tue, 31 Jul 2018 14:48:32 +0000 (14:48 +0000)]
[DebugInfo] Generate DWARF debug information for labels.

There are two forms for label debug information in DWARF format.

1. Labels in a non-inlined function:

DW_TAG_label
  DW_AT_name
  DW_AT_decl_file
  DW_AT_decl_line
  DW_AT_low_pc

2. Labels in an inlined function:

DW_TAG_label
  DW_AT_abstract_origin
  DW_AT_low_pc

We will collect label information from DBG_LABEL. Before every DBG_LABEL,
we will generate a temporary symbol to denote the location of the label.
The symbol could be used to get DW_AT_low_pc afterwards. So, we create a
mapping between 'inlined label' and DBG_LABEL MachineInstr in DebugHandlerBase.
The DBG_LABEL in the mapping is used to query the symbol before it.

The AbstractLabels in DwarfCompileUnit is used to process labels in inlined
functions.

We also keep a mapping between scope and labels in DwarfFile to help to
generate correct tree structure of DIEs.

It also generates label debug information under global isel.

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

llvm-svn: 338390

6 years agoRevert Enrich inline messages
David Bolvansky [Tue, 31 Jul 2018 14:47:22 +0000 (14:47 +0000)]
Revert Enrich inline messages

llvm-svn: 338389

6 years ago[InstCombine] auto-generate checks; NFC
Sanjay Patel [Tue, 31 Jul 2018 14:27:30 +0000 (14:27 +0000)]
[InstCombine] auto-generate checks; NFC

llvm-svn: 338388

6 years agoEnrich inline messages
David Bolvansky [Tue, 31 Jul 2018 14:25:24 +0000 (14:25 +0000)]
Enrich inline messages

Summary:
This patch improves Inliner to provide causes/reasons for negative inline decisions.
1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
4. Adjusted tests for changed printing.

Patch by: yrouban (Yevgeny Rouban)

Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00

Reviewed By: tejohnson, xbolva00

Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith

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

llvm-svn: 338387

6 years ago[llvm-mca] Remove README.txt
Andrea Di Biagio [Tue, 31 Jul 2018 14:23:49 +0000 (14:23 +0000)]
[llvm-mca] Remove README.txt

A detailed description of the tool has been recently added by Matt to
CommandGuide/llvm-mca.rst. File README.txt is now redundant and can be removed;
all the relevant user-guide information has been improved and then moved to
llvm-mca.rst.

In future, we should add another .rst for the "llvm-mca developer manual" to
provide infromation about:
 - llvm-mca internals.
 - How to add custom stages to the simulated pipeline.
 - How to provide extra processor info in the scheduling model to improve the
   analysis performed by llvm-mca.

llvm-svn: 338386

6 years ago[RISCV] Add driver for riscv32-unknown-elf baremetal target
David Bolvansky [Tue, 31 Jul 2018 14:21:46 +0000 (14:21 +0000)]
[RISCV] Add driver for riscv32-unknown-elf baremetal target

Summary:
This patch adds a driver for the baremetal RISC-V target (i.e. riscv32-unknown-elf). For reference, D39963 added basic target info and added support for riscv32-linux-unknown-elf.

Patch by: asb (Alex Bradbury)

Reviewers: efriedma, phosek, apazos, espindola, mgrang

Reviewed By: mgrang

Subscribers: jrtc27, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, emaste, mgorny, arichardson, rbar, johnrusso, simoncook, jordy.potman.lists, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, mgrang, cfe-commits

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

llvm-svn: 338385

6 years ago[MemDep] Use PhiValuesAnalysis to improve alias analysis results
John Brawn [Tue, 31 Jul 2018 14:19:29 +0000 (14:19 +0000)]
[MemDep] Use PhiValuesAnalysis to improve alias analysis results

This is being done in order to make GVN able to better optimize certain inputs.
MemDep doesn't use PhiValues directly, but does need to notifiy it when things
get invalidated.

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

llvm-svn: 338384

6 years ago[InstSimplify] Fold another Select with And/Or pattern
David Bolvansky [Tue, 31 Jul 2018 14:17:15 +0000 (14:17 +0000)]
[InstSimplify] Fold another Select with And/Or pattern

Summary: Proof: https://rise4fun.com/Alive/L5J

Reviewers: lebedev.ri, spatel

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 338383

6 years agoDAG: Fix PromoteFloatResult for fcanonicalize
Matt Arsenault [Tue, 31 Jul 2018 14:15:22 +0000 (14:15 +0000)]
DAG: Fix PromoteFloatResult for fcanonicalize

llvm-svn: 338382

6 years agoAMDGPU: Don't handle FP16_TO_FP in isCanonicalized
Matt Arsenault [Tue, 31 Jul 2018 14:15:16 +0000 (14:15 +0000)]
AMDGPU: Don't handle FP16_TO_FP in isCanonicalized

This needs more special handling to do correctly.
Fixes test in subsequent commit.

llvm-svn: 338381

6 years ago[SLP] Fix PR38339: Instruction does not dominate all uses!
Alexey Bataev [Tue, 31 Jul 2018 14:02:43 +0000 (14:02 +0000)]
[SLP] Fix PR38339: Instruction does not dominate all uses!

Summary:
If the ExtractElement instructions can be optimized out during the
vectorization and we need to reshuffle the parent vector, this
ShuffleInstruction may be inserted in the wrong place causing compiler
to produce incorrect code.

Reviewers: spatel, RKSimon, mkuper, hfinkel, javed.absar

Subscribers: llvm-commits

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

llvm-svn: 338380

6 years ago[LLD][ELF] - ICF: Check we do not fold sections which relocations reffering to absolu...
George Rimar [Tue, 31 Jul 2018 13:55:25 +0000 (13:55 +0000)]
[LLD][ELF] - ICF: Check we do not fold sections which relocations reffering to absolute symbols with a different values.

This adds a test for the following uncovered piece of code:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L263

Without that lines we would crash.

llvm-svn: 338379

6 years ago[clangd] Do not build AST if no diagnostics were requested
Ilya Biryukov [Tue, 31 Jul 2018 13:45:37 +0000 (13:45 +0000)]
[clangd] Do not build AST if no diagnostics were requested

Summary:
It can be removed from the cache before the first access anyway, so
building it can be a waste of time.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: javed.absar, MaskRay, jkorous, arphaman, cfe-commits

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

llvm-svn: 338378

6 years ago[ELF][ARM] Implement support for Tag_ABI_VFP_args
Peter Smith [Tue, 31 Jul 2018 13:41:59 +0000 (13:41 +0000)]
[ELF][ARM] Implement support for Tag_ABI_VFP_args

The Tag_ABI_VFP_args build attribute controls the procedure call standard
used for floating point parameters on ARM. The values are:
0 - Base AAPCS (FP Parameters passed in Core (Integer) registers
1 - VFP AAPCS (FP Parameters passed in FP registers)
2 - Toolchain specific (Neither Base or VFP)
3 - Compatible with all (No use of floating point parameters)

If the Tag_ABI_VFP_args build attribute is missing it has an implicit value
of 0.

We use the attribute in two ways:
- Detect a clash in calling convention between Base, VFP and Toolchain.
we follow ld.bfd's lead and do not error if there is a clash between an
implicit Base AAPCS caused by a missing attribute. Many projects
including the hard-float (VFP AAPCS) version of glibc contain assembler
files that do not use floating point but do not have Tag_ABI_VFP_args.
- Set the EF_ARM_ABI_FLOAT_SOFT or EF_ARM_ABI_FLOAT_HARD ELF header flag
for Base or VFP AAPCS respectively. This flag is used by some ELF
loaders.

References:
- Addenda to, and Errata in, the ABI for the ARM Architecture for
Tag_ABI_VFP_args
- Elf for the ARM Architecture for ELF header flags

Fixes PR36009

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

llvm-svn: 338377

6 years agoAMDGPU: Fold undef fcanonicalize to qNaN
Matt Arsenault [Tue, 31 Jul 2018 13:34:31 +0000 (13:34 +0000)]
AMDGPU: Fold undef fcanonicalize to qNaN

We could choose a free 0 for this, but this
matches the behavior for fmul undef, 1.0. Also,
the NaN use is more useful for folding use operations
although if it's not eliminated it is more expensive
in terms of code size.

llvm-svn: 338376

6 years ago[LLD][ELF] - ICF: add test case testing we do not fold sections with the different...
George Rimar [Tue, 31 Jul 2018 13:32:16 +0000 (13:32 +0000)]
[LLD][ELF] - ICF: add test case testing we do not fold sections with the different flags. NFCI.

Previously the following condition was not tested at all:
https://github.com/llvm-mirror/lld/blob/master/ELF/ICF.cpp#L300

Patch adds a test for `A->Flags != B->Flags` part.

llvm-svn: 338375

6 years agoAMDGPU: Fix test check line bugs
Matt Arsenault [Tue, 31 Jul 2018 13:25:23 +0000 (13:25 +0000)]
AMDGPU: Fix test check line bugs

llvm-svn: 338374

6 years ago[ARM] Complete enumeration values for Tag_ABI_VFP_args
Peter Smith [Tue, 31 Jul 2018 13:24:49 +0000 (13:24 +0000)]
[ARM] Complete enumeration values for Tag_ABI_VFP_args

The LLD implementation of Tag_ABI_VFP_args needs to check the rarely seen
values of 3 (toolchain specific) and 4 compatible with both Base and VFP.
Add the missing enumeration values so that LLD can refer to them without
having to use the raw numbers.

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

llvm-svn: 338373

6 years ago[llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms.
Andrea Di Biagio [Tue, 31 Jul 2018 13:21:43 +0000 (13:21 +0000)]
[llvm-mca][BtVer2] Teach how to identify dependency-breaking idioms.

This patch teaches llvm-mca how to identify dependency breaking instructions on
btver2.

An example of dependency breaking instructions is the zero-idiom XOR (example:
`XOR %eax, %eax`), which always generates zero regardless of the actual value of
the input register operands.
Dependency breaking instructions don't have to wait on their input register
operands before executing. This is because the computation is not dependent on
the inputs.

Not all dependency breaking idioms are also zero-latency instructions. For
example, `CMPEQ %xmm1, %xmm1` is independent on
the value of XMM1, and it generates a vector of all-ones.
That instruction is not eliminated at register renaming stage, and its opcode is
issued to a pipeline for execution. So, the latency is not zero.

This patch adds a new method named isDependencyBreaking() to the MCInstrAnalysis
interface. That method takes as input an instruction (i.e. MCInst) and a
MCSubtargetInfo.
The default implementation of isDependencyBreaking() conservatively returns
false for all instructions. Targets may override the default behavior for
specific CPUs, and return a value which better matches the subtarget behavior.

In future, we should teach to Tablegen how to automatically generate the body of
isDependencyBreaking from scheduling predicate definitions. This would allow us
to expose the knowledge about dependency breaking instructions to the machine
schedulers (and, potentially, other codegen passes).

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

llvm-svn: 338372

6 years ago[debuginfo-tests] tweak new test to be compatible with wider range of compilers.
Tim Northover [Tue, 31 Jul 2018 13:19:01 +0000 (13:19 +0000)]
[debuginfo-tests] tweak new test to be compatible with wider range of compilers.

emplace_back was added in C++11, and its usage isn't critical to what's being
tested so using push_back instead will allow this test to work with more
compilers.

llvm-svn: 338371

6 years ago[ELF][ARM] Add Arm ABI names for float ABI ELF Header flags
Peter Smith [Tue, 31 Jul 2018 13:03:54 +0000 (13:03 +0000)]
[ELF][ARM] Add Arm ABI names for float ABI ELF Header flags

The ELF for the Arm architecture document defines, for EF_ARM_EABI_VER5 and
above, the flags EF_ARM_ABI_FLOAT_HARD and EF_ARM_ABI_FLOAT_SOFT. These
have been defined to be compatible with the existing EF_ARM_VFP_FLOAT and
EF_ARM_SOFT_FLOAT used by gcc for EF_ARM_EABI_UNKNOWN.

This patch adds the flags in addition to the existing ones so that any code
depending on the old names will still work.

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

llvm-svn: 338370

6 years agoRevert r338365: [X86] Improved sched models for X86 BT*rr instructions.
Simon Pilgrim [Tue, 31 Jul 2018 13:00:51 +0000 (13:00 +0000)]
Revert r338365: [X86] Improved sched models for X86 BT*rr instructions.
https://reviews.llvm.org/D49243

Contains WIP code that should not have been included.

llvm-svn: 338369

6 years ago[SystemZ] Improve decoding in case of instructions with four register operands.
Jonas Paulsson [Tue, 31 Jul 2018 13:00:42 +0000 (13:00 +0000)]
[SystemZ] Improve decoding in case of instructions with four register operands.

Since z13, the max group size will be 2 if any μop has more than 3 register
sources.

This has been ignored sofar in the SystemZHazardRecognizer, but is now
handled by recognizing those instructions and adjusting the tracking of
decoding and the cost heuristic for grouping.

Review: Ulrich Weigand
https://reviews.llvm.org/D49847

llvm-svn: 338368

6 years ago[InstCombine] simplify code for A & (A ^ B) --> A & ~B
Sanjay Patel [Tue, 31 Jul 2018 13:00:03 +0000 (13:00 +0000)]
[InstCombine] simplify code for A & (A ^ B) --> A & ~B

This fold was written in an odd way and tried to avoid
an endless loop by bailing out on all constants instead
of the supposedly problematic case of -1. But (X & -1)
should always be simplified before we reach here, so I'm
not sure how that is a problem.

There were no tests for the commuted patterns, so I added
those at rL338364.

llvm-svn: 338367

6 years agoclang-format: try to make the doc for ConstructorInitializerAllOnOneLineOrOnePerLine...
Hans Wennborg [Tue, 31 Jul 2018 12:42:02 +0000 (12:42 +0000)]
clang-format: try to make the doc for ConstructorInitializerAllOnOneLineOrOnePerLine more clear

PR38080 complained that the "OnePerLine" case wasn't previously shown.

llvm-svn: 338366

6 years ago[X86] Improved sched models for X86 BT*rr instructions.
Andrew V. Tischenko [Tue, 31 Jul 2018 12:33:48 +0000 (12:33 +0000)]
[X86] Improved sched models for X86 BT*rr instructions.
https://reviews.llvm.org/D49243

llvm-svn: 338365

6 years ago[InstCombine] move/add tests for xor+add fold; NFC
Sanjay Patel [Tue, 31 Jul 2018 12:31:00 +0000 (12:31 +0000)]
[InstCombine] move/add tests for xor+add fold; NFC

llvm-svn: 338364

6 years agowindows_support.rst: Add links for downloading
Hans Wennborg [Tue, 31 Jul 2018 12:02:03 +0000 (12:02 +0000)]
windows_support.rst: Add links for downloading

llvm-svn: 338363

6 years agoindex.rst: pe/coff does support pdbs now
Hans Wennborg [Tue, 31 Jul 2018 12:00:26 +0000 (12:00 +0000)]
index.rst: pe/coff does support pdbs now

llvm-svn: 338362

6 years ago[clangd] Report diagnostics even if WantDiags::No AST was reused
Ilya Biryukov [Tue, 31 Jul 2018 11:47:52 +0000 (11:47 +0000)]
[clangd] Report diagnostics even if WantDiags::No AST was reused

Summary:
After r338256, clangd stopped reporting diagnostics if WantDiags::No request
is followed by a WantDiags::Yes request but the AST can be reused.

Reviewers: ioeric

Reviewed By: ioeric

Subscribers: javed.absar, MaskRay, jkorous, arphaman, jfb, cfe-commits

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

llvm-svn: 338361

6 years agoFix linux-header-search.cpp with CLANG_DEFAULT_CXX_STDLIB
Jonas Hahnfeld [Tue, 31 Jul 2018 11:36:14 +0000 (11:36 +0000)]
Fix linux-header-search.cpp with CLANG_DEFAULT_CXX_STDLIB

This configuration was broken after r338294 because Clang might
be configured to always use libc++.

llvm-svn: 338360

6 years ago[X86] Improved sched models for X86 SHLD/SHRD* instructions.
Andrew V. Tischenko [Tue, 31 Jul 2018 10:14:43 +0000 (10:14 +0000)]
[X86] Improved sched models for X86 SHLD/SHRD* instructions.
Differential Revision: https://reviews.llvm.org/D9611

llvm-svn: 338359

6 years ago[X86][SSE] isFNEG - Use getTargetConstantBitsFromNode to handle all constant cases
Simon Pilgrim [Tue, 31 Jul 2018 10:13:17 +0000 (10:13 +0000)]
[X86][SSE] isFNEG - Use getTargetConstantBitsFromNode to handle all constant cases

isFNEG was duplicating much of what was done by getTargetConstantBitsFromNode in its own calls to getTargetConstantFromNode.

Noticed while reviewing D48467.

llvm-svn: 338358

6 years ago[ARM] Allow automatically deducing the thumb instruction size for .inst
Martin Storsjo [Tue, 31 Jul 2018 09:27:07 +0000 (09:27 +0000)]
[ARM] Allow automatically deducing the thumb instruction size for .inst

This matches GAS, that allows unsuffixed .inst for thumb.

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

llvm-svn: 338357

6 years ago[ARM] Support the .inst directive for MachO and COFF targets
Martin Storsjo [Tue, 31 Jul 2018 09:27:01 +0000 (09:27 +0000)]
[ARM] Support the .inst directive for MachO and COFF targets

Contrary to ELF, we don't add any markers that distinguish data generated
with .short/.long from normal instructions, so the .inst directive only
adds compatibility with assembly that uses it.

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

llvm-svn: 338356

6 years ago[AArch64] Support the .inst directive for MachO and COFF targets
Martin Storsjo [Tue, 31 Jul 2018 09:26:52 +0000 (09:26 +0000)]
[AArch64] Support the .inst directive for MachO and COFF targets

Contrary to ELF, we don't add any markers that distinguish data generated
with .long from normal instructions, so the .inst directive only adds
compatibility with assembly that uses it.

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

llvm-svn: 338355

6 years ago[ARM] Revert r337821
Sam Parker [Tue, 31 Jul 2018 09:04:14 +0000 (09:04 +0000)]
[ARM] Revert r337821

Re-enabling ARMCodeGenPrepare by default after failing to reproduce
the bootstrap issues that I was concerned it was causing.

llvm-svn: 338354

6 years agoImprove support of PDB as an external layout source
Aleksandr Urakov [Tue, 31 Jul 2018 08:27:06 +0000 (08:27 +0000)]
Improve support of PDB as an external layout source

Summary:
This patch improves support of PDB as an external layout source
in the next cases:

- Multiple non-virtual inheritance from packed base classes. When using
  external layout, there's no need to align `NonVirtualSize` of a base class.
  It may cause an overlapping when the next base classes will be layouted
  (but there is a slightly different case in the test because I can't find
  a way to specify a base offset);
- Support of nameless structs and unions. There is no info about nameless child
  structs and unions in Microsoft cl-emitted PDBs. Instead all its fields
  are just treated as outer structure's (union's) fields. This also causes
  a fields overlapping, and makes it possible for unions to have fields located
  at a non-zero offset.

Reviewers: rsmith, zturner, rnk, mstorsjo, majnemer

Reviewed By: rnk

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 338353

6 years agoTest commit.
Hsiangkai Wang [Tue, 31 Jul 2018 06:09:29 +0000 (06:09 +0000)]
Test commit.

llvm-svn: 338352

6 years ago[InstSimplify] tests for D48828, D49981: fold extraction from std::pair
Hiroshi Inoue [Tue, 31 Jul 2018 05:29:20 +0000 (05:29 +0000)]
[InstSimplify] tests for D48828, D49981: fold extraction from std::pair

Minor touch up in the previous comment.

llvm-svn: 338351

6 years ago[InstSimplify] tests for D48828, D49981: fold extraction from std::pair
Hiroshi Inoue [Tue, 31 Jul 2018 05:10:36 +0000 (05:10 +0000)]
[InstSimplify] tests for D48828, D49981: fold extraction from std::pair

Updated unit tests for D48828 and D49981.

llvm-svn: 338350

6 years ago[XRay][compiler-rt] Update test to use similar structure
Dean Michael Berris [Tue, 31 Jul 2018 04:47:37 +0000 (04:47 +0000)]
[XRay][compiler-rt] Update test to use similar structure

This is a follow-up to D50037.

llvm-svn: 338349

6 years ago[NFC] Collect statistics in GuardWidening
Max Kazantsev [Tue, 31 Jul 2018 04:37:11 +0000 (04:37 +0000)]
[NFC] Collect statistics in GuardWidening

llvm-svn: 338348

6 years ago[XRay][compiler-rt] Profiling Mode: Include file header in buffers
Dean Michael Berris [Tue, 31 Jul 2018 04:16:54 +0000 (04:16 +0000)]
[XRay][compiler-rt] Profiling Mode: Include file header in buffers

Summary:
This change provides access to the file header even in the in-memory
buffer processing. This allows in-memory processing of the buffers to
also check the version, and the format, of the profile data.

Reviewers: eizan, kpw

Reviewed By: eizan

Subscribers: llvm-commits

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

llvm-svn: 338347

6 years ago[VPlan] Introduce VPLoopInfo analysis.
Diego Caballero [Tue, 31 Jul 2018 01:57:29 +0000 (01:57 +0000)]
[VPlan] Introduce VPLoopInfo analysis.

The patch introduces loop analysis (VPLoopInfo/VPLoop) for VPBlockBases.
This analysis will be necessary to perform some H-CFG transformations and
detect and introduce regions representing a loop in the H-CFG.

Reviewers: fhahn, rengolin, mkuper, hfinkel, mssimpso

Reviewed By: fhahn

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

llvm-svn: 338346

6 years agoRemove Stream::UnitTest
Raphael Isemann [Tue, 31 Jul 2018 01:21:36 +0000 (01:21 +0000)]
Remove Stream::UnitTest

Summary: No one is using this method, and it also doesn't really make a lot of sense to have it around.

Reviewers: davide

Reviewed By: davide

Subscribers: davide, lldb-commits

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

llvm-svn: 338345

6 years agoRevert r338340 "[MS Demangler] Better demangling of template arguments."
Reid Kleckner [Tue, 31 Jul 2018 01:08:42 +0000 (01:08 +0000)]
Revert r338340 "[MS Demangler] Better demangling of template arguments."

Breaks the build with GCC, apparently.

llvm-svn: 338344

6 years ago[coroutines] Fix handling of dependent co_await in StmtProfiler.
Richard Smith [Tue, 31 Jul 2018 00:47:41 +0000 (00:47 +0000)]
[coroutines] Fix handling of dependent co_await in StmtProfiler.

Fix "Invalid operator call kind" error (llvm_unreachable) in
DecodeOperatorCall when profiling a dependent co_await.

Patch by Victor Zverovich!

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

llvm-svn: 338343

6 years ago[X86] Stop accidentally running the Bonnell LEA fixup path on Goldmont.
Craig Topper [Tue, 31 Jul 2018 00:43:54 +0000 (00:43 +0000)]
[X86] Stop accidentally running the Bonnell LEA fixup path on Goldmont.

In one place we checked X86Subtarget.slowLEA() to decide if the pass should run. But to decide what the pass should we only check isSLM. This resulted in Goldmont going down the Bonnell path.

llvm-svn: 338342

6 years ago[RISCV] Fixed test case failure due to r338047
Ana Pazos [Tue, 31 Jul 2018 00:36:28 +0000 (00:36 +0000)]
[RISCV] Fixed test case failure due to r338047

llvm-svn: 338341

6 years ago[MS Demangler] Better demangling of template arguments.
Zachary Turner [Tue, 31 Jul 2018 00:26:52 +0000 (00:26 +0000)]
[MS Demangler] Better demangling of template arguments.

This patch fixes demangling of template aliases as template-template
arguments, and also fixes function pointers and references as
not type template parameters.  All of these can be properly
demangled now, so I've ported over the test
clang/test/CodeGenCXX/ms-template-callbacks.cpp.  All of these
tests pass

llvm-svn: 338340

6 years ago[analyzer] Rename test: cxx17-mandatory-elision.cpp -> copy-elision.cpp
Artem Dergachev [Tue, 31 Jul 2018 00:18:35 +0000 (00:18 +0000)]
[analyzer] Rename test: cxx17-mandatory-elision.cpp -> copy-elision.cpp

It reflects its contents more accurately. No functional change intended.

llvm-svn: 338339

6 years ago[Sema] Relax a failing assert in TemplateArgumentLoc
Erik Pilkington [Tue, 31 Jul 2018 00:18:30 +0000 (00:18 +0000)]
[Sema] Relax a failing assert in TemplateArgumentLoc

Any of these template argument kinds can be represented with an expression, so
accept them in this constructor.

Patch by Balaji Iyer!

rdar://41459965

Differential revision: https://reviews.llvm.org/D49766

llvm-svn: 338338

6 years ago[AArch64][GlobalISel] Add isel support for G_BLOCK_ADDR.
Amara Emerson [Tue, 31 Jul 2018 00:09:02 +0000 (00:09 +0000)]
[AArch64][GlobalISel] Add isel support for G_BLOCK_ADDR.

Also refactors some existing code to materialize addresses for the large code
model so it can be shared between G_GLOBAL_VALUE and G_BLOCK_ADDR.

This implements PR36390.

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

llvm-svn: 338337

6 years ago[AArch64][GlobalISel] Make G_BLOCK_ADDR legal.
Amara Emerson [Tue, 31 Jul 2018 00:08:56 +0000 (00:08 +0000)]
[AArch64][GlobalISel] Make G_BLOCK_ADDR legal.

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

llvm-svn: 338336

6 years ago[GlobalISel] Add a G_BLOCK_ADDR opcode to handle IR blockaddress constants.
Amara Emerson [Tue, 31 Jul 2018 00:08:50 +0000 (00:08 +0000)]
[GlobalISel] Add a G_BLOCK_ADDR opcode to handle IR blockaddress constants.

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

llvm-svn: 338335

6 years agoPacify sanitizer lint script that still does not run on Windows
Reid Kleckner [Tue, 31 Jul 2018 00:08:26 +0000 (00:08 +0000)]
Pacify sanitizer lint script that still does not run on Windows

llvm-svn: 338334

6 years ago[analyzer] CStringChecker: Remember to highlight the argument expression range.
Artem Dergachev [Mon, 30 Jul 2018 23:44:37 +0000 (23:44 +0000)]
[analyzer] CStringChecker: Remember to highlight the argument expression range.

When emitting a bug report, it is important to highlight which argument of the
call-expression is causing the problem.

Before:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^~~~~~~~~~~~

After:
warning: Null pointer argument in call to string comparison function
  strcmp(a, b);
  ^      ~

Affects other output modes as well, not just text.

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

llvm-svn: 338333

6 years agoCode cleanup - change naked 'throw' expressions to call helpre function '__throw_futu...
Marshall Clow [Mon, 30 Jul 2018 23:33:48 +0000 (23:33 +0000)]
Code cleanup - change naked 'throw' expressions to call helpre function '__throw_future_error'. The behavior change is that if you build libc++ with exceptions disabled, and then use that in a program that sets the value of the future twice (for example), it will now abort instead of behaving unpredictably.

llvm-svn: 338332

6 years ago[asan/win] Use SRW locks to fix a race in BlockingMutex
Reid Kleckner [Mon, 30 Jul 2018 23:32:33 +0000 (23:32 +0000)]
[asan/win] Use SRW locks to fix a race in BlockingMutex

Summary:
Before my change, BlockingMutex used Windows critial sections. Critical
sections can only be initialized by calling InitializeCriticalSection,
dynamically.

The primary sanitizer allocator expects to be able to reinterpret zero
initialized memory as a BlockingMutex and immediately lock it.
RegionInfo contains a mutex, and it placement new is never called for
it. These objects are accessed via:
  RegionInfo *GetRegionInfo(uptr class_id) const {
    DCHECK_LT(class_id, kNumClasses);
    RegionInfo *regions = reinterpret_cast<RegionInfo *>(SpaceEnd());
    return &regions[class_id];
  }
The memory comes from the OS without any other initialization.

For various reasons described in the comments, BlockingMutex::Lock would
check if the object appeared to be zero-initialized, and it would lazily
call the LinkerInitialized constructor to initialize the critical
section. This pattern is obviously racy, and the code had a bunch of
FIXMEs about it.

The best fix here is to use slim reader writer locks, which can start
out zero-initialized. They are available starting in Windows Vista. I
think it's safe to go ahead and use them today.

Reviewers: kcc, vitalybuka

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 338331

6 years ago[MS Demangler] Add ms-return-qualifiers.test.
Zachary Turner [Mon, 30 Jul 2018 23:22:39 +0000 (23:22 +0000)]
[MS Demangler] Add ms-return-qualifiers.test.

This is a copy of the tests from
clang/CodeGenCXX/ms-return-qualifiers.cpp converted to demangling
tests.

llvm-svn: 338330

6 years ago[DAGCombiner][TargetLowering] Pass a SmallVector instead of a std::vector to BuildSDI...
Craig Topper [Mon, 30 Jul 2018 23:22:00 +0000 (23:22 +0000)]
[DAGCombiner][TargetLowering] Pass a SmallVector instead of a std::vector to BuildSDIV/BuildUDIV/etc.

The vector contains the SDNodes that these functions create. The number of nodes is always a small number so we should use SmallVector to avoid a heap allocation.

llvm-svn: 338329

6 years agoRevert "Add a definition for FieldSize that seems to make sense here."
Eric Christopher [Mon, 30 Jul 2018 23:21:51 +0000 (23:21 +0000)]
Revert "Add a definition for FieldSize that seems to make sense here."

This reverts commit r338327, the problem was previously fixed in r338321.

llvm-svn: 338328

6 years agoAdd a definition for FieldSize that seems to make sense here.
Eric Christopher [Mon, 30 Jul 2018 23:17:27 +0000 (23:17 +0000)]
Add a definition for FieldSize that seems to make sense here.
This could be sunk out of the if statements, but fix the warning for now.

llvm-svn: 338327