platform/upstream/llvm.git
4 years agoUse MCRegister in copyPhysReg
Matt Arsenault [Mon, 11 Nov 2019 08:24:21 +0000 (13:54 +0530)]
Use MCRegister in copyPhysReg

4 years ago[FixBB] - An attemp to fix clang-armv7-linux-build-cache builder.
Georgii Rymar [Mon, 11 Nov 2019 08:59:38 +0000 (11:59 +0300)]
[FixBB] - An attemp to fix clang-armv7-linux-build-cache builder.

http://lab.llvm.org:8011/builders/clang-armv7-linux-build-cache/builds/22130/steps/build%20stage%201/logs/stdio

/usr/bin/c++   -DGTEST_HAS_RTTI=0 -D_DEBUG -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/ObjectYAML -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML -I/usr/include/libxml2 -Iinclude -I/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/include -mthumb -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -O3    -UNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MMD -MT lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o -MF lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o.d -o lib/ObjectYAML/CMakeFiles/LLVMObjectYAML.dir/YAML.cpp.o -c /home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp
/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp:42:41: error: no matching function for call to 'min'
    OS.write((const char *)Data.data(), std::min(N, Data.size()));
                                        ^~~~~~~~
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:370:5: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long long' vs. 'unsigned int')
    min(const _Tp&, const _Tp&);
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3451:5: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'unsigned long long'
    min(initializer_list<_Tp> __l, _Compare __comp)
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:375:5: note: candidate function template not viable: requires 3 arguments, but 2 were provided
    min(const _Tp&, const _Tp&, _Compare);
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3445:5: note: candidate function template not viable: requires single argument '__l', but 2 arguments were provided
    min(initializer_list<_Tp> __l)
    ^
/home/buildslave/buildslave/clang-armv7-linux-build-cache/llvm/llvm/lib/ObjectYAML/YAML.cpp:46:28: error: no matching function for call to 'min'
  for (uint64_t I = 0, E = std::min(N, Data.size() / 2); I != E; ++I) {
                           ^~~~~~~~
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:370:5: note: candidate template ignored: deduced conflicting types for parameter '_Tp' ('unsigned long long' vs. 'unsigned int')
    min(const _Tp&, const _Tp&);
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3451:5: note: candidate template ignored: could not match 'initializer_list<type-parameter-0-0>' against 'unsigned long long'
    min(initializer_list<_Tp> __l, _Compare __comp)
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/algorithmfwd.h:375:5: note: candidate function template not viable: requires 3 arguments, but 2 were provided
    min(const _Tp&, const _Tp&, _Compare);
    ^
/usr/bin/../lib/gcc/arm-linux-gnueabihf/5.4.0/../../../../include/c++/5.4.0/bits/stl_algo.h:3445:5: note: candidate function template not viable: requires single argument '__l', but 2 arguments were provided
    min(initializer_list<_Tp> __l)

Fix: specify the type for std::min call.

4 years ago[AArch64][SVE] Spilling/filling of SVE callee-saves.
Sander de Smalen [Tue, 5 Nov 2019 16:54:54 +0000 (16:54 +0000)]
[AArch64][SVE] Spilling/filling of SVE callee-saves.

Implement the spills/fills of callee-saved SVE registers using STR and LDR
instructions.

Also adds the `aarch64_sve_vector_pcs` attribute to specify the
callee-saved registers to be used for functions that return SVE vectors or
take SVE vectors as arguments. The callee-saved registers are vector
registers z8-z23 and predicate registers p4-p15.

The overal frame-layout with SVE will be as follows:

   +-------------+
   | stack args  |
   +-------------+
   | Callee Saves|
   |   X29, X30  |
   |-------------| <- FP
   | SVE Callee  | < //////////////
   | saved regs  | < //////////////
   |    z23      | < //////////////
   |     :       | < // SCALABLE //
   |    z8       | < //////////////
   |    p15      | < /// STACK ////
   |     :       | < //////////////
   |    p4       | < //// AREA ////
   +-------------+ < //////////////
   |     :       | < //////////////
   |  SVE locals | < //////////////
   |     :       | < //////////////
   +-------------+
   |/////////////| alignment gap.
   |     :       |
   | Stack objs  |
   |     :       |
   +-------------+ <- SP after call and frame-setup

Reviewers: cameron.mcinally, efriedma, greened, thegameg, ostannard, rengolin

Reviewed By: ostannard

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

4 years ago[yaml2obj] - Add a way to describe the custom data that is not part of an output...
Georgii Rymar [Fri, 1 Nov 2019 12:24:58 +0000 (15:24 +0300)]
[yaml2obj] - Add a way to describe the custom data that is not part of an output section.

Currently there is no way to describe the data that is not a part of an output section.
It can be a data used to align sections or to fill the gaps with something,
or another kind of custom data. In this patch I suggest a way to describe it. It looks like that:

```
Sections:
  - Type:    CustomFiller
    Pattern: "CCDD"
    Size:    4
  - Name:    .bar
    Type:    SHT_PROGBITS
    Content: "FF"
```

I.e. I've added a kind of synthetic section with a synthetic type "CustomFiller".
In the code it is called a "SyntheticFiller", which is "a synthetic section which
might be used to write the custom data around regular output sections. It does
not present in the sections header table, but it might affect the output file size and
program headers produced. Think about it as about piece of data."

`SyntheticFiller` currently has a `Pattern` field and a `Size` field + an optional `Name`.
When written, `Size` of bytes in the output will be filled with a `Pattern`.
It is possible to reference a named filler it by name from the program headers description,
just like any other normal section.

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

4 years ago[clangd] Fixes colon escaping on Windows
Ilya Biryukov [Fri, 8 Nov 2019 15:04:07 +0000 (16:04 +0100)]
[clangd] Fixes colon escaping on Windows

vscode always escapes the colon on the file uri, which causes the semantic highlighting fails on windows.

fixes: https://github.com/clangd/clangd/issues/176

4 years agolibc++ status page: New papers and issues adopted in Belfast
marshall [Sun, 10 Nov 2019 13:44:10 +0000 (13:44 +0000)]
libc++ status page: New papers and issues adopted in Belfast

4 years ago[NFC] Add one test to verify the dependency brings by Macro-Fusion.
QingShan Zhang [Mon, 11 Nov 2019 06:54:26 +0000 (06:54 +0000)]
[NFC] Add one test to verify the dependency brings by Macro-Fusion.

4 years ago[DirectedGraph]: Add setTargetNode member function
Tsang Whitney W.H [Sun, 10 Nov 2019 20:00:30 +0000 (20:00 +0000)]
[DirectedGraph]: Add setTargetNode member function
Summary:Add the setTargetNode member function to class DGEdge.
Authored By:etiotto
Reviewer:bmahjour, Whitney, jdoerfert, Meinersbur, fhahn, kbarton,
dmgreen
Reviewed By:Meinersbur
Subscribers:dexonsmith, kristina, llvm-commits
Tag:LLVM
Differential Revision:https://reviews.llvm.org/D68474

4 years agoRevert "Fixed a profdata file size detection on Windows system."
Vladimir Vereschaka [Mon, 11 Nov 2019 01:58:29 +0000 (17:58 -0800)]
Revert "Fixed a profdata file size detection on Windows system."

This reverts commit bcbb121ff6c8440382abfce8f2911a095f14602b.

Using 'ls -o' is not compatible way to fix the problem. FreeBSD and OSX
version of 'ls' do not support -o flag and test gets failed on these
platforms.

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

4 years ago[InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a singl...
Craig Topper [Mon, 11 Nov 2019 00:20:19 +0000 (16:20 -0800)]
[InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a single bitcast from x86_mmx to i64/double.

The _m64 type is represented in IR as <1 x i64>. The x86-64 ABI
on Linux passes <1 x i64> as a double. MMX intrinsics use x86_mmx
type in IR.These things result in a lot of bitcasts in mmx code.
There's another instcombine that tries to turn bitcast <1 x i64>
to double into extractelement and a bitcast.

The combine here tries to reverse this extractelement conversion
if we see an mmx type.

4 years ago[InstCombine] Add a test case for suboptimal handling of (double (bitcast (<1 x i64...
Craig Topper [Sun, 10 Nov 2019 08:34:32 +0000 (00:34 -0800)]
[InstCombine] Add a test case for suboptimal handling of (double (bitcast (<1 x i64> (bitcast (x86_mmx)))))

The outer bitcast gets turned into an extractelement and another
bitcast rather than combining away to a single bitcast from mmx
to double.

4 years agoRevert "[InstCombine] avoid crash from deleting an instruction that still has uses...
Sanjay Patel [Sun, 10 Nov 2019 23:47:49 +0000 (18:47 -0500)]
Revert "[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (2nd try)"

This reverts commit 56b2aee1875a1ee47ddf859a6584f8728787fb7b.
Still causes a use-after-free on sanitizer bots.

4 years ago[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723...
Sanjay Patel [Sun, 10 Nov 2019 22:24:48 +0000 (17:24 -0500)]
[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723) (2nd try)

Re-try rGef02831f0a4e (reverted due to use-after-free), but bail out completely
if we encounter an unexpected llvm.invariant.start.

We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.end.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

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

4 years agogetArgOperandNo helper function.
Stefan Stipanovic [Sun, 10 Nov 2019 20:45:11 +0000 (21:45 +0100)]
getArgOperandNo helper function.

Summary: A helper function to get argument number of a arg operand Use.

Reviewers: jdoerfert, uenoku

Subscribers: hiraditya, lebedev.ri, llvm-commits

Tags: #llvm

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

4 years agoclang/Modules: Remove unused parameter from ModuleManager::removeModules
Duncan P. N. Exon Smith [Sun, 10 Nov 2019 18:31:03 +0000 (10:31 -0800)]
clang/Modules: Remove unused parameter from ModuleManager::removeModules

The other paremeters appear to be sufficient to determine which modules
have just been loaded and need to be removed, so stop collecting and
sending in that set explicitly.

4 years ago[NFC][Codegen] Add `x u% C1 == C2` with C1 u> C2 non-tautological tests
Roman Lebedev [Sun, 10 Nov 2019 16:44:46 +0000 (19:44 +0300)]
[NFC][Codegen] Add `x u% C1 == C2` with C1 u> C2 non-tautological tests

4 years agoDocs: Updates Sphinx Quickstart template for new contributors
drichards-87 [Sun, 10 Nov 2019 16:27:32 +0000 (09:27 -0700)]
Docs: Updates Sphinx Quickstart template for new contributors

4 years agoRevert "[InstCombine] avoid crash from deleting an instruction that still has uses...
Sanjay Patel [Sun, 10 Nov 2019 16:18:05 +0000 (11:18 -0500)]
Revert "[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)"

This reverts commit ef02831f0a4e3b3ccaa45a5589e4cabecbf527ab.
Sanitizer bots fail with this change.

4 years ago[RISCV] Fix CFA when doing split sp adjustment with fp
Luís Marques [Sun, 10 Nov 2019 16:04:43 +0000 (16:04 +0000)]
[RISCV] Fix CFA when doing split sp adjustment with fp

Summary: When using the split sp adjustment and using the frame-pointer
we were still emitting CFI CFA directives based on the sp value. The
final sp-based offset also didn't reflect the two-stage sp adjust. There
remain CFI issues that aren't related to the split sp adjustment, and
thus will be addressed in a separate patch.

Reviewers: asb, lenary, shiva0217
Reviewed By: lenary, shiva0217
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69385

4 years ago[RISCV][NFC] Add CFI-related tests
Luís Marques [Sun, 10 Nov 2019 15:56:51 +0000 (15:56 +0000)]
[RISCV][NFC] Add CFI-related tests

Summary: Adds tests necessary to properly show the impact of other
patches that affect the emission of CFI directives.

Reviewers: asb, lenary
Reviewed By: lenary
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69721

4 years ago[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)
Sanjay Patel [Sun, 10 Nov 2019 14:16:32 +0000 (09:16 -0500)]
[InstCombine] avoid crash from deleting an instruction that still has uses (PR43723)

We gather a set of white-listed instructions in isAllocSiteRemovable() and then
replace/erase them. But we don't know in general if the instructions in the set
have uses amongst themselves, so order of deletion makes a difference.

There's already a special-case for the llvm.objectsize intrinsic, so add another
for llvm.invariant.end.

Should fix:
https://bugs.llvm.org/show_bug.cgi?id=43723

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

4 years agoRemove unused variable (which allows us to remove vector include). NFC.
Simon Pilgrim [Sun, 10 Nov 2019 12:15:49 +0000 (12:15 +0000)]
Remove unused variable (which allows us to remove vector include). NFC.

4 years ago[Driver] Remove unused variable. NFC.
Benjamin Kramer [Sun, 10 Nov 2019 11:53:19 +0000 (12:53 +0100)]
[Driver] Remove unused variable. NFC.

4 years ago[NFC][Codegen] Add `x u% C1 == C2` with C1 u<= C2 tautological tests
Roman Lebedev [Sun, 10 Nov 2019 11:21:50 +0000 (14:21 +0300)]
[NFC][Codegen] Add `x u% C1 == C2` with C1 u<= C2 tautological tests

4 years agoTwine - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 10 Nov 2019 11:21:43 +0000 (11:21 +0000)]
Twine - fix uninitialized variable warnings. NFCI.

4 years agoTableGen - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 10 Nov 2019 11:19:50 +0000 (11:19 +0000)]
TableGen - fix uninitialized variable warnings. NFCI.

4 years agoPODSmallVector - fix MSVC uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 10 Nov 2019 11:18:15 +0000 (11:18 +0000)]
PODSmallVector - fix MSVC uninitialized variable warnings. NFCI.

4 years agoPath - fix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sun, 10 Nov 2019 11:15:39 +0000 (11:15 +0000)]
Path - fix uninitialized variable warnings. NFCI.

4 years agoCodeGenRegBank - make functions const to fix cppcheck warnings.
Simon Pilgrim [Sun, 10 Nov 2019 11:14:58 +0000 (11:14 +0000)]
CodeGenRegBank - make functions const to fix cppcheck warnings.

4 years ago[MC] Clean up MacroInstantiation. NFC
Fangrui Song [Sat, 9 Nov 2019 23:20:20 +0000 (15:20 -0800)]
[MC] Clean up MacroInstantiation. NFC

4 years ago[NFC]: Fix PVS Studio warning in LoopNestAnalysis
Tsang Whitney W.H [Sun, 10 Nov 2019 05:39:40 +0000 (05:39 +0000)]
[NFC]: Fix PVS Studio warning in LoopNestAnalysis
Summary:This patch fixes the following warnings uncovered by PVS
Studio:

/home/xbolva00/LLVM/llvm-project/llvm/lib/Analysis/LoopCacheAnalysis.cpp
353 warn V612 An unconditional 'return' within a loop.
/home/xbolva00/LLVM/llvm-project/llvm/lib/Analysis/LoopCacheAnalysis.cpp
456 err V502 Perhaps the '?:' operator works in a different way than it
was expected. The '?:' operator has a lower priority than the '=='
operator.
Authored By:etiotto
Reviewer:Meinersbur, kbarton, bmahjour, Whitney, xbolva00
Reviewed By:xbolva00
Subscribers:hiraditya, llvm-commits
Tag:LLVM
Differential Revision:https://reviews.llvm.org/D69821

4 years ago[X86] Handle MO_ConstantPoolIndex in X86AsmPrinter::PrintOperand
Craig Topper [Sun, 10 Nov 2019 01:58:56 +0000 (17:58 -0800)]
[X86] Handle MO_ConstantPoolIndex in X86AsmPrinter::PrintOperand

Fixes PR43952

4 years agoTry to fix sphinx "Could not lex literal_block as "llvm"" warning.
Simon Pilgrim [Sat, 9 Nov 2019 22:15:26 +0000 (22:15 +0000)]
Try to fix sphinx "Could not lex literal_block as "llvm"" warning.

Code block isn't IR - so treat it as "none" instead.

4 years agoYAMLParser - fix SimpleKey uninitialized variable warnings. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 22:11:50 +0000 (22:11 +0000)]
YAMLParser - fix SimpleKey uninitialized variable warnings. NFCI.

4 years agoReduce scope of variable to silence cppcheck warning. NFC
Simon Pilgrim [Sat, 9 Nov 2019 22:10:09 +0000 (22:10 +0000)]
Reduce scope of variable to silence cppcheck warning. NFC

4 years agoRegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 18:38:19 +0000 (18:38 +0000)]
RegisterCoalescer - remove duplicate variable to fix Wshadow warning. NFCI.

4 years agoRegisterCoalescer - fix uninitialized variables. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 18:16:07 +0000 (18:16 +0000)]
RegisterCoalescer - fix uninitialized variables. NFCI.

4 years ago[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)
Gil Rapaport [Mon, 7 Oct 2019 14:24:33 +0000 (17:24 +0300)]
[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)

This recommits 11ed1c0239fd51fd2f064311dc7725277ed0a994 (reverted in
9f08ce0d2197d4f163dfa4633eae2347ce8fc881 for failing an assert) with a fix:
tryToWidenMemory() now first checks if the widening decision is to interleave,
thus maintaining previous behavior where tryToInterleaveMemory() was called
first, giving priority to interleave decisions over widening/scalarization. This
commit adds the test case that exposed this bug as a LIT.

4 years ago[lldb] [test] Un-XFAIL tests that work on NetBSD 9
Michał Górny [Sat, 9 Nov 2019 18:40:31 +0000 (19:40 +0100)]
[lldb] [test] Un-XFAIL tests that work on NetBSD 9

4 years agoFix variable ‘LookedUpGetterSetter’ set but not used warning. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 17:23:53 +0000 (17:23 +0000)]
Fix variable ‘LookedUpGetterSetter’ set but not used warning. NFCI.

4 years agoFixed dia file
Dávid Bolvanský [Sat, 9 Nov 2019 17:31:17 +0000 (18:31 +0100)]
Fixed dia file

4 years agoFixed c-index test
Dávid Bolvanský [Sat, 9 Nov 2019 17:26:21 +0000 (18:26 +0100)]
Fixed c-index test

4 years agoFixed more -Wreturn-type tests
Dávid Bolvanský [Sat, 9 Nov 2019 17:13:34 +0000 (18:13 +0100)]
Fixed more -Wreturn-type tests

4 years agoFix uninitialized variable warnings. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 17:02:51 +0000 (17:02 +0000)]
Fix uninitialized variable warnings. NFCI.

4 years agoFix shadow variable warning with llvm::SrcMgr. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 17:01:32 +0000 (17:01 +0000)]
Fix shadow variable warning with llvm::SrcMgr. NFCI.

4 years agoFix operator precedence warning. NFC.
Simon Pilgrim [Sat, 9 Nov 2019 16:37:20 +0000 (16:37 +0000)]
Fix operator precedence warning. NFC.

4 years ago[Diagnostics] Try to improve warning message for -Wreturn-type
Dávid Bolvanský [Sat, 9 Nov 2019 15:15:53 +0000 (16:15 +0100)]
[Diagnostics] Try to improve warning message for -Wreturn-type

Summary: I agree with https://easyaspi314.github.io/gcc-vs-clang.html?fbclid=IwAR1VA0qxiWVUusOQUv5z7JESS7ZpeJy-UqAI5mnJscofGLqXcqeErIUB2gU, current warning message is not very good. We should try to improve it..

Reviewers: rsmith, aaron.ballman, easyaspi314

Reviewed By: aaron.ballman

Subscribers: arphaman, Quuxplusone, mehdi_amini, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years agoRevert "[BPF] Add preserve_access_index attribute for record definition"
Yonghong Song [Sat, 9 Nov 2019 16:32:44 +0000 (08:32 -0800)]
Revert "[BPF] Add preserve_access_index attribute for record definition"

This reverts commit 4a5aa1a7bf8b1714b817ede8e09cd28c0784228a.

There are some other test failures. Investigate them first.

4 years ago[BPF] Add preserve_access_index attribute for record definition
Yonghong Song [Sat, 2 Nov 2019 05:16:59 +0000 (22:16 -0700)]
[BPF] Add preserve_access_index attribute for record definition

This patch introduced a new bpf specific attribute which can
be added to struct or union definition. For example,
  struct s { ... } __attribute__((preserve_access_index));
  union u { ... } __attribute__((preserve_access_index));
The goal is to simplify user codes for cases
where preserve access index happens for certain struct/union,
so user does not need to use clang __builtin_preserve_access_index
for every members.

The attribute has no effect if -g is not specified.

When the attribute is specified and -g is specified, any member
access defined by that structure or union, including array subscript
access and inner records, will be preserved through
  __builtin_preserve_{array,struct,union}_access_index()
IR intrinsics, which will enable relocation generation
in bpf backend.

The following is an example to illustrate the usage:
  -bash-4.4$ cat t.c
  #define __reloc__ __attribute__((preserve_access_index))
  struct s1 {
    int c;
  } __reloc__;

  struct s2 {
    union {
      struct s1 b[3];
    };
  } __reloc__;

  struct s3 {
    struct s2 a;
  } __reloc__;

  int test(struct s3 *arg) {
    return arg->a.b[2].c;
  }
  -bash-4.4$ clang -target bpf -g -S -O2 t.c

A relocation with access string "0:0:0:0:2:0" will be generated
representing access offset of arg->a.b[2].c.

forward declaration with attribute is also handled properly such
that the attribute is copied and populated in real record definition.

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

4 years ago[libc++] Validate the entire regex is consumed
Mark de Wever [Sat, 9 Nov 2019 16:01:37 +0000 (17:01 +0100)]
[libc++] Validate the entire regex is consumed

This change would have warned about the bug found in D62451.
No unit tests since the exception should never throw.

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

4 years ago[Parser] Warn when ScopeDepthOrObjCQuals overflows
Mark de Wever [Sat, 9 Nov 2019 14:32:35 +0000 (15:32 +0100)]
[Parser] Warn when ScopeDepthOrObjCQuals overflows

Before when the overflow occured an assertion was triggered. Now check
whether the maximum has been reached and warn properly.

This patch fixes the original submission of PR19607.

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

4 years ago[NFC] Supress GCC "Bitfield too small to hold all values of enum" warning.
Richard Smith [Sat, 9 Nov 2019 13:52:18 +0000 (05:52 -0800)]
[NFC] Supress GCC "Bitfield too small to hold all values of enum" warning.

Patch by Wang Tianqing!

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

4 years agoFix builds where LLVM_ENABLE_STATS is disabled
Simon Pilgrim [Sat, 9 Nov 2019 13:47:53 +0000 (13:47 +0000)]
Fix builds where LLVM_ENABLE_STATS is disabled

Missed Stats->EnableStats rename in rG3fb832fe8bdc317687d5a4d2ca20f5f73b089341

4 years agollvm-exegesis - fix shadow variable warnings. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 13:43:09 +0000 (13:43 +0000)]
llvm-exegesis - fix shadow variable warnings. NFCI.

4 years agoRemarks - fix static analyzer warnings. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 13:00:36 +0000 (13:00 +0000)]
Remarks - fix static analyzer warnings. NFCI.
 - Fix uninitialized variable warnings.
 - Reuse BitstreamEntry iterator to avoid Wshadow warning.
 - Match declaration + definition arg names in BitstreamRemarkParser::processCommonMeta
 - Make BitstreamRemarkParser(StringRef) constructor explicit

4 years agoRemove duplicate MemVT to fix shadow variable warning. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 12:56:24 +0000 (12:56 +0000)]
Remove duplicate MemVT to fix shadow variable warning. NFCI.

4 years agoStatistic - Fix shadow variable warning. NFCI.
Simon Pilgrim [Sat, 9 Nov 2019 12:50:25 +0000 (12:50 +0000)]
Statistic - Fix shadow variable warning. NFCI.

Rename option 'Stats' to 'EnableStats' and prevent clash with StatisticInfo::Stats member

4 years agoRemove superfluous break after return. NFC.
Simon Pilgrim [Fri, 8 Nov 2019 22:38:19 +0000 (22:38 +0000)]
Remove superfluous break after return. NFC.

4 years agoFix shadow variable warning by reducing scope of CC/InverseCC CondCodes. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 22:37:11 +0000 (22:37 +0000)]
Fix shadow variable warning by reducing scope of CC/InverseCC CondCodes. NFCI.

4 years agoRemarks - fix shadow variable warnings. NFCI.
Simon Pilgrim [Fri, 8 Nov 2019 22:30:12 +0000 (22:30 +0000)]
Remarks - fix shadow variable warnings. NFCI.

Avoid conflict with llvm::remarks::Magic global variable.

4 years ago[cxx_status] Update with Belfast motions.
Richard Smith [Sat, 9 Nov 2019 09:17:57 +0000 (01:17 -0800)]
[cxx_status] Update with Belfast motions.

4 years agoRefactor SimplifySelectsFeedingBinaryOp for D64713. NFC.
Jay Foad [Fri, 8 Nov 2019 23:08:24 +0000 (23:08 +0000)]
Refactor SimplifySelectsFeedingBinaryOp for D64713. NFC.

4 years ago[Diagnostics] Fixed crash with non pointer type (PR43950)
Dávid Bolvanský [Sat, 9 Nov 2019 08:02:40 +0000 (09:02 +0100)]
[Diagnostics] Fixed crash with non pointer type (PR43950)

4 years ago[analyzer] Fix skipping the call during inlined defensive check suppression.
Artem Dergachev [Sat, 9 Nov 2019 02:06:40 +0000 (18:06 -0800)]
[analyzer] Fix skipping the call during inlined defensive check suppression.

When bugreporter::trackExpressionValue() is invoked on a DeclRefExpr,
it tries to do most of its computations over the node in which
this DeclRefExpr is computed, rather than on the error node (or whatever node
is stuffed into it). One reason why we can't simply use the error node is
that the binding to that variable might have already disappeared from the state
by the time the bug is found.

In case of the inlined defensive checks visitor, the DeclRefExpr node
is in fact sometimes too *early*: the call in which the inlined defensive check
has happened might have not been entered yet.

Change the visitor to be fine with tracking dead symbols (which it is totally
capable of - the collapse point for the symbol is still well-defined), and fire
it up directly on the error node. Keep using "LVState" to find out which value
should we be tracking, so that there weren't any problems with accidentally
loading an ill-formed value from a dead variable.

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

4 years ago[analyzer] Nullability: Don't infer nullable when passing as nullable parameter.
Artem Dergachev [Sat, 9 Nov 2019 02:04:27 +0000 (18:04 -0800)]
[analyzer] Nullability: Don't infer nullable when passing as nullable parameter.

You can't really infer anything from that.

4 years agoTemporarily change the default for use-g-packet-for-reading to false,
Jason Molenda [Sat, 9 Nov 2019 02:20:27 +0000 (18:20 -0800)]
Temporarily change the default for use-g-packet-for-reading to false,
until we can automatically fall back to p/P if g/G are not supported;
it looks like there is a bug in debugserver's g/G packets taht needs
to be fixed, or debugserver should stop supporting g/G until that bug
is fixed.  But we need lldb to be able to fall back to p/P correctly
for that to be a viable workaround.

4 years agoRevert "Add a testcase for .dSYM path remapping dictionaries."
Jonas Devlieghere [Sat, 9 Nov 2019 02:16:44 +0000 (18:16 -0800)]
Revert "Add a testcase for .dSYM path remapping dictionaries."

This reverts commit 2bbc4fdd8fa0ed58d610ab6260cb664c7cfef204.

4 years ago[clang][IFS][test] Fixing buildbot test fails for clang-ifs.
Puyan Lotfi [Sat, 9 Nov 2019 02:06:23 +0000 (21:06 -0500)]
[clang][IFS][test] Fixing buildbot test fails for clang-ifs.

Checking for the exact triple fails on many bots. Leaving the triple
check blank.

4 years ago[clang][IFS] Adds support for more decl types in clang interface stubs.
Puyan Lotfi [Sat, 9 Nov 2019 01:21:28 +0000 (20:21 -0500)]
[clang][IFS] Adds support for more decl types in clang interface stubs.

Adding support for processing the following Decls: NonTypeTemplateParmDecl,
CXXConversionDecl, UnresolvedUsingValueDecl, UsingDecl, UsingShadowDecl,
TypeAliasTemplateDecl, TypeAliasDecl, VarTemplateDecl,
VarTemplateSpecializationDecl, UsingDirectiveDecl, TemplateTemplateParmDecl,
ClassTemplatePartialSpecializationDecl, IndirectFieldDecl.

Also, this allows for processing NamedDecls that don't have an identifier and
skips over VarDecls that are dependent on template types.

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

4 years agoThinLTO : Import always_inline functions irrespective of the threshold
Teresa Johnson [Fri, 8 Nov 2019 23:50:55 +0000 (15:50 -0800)]
ThinLTO : Import always_inline functions irrespective of the threshold

Summary: A user can force a function to be inlined by specifying the always_inline attribute. Currently, thinlto implementation is not aware of always_inline functions and does not guarantee import of such functions, which in turn can prevent inlining of such functions.

Patch by Bharathi Seshadri <bseshadr@cisco.com>

Reviewers: tejohnson

Reviewed By: tejohnson

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years agoTest case to verify that lldb falls back to p/P if g is unsupported
Jason Molenda [Fri, 8 Nov 2019 23:55:46 +0000 (15:55 -0800)]
Test case to verify that lldb falls back to p/P if g is unsupported
and that lldb uses the expedited register values in the ? packet
aka stop packet (T11 etc) and does not re-fetch them with the p packet.

This test is currently failing from the "[lldb-server] Add setting to
force 'g' packet use" commit; I'm marking it as @expectedFailureAll
until we can get this fixed.

4 years agoDebugInfo: Remove redundant conditionals/checks from macro info emission
David Blaikie [Fri, 8 Nov 2019 23:31:15 +0000 (15:31 -0800)]
DebugInfo: Remove redundant conditionals/checks from macro info emission

These checks fall out naturally from the current implementation without
needing to be explicitly considered anymore.

4 years agoDebugInfo: Do not create a debug_macinfo section if no CUs have associated macros
David Blaikie [Fri, 8 Nov 2019 23:26:17 +0000 (15:26 -0800)]
DebugInfo: Do not create a debug_macinfo section if no CUs have associated macros

Patch based on Sourabh Singh's D69839 patch.

4 years agollvm-ranlib/nm: Don't print usage message except for usage errors
Sam Clegg [Fri, 8 Nov 2019 19:13:10 +0000 (11:13 -0800)]
llvm-ranlib/nm: Don't print usage message except for usage errors

Also, fix a bug in ranlib where it didn't correctly detect being run
without any argument and would try to operate on the empty string.

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

4 years agoNVPTX: Don't insert an extra empty line at the end of the last section.
David Blaikie [Fri, 8 Nov 2019 23:14:58 +0000 (15:14 -0800)]
NVPTX: Don't insert an extra empty line at the end of the last section.

This was arbitrarily appearing in only the last section emitted - which
made tests more sensitive than they needed to be (removing the last
section - like the macinfo section change that's coming after this)
would, surprisingly, move the blank line to the previous section.

4 years agoDebug Info: Nest Objective-C property function decls inside their container.
Adrian Prantl [Fri, 8 Nov 2019 17:24:31 +0000 (09:24 -0800)]
Debug Info: Nest Objective-C property function decls inside their container.

This has the nice side-effect of also fixing a crash in Clang.

Starting with DWARF 5 we are emitting ObjC method declarations as
children of their containing entity. This worked for interfaces, but
didn't consider the case of synthessized properties. When a property
of a protocol is synthesized in an interface implementation the
ObjCMethodDecl that was passed to CGF::StartFunction was the property
*declaration* which obviously couldn't have a containing
interface. This patch passes the containing interface all the way
through to CGDebugInfo, so the function declaration can be created
with the correct parent (= the class implementing the protocol).

rdar://problem/53782400

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

4 years ago[clangd] NFC, reuse the source manager variable in the RawStringLiteral apply method
Alex Lorenz [Fri, 8 Nov 2019 22:50:26 +0000 (14:50 -0800)]
[clangd] NFC, reuse the source manager variable in the RawStringLiteral apply method

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

4 years ago[MC] Emit unused undefined symbol even if its binding is not set
Fangrui Song [Sun, 29 Sep 2019 15:26:12 +0000 (15:26 +0000)]
[MC] Emit unused undefined symbol even if its binding is not set

Recommit r373168, which was reverted by r373242. This actually exposed a
boringssl bug which has been fixed for more than one month.

For the following two cases, we currently suppress the symbols. This
patch emits them (compatible with GNU as).

* `test2_a = undef`: if `undef` is otherwise unused.
* `.hidden hidden`: if `hidden` is unused. This is the main point of the
  patch, because omitting the symbol would cause a linker semantic
  difference.

It causes a behavior change that is not compatible with GNU as:

.weakref foo1, bar1

When neither foo1 nor bar1 is used, we now emit bar1, which is arguably
more consistent.

Another change is that we will emit .TOC. for .TOC.@tocbase .  For this
directive, suppressing .TOC. can be seen as a size optimization, but we
choose to drop it for simplicity and consistency.

4 years ago[www] More HTTPS and outdated link fixes.
Stephan T. Lavavej [Fri, 8 Nov 2019 02:04:55 +0000 (18:04 -0800)]
[www] More HTTPS and outdated link fixes.

Resolves D69981.

4 years agoclang-format: refresh the list of options
Sylvestre Ledru [Fri, 8 Nov 2019 22:39:27 +0000 (23:39 +0100)]
clang-format: refresh the list of options

4 years agoReland "[compiler-rt] Fix tests after 03b84e4f6d0"
Jan Korous [Fri, 8 Nov 2019 22:17:09 +0000 (14:17 -0800)]
Reland "[compiler-rt] Fix tests after 03b84e4f6d0"

This reverts commit d6be9273c6035c07b25dd1494f76cd61d523b878.

4 years agoRevert "Reland "[clang] Report sanitizer blacklist as a dependency in cc1""
Jan Korous [Fri, 8 Nov 2019 22:16:15 +0000 (14:16 -0800)]
Revert "Reland "[clang] Report sanitizer blacklist as a dependency in cc1""

This reverts commit cae4a28864f4e8a55920e2b94e2cd43617902dec.

4 years agoclang-format: Add to the release notes the new --dry-run/-n option
Sylvestre Ledru [Fri, 8 Nov 2019 22:26:29 +0000 (23:26 +0100)]
clang-format: Add to the release notes the new --dry-run/-n option

4 years agoRevert "Reapply "Fix crash on switch conditions of non-integer types in templates""
Melanie Blower [Fri, 8 Nov 2019 22:18:15 +0000 (14:18 -0800)]
Revert "Reapply "Fix crash on switch conditions of non-integer types in templates""

This reverts commit 759948467ea3181615d44d80f74ffeb260180fd0.
There were build bot failures in clang-tidy

4 years ago[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (3) (baseli...
joanlluch [Fri, 8 Nov 2019 22:16:44 +0000 (23:16 +0100)]
[TargetLowering][DAGCombine][MSP430] Shift Amount Threshold in DAGCombine (3) (baseline tests)

Summary:
This is baseline tests for D69326

Incorporates a command line flag for the MSP430 and adds a test cases to help showing the effects of applying D69326

More details and motivation for this patch in D69326

Reviewers: spatel, asl, lebedev.ri

Reviewed By: spatel, asl

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoDon't attempt to upgrade debug-info-tests to Python3.
Adrian Prantl [Fri, 8 Nov 2019 22:09:40 +0000 (14:09 -0800)]
Don't attempt to upgrade debug-info-tests to Python3.

There was CMake code that would attempt to detect Python 3 even if
LLVM was configured with Python 2, but it messed with the environment
for the other LLVM projects. This commit removes this functionality
and just lkeaves a hard error if Python < 3 is detected and
debuginfo-tests are required.

4 years agoAdd a testcase for .dSYM path remapping dictionaries.
Adrian Prantl [Fri, 8 Nov 2019 22:05:45 +0000 (14:05 -0800)]
Add a testcase for .dSYM path remapping dictionaries.

rdar://problem/56924558

4 years agoBasic: fix FileManager invalidation issue for file redirect
Alex Suhan [Fri, 8 Nov 2019 21:37:13 +0000 (16:37 -0500)]
Basic: fix FileManager invalidation issue for file redirect

Insertion into SeenFileEntries can invalidate iterators, we need to do
another lookup on the re-intern path.

4 years ago[llvm-xray] Add basic test for AArch64 support
Shoaib Meenai [Fri, 8 Nov 2019 21:55:00 +0000 (13:55 -0800)]
[llvm-xray] Add basic test for AArch64 support

Based on a test provided by Ian Levesque <ianlevesque@fb.com>.

4 years ago[clang] Fix -fsanitize-system-blacklist processing in cc1
Jan Korous [Fri, 8 Nov 2019 21:56:37 +0000 (13:56 -0800)]
[clang] Fix -fsanitize-system-blacklist processing in cc1

4 years agoReland "[clang] Report sanitizer blacklist as a dependency in cc1"
Jan Korous [Fri, 8 Nov 2019 21:55:00 +0000 (13:55 -0800)]
Reland "[clang] Report sanitizer blacklist as a dependency in cc1"

This reverts commit 3182027282c59c51d5080d83365917fccd695854.

4 years agoReland "[clang] Report sanitizer blacklist as a dependency in cc1"
Jan Korous [Fri, 8 Nov 2019 21:54:28 +0000 (13:54 -0800)]
Reland "[clang] Report sanitizer blacklist as a dependency in cc1"

This reverts commit 9b8413ac6e56e7a6e0ba884773d13bcf9414bd43.

4 years agoDebugInfo: Use separate macinfo contributions for each CU
David Blaikie [Fri, 8 Nov 2019 20:56:49 +0000 (12:56 -0800)]
DebugInfo: Use separate macinfo contributions for each CU

The macinfo support was broken for LTO situations, by terminating
macinfo lists only once - multiple macinfo contributions were correctly
labeled, but they all continued/flowed into later contributions until
only one terminator appeared at the end of the section.

Correctly terminate each contribution & fix the parsing to handle this
situation too. The parsing fix is also necessary for dumping linked
binaries - the previous code would stop at the end of the first
contribution - missing all later contributions in a linked binary.

It'd be nice to improve the dumping to print the offsets of each
contribution so it'd be easier to know which CU AT_macro_info refers to
which macinfo contribution.

4 years ago[clang-format] NFC allow Format.h to be clang-formatted but still maintain the same...
paul_hoad [Fri, 8 Nov 2019 21:12:22 +0000 (21:12 +0000)]
[clang-format] NFC allow Format.h to be clang-formatted but still maintain the same doc layout in ClangFormatStyleOptions.rst

Summary:
Format.h is used to generate ClangFormatStyleOptions.rst, the layout of the comments is critical to the rst file. Accidentally clang-formatting Format.h can lead to the .rst changing.

This revision simply add // clang-format off/on statement around the areas who formatting needs to be maintained, mainly around the options that are related to what happens when the line breaks due to `ColumnLimit` (which is what is happening to the comment)

This allows Format.h to be clang-formatted without causing a change in the documentation when dump_format_style.py is rerun, which is also part of the revision.

Reviewers: mitchell-stellar, klimek, sammccall, owenpan

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang, #clang-format

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

4 years agogn build: Merge f0af11d86f8
LLVM GN Syncbot [Fri, 8 Nov 2019 20:48:12 +0000 (20:48 +0000)]
gn build: Merge f0af11d86f8

4 years ago [DDG] Data Dependence Graph - Pi Block
bmahjour [Fri, 8 Nov 2019 20:05:06 +0000 (15:05 -0500)]
[DDG] Data Dependence Graph - Pi Block

    Summary:
    This patch adds Pi Blocks to the DDG. A pi-block represents a group of DDG
    nodes that are part of a strongly-connected component of the graph.
    Replacing all the SCCs with pi-blocks results in an acyclic representation
    of the DDG. For example if we have:
       {a -> b}, {b -> c, d}, {c -> a}
    the cycle a -> b -> c -> a is abstracted into a pi-block "p" as follows:
       {p -> d} with "p" containing: {a -> b}, {b -> c}, {c -> a}
    In this implementation the edges between nodes that are part of the pi-block
    are preserved. The crossing edges (edges where one end of the edge is in the
    set of nodes belonging to an SCC and the other end is outside that set) are
    replaced with corresponding edges to/from the pi-block node instead.

    Authored By: bmahjour

    Reviewer: Meinersbur, fhahn, myhsu, xtian, dmgreen, kbarton, jdoerfert

    Reviewed By: Meinersbur

    Subscribers: ychen, arphaman, simoll, a.elovikov, mgorny, hiraditya, jfb, wuzish, llvm-commits, jsji, Whitney, etiotto, ppc-slack

    Tag: #llvm

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

4 years ago[AArch64][X86] Don't assume __powidf2 is available on Windows.
Eli Friedman [Thu, 31 Oct 2019 19:06:18 +0000 (12:06 -0700)]
[AArch64][X86] Don't assume __powidf2 is available on Windows.

We had some code for this for 32-bit ARM, but this doesn't really need
to be in target-specific code; generalize it.

(I think this started showing up recently because we added an
optimization that converts pow to powi.)

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

4 years agoRevert "[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)"
Gil Rapaport [Fri, 8 Nov 2019 20:14:31 +0000 (22:14 +0200)]
Revert "[LV] Apply sink-after & interleave-groups as VPlan transformations (NFCI)"

This reverts commit 11ed1c0239fd51fd2f064311dc7725277ed0a994 - causes an assert failure.

4 years ago[ELF] Fix stack-use-after-scope after D69592 and 69650
Fangrui Song [Fri, 8 Nov 2019 19:19:03 +0000 (11:19 -0800)]
[ELF] Fix stack-use-after-scope after D69592 and 69650

4 years agoReapply [LVI] Normalize pointer behavior
Nikita Popov [Fri, 8 Nov 2019 17:23:01 +0000 (18:23 +0100)]
Reapply [LVI] Normalize pointer behavior

Fix cache invalidation by not guarding the dereferenced pointer cache
erasure by SeenBlocks. SeenBlocks is only populated when actually
caching a value in the block, which doesn't necessarily have to happen
just because dereferenced pointers were calculated.

-----

Related to D69686. As noted there, LVI currently behaves differently
for integer and pointer values: For integers, the block value is always
valid inside the basic block, while for pointers it is only valid at
the end of the basic block. I believe the integer behavior is the
correct one, and CVP relies on it via its getConstantRange() uses.

The reason for the special pointer behavior is that LVI checks whether
a pointer is dereferenced in a given basic block and marks it as
non-null in that case. Of course, this information is valid only after
the dereferencing instruction, or in conservative approximation,
at the end of the block.

This patch changes the treatment of dereferencability: Instead of
including it inside the block value, we instead treat it as something
similar to an assume (it essentially is a non-nullness assume) and
incorporate this information in intersectAssumeOrGuardBlockValueConstantRange()
if the context instruction is the terminator of the basic block.
This happens either when determining an edge-value internally in LVI,
or when a terminator was explicitly passed to getValueAt(). The latter
case makes this change not fully NFC, because we can now fold
terminator icmps based on the dereferencability information in the
same block. This is the reason why I changed one JumpThreading test
(it would optimize the condition away without the change).

Of course, we do not want to recompute dereferencability on each
intersectAssume call, so we need a new cache for this. The
dereferencability analysis requires walking the entire basic block
and computing underlying objects of all memory operands. This was
previously done separately for each queried pointer value. In the
new implementation (both because this makes the caching simpler,
and because it is faster), I instead only walk the full BB once and
cache all the dereferenced pointers. So the traversal is now performed
only once per BB, instead of once per queried pointer value.

I think the overall model now makes more sense than before, and there
will be no more pitfalls due to differing integer/pointer behavior.

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