Changes

Summary

  1. jenkins/tasks: virtualenv: Use the Python3 interpreter (details)
Commit 92122d159f7294fc3534d16354385cd42837ff4c by Azharuddin Mohammed
jenkins/tasks: virtualenv: Use the Python3 interpreter
The file was modifiedtasks/utils/venv.sh (diff)

Summary

  1. [HIP] Fix spack detection (details)
  2. Make `mlir::OpState::operator bool` explicit (details)
  3. [HWASan] Don't build alias mode on non-x86. (details)
  4. [LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition. (details)
  5. [LLDB] Switch from using member_clang_type.GetByteSize() to member_type->GetByteSize() in ParseSingleMember (details)
  6. [NewPM] Add C bindings for new pass manager (details)
  7. Reset the wakeup timeout when we re-enter the continue wait. (details)
  8. Revert "[NewPM] Add C bindings for new pass manager" (details)
  9. [Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable (details)
  10. [analyzer] Engine: fix crash with SEH __leave keyword (details)
  11. Merge with mainline. (details)
  12. [lld/mac] Honor REFERENCED_DYAMICALLY, set it on __mh_execute_header (details)
  13. [mlir][sparse] replace experimental flag with inplace attribute (details)
  14. [NewPM] Add C bindings for new pass manager (details)
  15. Add type function for ConstShape op. (details)
  16. gn build: Only build the hwasan runtime in aliasing mode on x86. (details)
  17. [AArch64] Support customizing stack protector guard (details)
  18. [InstCombine] add tests for fneg-of-select; NFC (details)
  19. [InstCombine] fold fnegs around select (details)
  20. [gn build] Port 0c557db61711 (details)
Commit 18cb17ce4cd54b9971550840b6f0b872de0d4c8c by Yaxun.Liu
[HIP] Fix spack detection

Missing or duplicate spack package should not cause error, since
users may only installed llvm/clang package, or users may installed
duplicate HIP package but will use environment variable or compiler
option to choose HIP path.

The message about missing or duplicate spack package is informational,
therefore should be emitted only when -v is specified.

Reviewed by: Artem Belevich

Differential Revision: https://reviews.llvm.org/D102556
The file was modifiedclang/lib/Driver/ToolChains/ROCm.h
The file was modifiedclang/lib/Driver/ToolChains/AMDGPU.cpp
The file was modifiedclang/test/Driver/rocm-detect.hip
Commit 43f6e04258aaece5b45c18986e0e6c3e690fa82e by joker.eph
Make `mlir::OpState::operator bool` explicit

This change makes the conversion of an mlir::OpState to bool `explicit`. Idiomatic boolean uses continue to work as before, but questionable implicit uses (e.g. accumulating over a range of OpStates to count "true" states) become ill-formed. This makes the class interface a lilttle less error-prone.

I tested this change on our internal (fairly large) codebase, and only one fix was needed, which was ultimately an improvement of the affected code.

Reviewed By: rriddle, mehdi_amini

Differential Revision: https://reviews.llvm.org/D101989
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit d97bab65118558ec8376749529338477b5768866 by mascasa
[HWASan] Don't build alias mode on non-x86.

Alias mode is not expected work on non-x86, so don't build it there.
Should fix the aarch64 bot.
The file was modifiedcompiler-rt/lib/hwasan/CMakeLists.txt
Commit 0633d5ce7bd9339228d301d4b1ee49fbd0a78b56 by lebedev.ri
[LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition.

I think i've added exhaustive test coverage, and i have verified that alive2 is happy with all the tests,
so in principle i'm fine with landing this without review, but just in case..

This adds support for the "count active bits" pattern, i.e.:
```
int countActiveBits(unsigned val) {
    int cnt = 0;
    for( ; (val >> cnt) != 0; ++cnt)
        ;
    return cnt;
}
```
but a somewhat more general one, since that is what i need:
```
int countActiveBits(unsigned val, int start, int off) {
    int cnt;
    for (cnt = start; val >> (cnt + off); cnt++)
        ;
    return cnt;
}
```

I've followed in footstep of 'left-shift until bittest' idiom (D91038),
in the sense that iff the `ctlz` intrinsic is cheap, we'll transform,
regardless of all other factors.

This can have a shocking effect on certain benchmarks:
```
raw.pixls.us-unique/Olympus/XZ-1$ /repositories/googlebenchmark/tools/compare.py -a benchmarks ~/rawspeed/build-{old,new}/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf
RUNNING: /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmp49_28zcm
2021-05-09T01:06:05+03:00
Running /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench
Run on (32 X 3600.24 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x16)
  L1 Instruction 32 KiB (x16)
  L2 Unified 512 KiB (x16)
  L3 Unified 32768 KiB (x2)
Load Average: 5.26, 6.29, 3.49
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Benchmark                                                      Time             CPU   Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
p1319978.orf/threads:32/process_time/real_time_mean          145 ms          145 ms          128   0.145319         0.999981   10.1568M       69.8949M        69.8936M      6.88159       6.88146   0.145322
p1319978.orf/threads:32/process_time/real_time_median        145 ms          145 ms          128   0.145317         0.999986   10.1568M       69.8941M        69.8931M      6.88151       6.88141   0.145319
p1319978.orf/threads:32/process_time/real_time_stddev      0.766 ms        0.766 ms          128   766.586u         15.1302u          0       354.167k        354.098k    0.0348699     0.0348631   766.469u
RUNNING: /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench --benchmark_counters_tabular=true --benchmark_min_time=0.00000001 --benchmark_repetitions=128 p1319978.orf --benchmark_display_aggregates_only=true --benchmark_out=/tmp/tmpwb9sw2x0
2021-05-09T01:06:24+03:00
Running /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench
Run on (32 X 3599.95 MHz CPU s)
CPU Caches:
  L1 Data 32 KiB (x16)
  L1 Instruction 32 KiB (x16)
  L2 Unified 512 KiB (x16)
  L3 Unified 32768 KiB (x2)
Load Average: 4.05, 5.95, 3.43
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Benchmark                                                      Time             CPU   Iterations  CPUTime,s CPUTime/WallTime     Pixels Pixels/CPUTime Pixels/WallTime Raws/CPUTime Raws/WallTime WallTime,s
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
p1319978.orf/threads:32/process_time/real_time_mean         99.8 ms         99.8 ms          128  0.0997758         0.999972   10.1568M       101.797M        101.794M      10.0225       10.0222  0.0997786
p1319978.orf/threads:32/process_time/real_time_median       99.7 ms         99.7 ms          128  0.0997165         0.999985   10.1568M       101.857M        101.854M      10.0284       10.0281  0.0997195
p1319978.orf/threads:32/process_time/real_time_stddev      0.224 ms        0.224 ms          128   224.166u          34.345u          0        226.81k        227.231k    0.0223309     0.0223723   224.586u
Comparing /home/lebedevri/rawspeed/build-old/src/utilities/rsbench/rsbench to /home/lebedevri/rawspeed/build-new/src/utilities/rsbench/rsbench
Benchmark                                                               Time             CPU      Time Old      Time New       CPU Old       CPU New
----------------------------------------------------------------------------------------------------------------------------------------------------
p1319978.orf/threads:32/process_time/real_time_pvalue                 0.0000          0.0000      U Test, Repetitions: 128 vs 128
p1319978.orf/threads:32/process_time/real_time_mean                  -0.3134         -0.3134           145           100           145           100
p1319978.orf/threads:32/process_time/real_time_median                -0.3138         -0.3138           145           100           145           100
p1319978.orf/threads:32/process_time/real_time_stddev                -0.7073         -0.7078             1             0             1             0

```

Reviewed By: craig.topper, zhuhan0

Differential Revision: https://reviews.llvm.org/D102116
The file was modifiedllvm/test/Transforms/LoopIdiom/X86/logical-right-shift-until-zero-debuginfo.ll
The file was modifiedllvm/lib/Transforms/Scalar/LoopIdiomRecognize.cpp
The file was modifiedllvm/test/Transforms/LoopIdiom/X86/logical-right-shift-until-zero.ll
Commit 2182eda3062471e2e6994307c46ffcca7e39ecff by Shafik Yaghmour
[LLDB] Switch from using member_clang_type.GetByteSize() to member_type->GetByteSize() in ParseSingleMember

We have a bug in which using member_clang_type.GetByteSize() triggers record
layout and during this process since the record was not yet complete we ended
up reaching a record that had not been layed out yet.
Using member_type->GetByteSize() avoids this situation since it relies on size
from DWARF and will not trigger record layout.

For reference: rdar://77293040

Differential Revision: https://reviews.llvm.org/D102445
The file was modifiedlldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
Commit cd220a06782c3da13a53de2fdf10d928eef6460c by aeubanks
[NewPM] Add C bindings for new pass manager

This patch contains the bare minimum to run the new Pass Manager from the LLVM-C APIs. It does not feature PGOOptions, PassPlugins or Debugify in its current state. Bugzilla: PR48499

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D102136
The file was modifiedllvm/unittests/Passes/CMakeLists.txt
The file was modifiedllvm/lib/Passes/CMakeLists.txt
The file was addedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
The file was addedllvm/lib/Passes/PassBuilderBindings.cpp
The file was addedllvm/include/llvm-c/Transforms/PassBuilder.h
Commit bd5751f3d249ec0798060bd98c07272174c52af0 by jingham
Reset the wakeup timeout when we re-enter the continue wait.

Differential Revision: https://reviews.llvm.org/D102562
The file was modifiedlldb/source/Plugins/Process/gdb-remote/GDBRemoteClientBase.cpp
Commit 0b339778722207528ad7299b0fc77314c26efb33 by thakis
Revert "[NewPM] Add C bindings for new pass manager"

This reverts commit cd220a06782c3da13a53de2fdf10d928eef6460c.
Doesn't build.
The file was removedllvm/lib/Passes/PassBuilderBindings.cpp
The file was modifiedllvm/unittests/Passes/CMakeLists.txt
The file was removedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
The file was modifiedllvm/lib/Passes/CMakeLists.txt
The file was removedllvm/include/llvm-c/Transforms/PassBuilder.h
Commit 14dfb3831c425c7f22540a2160424224008c257e by aeubanks
[Clang] -Wunused-but-set-parameter and -Wunused-but-set-variable

These are intended to mimic warnings available in gcc.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D100581
The file was modifiedclang/include/clang/Basic/DiagnosticGroups.td
The file was modifiedclang/test/Sema/vector-gcc-compat.cpp
The file was addedclang/test/SemaCXX/warn-unused-but-set-variables-cpp.cpp
The file was modifiedclang/include/clang/Basic/DiagnosticSemaKinds.td
The file was modifiedclang/test/CodeGen/2007-10-30-Volatile.c
The file was modifiedclang/test/SemaCXX/shift.cpp
The file was modifiedclang/lib/Sema/SemaExpr.cpp
The file was modifiedclang/test/CodeGen/builtins-riscv.c
The file was modifiedclang/test/SemaObjC/foreach.m
The file was modifiedclang/test/SemaCXX/goto.cpp
The file was modifiedclang/test/Sema/shift.c
The file was modifiedclang/lib/Sema/SemaDecl.cpp
The file was modifiedclang/test/SemaCXX/sizeless-1.cpp
The file was modifiedclang/lib/Sema/SemaExprCXX.cpp
The file was addedclang/test/Sema/warn-unused-but-set-parameters.c
The file was addedclang/test/SemaCXX/warn-unused-but-set-parameters-cpp.cpp
The file was modifiedclang/include/clang/Sema/Sema.h
The file was modifiedclang/test/Sema/vector-gcc-compat.c
The file was modifiedclang/test/CodeGen/X86/x86_64-xsave.c
The file was modifiedclang/test/CodeGen/X86/x86_32-xsave.c
The file was modifiedclang/test/Misc/warning-wall.c
The file was modifiedclang/test/CXX/expr/expr.prim/expr.prim.lambda/p12.cpp
The file was addedclang/test/Sema/warn-unused-but-set-variables.c
The file was modifiedclang/test/CodeGen/builtins-arm.c
The file was modifiedclang/test/FixIt/fixit.cpp
Commit ebcf030efc5ef149e423f8fa2ca705b590a129ed by balazs.benics
[analyzer] Engine: fix crash with SEH __leave keyword

MSVC has a `try-except` statement.
This statement could containt a `__leave` keyword, which is similar to
`goto` to the end of the try block. The semantic of this keyword is not
implemented.

We should at least parse such code without crashing.

https://docs.microsoft.com/en-us/cpp/cpp/try-except-statement?view=msvc-160

Patch By: AbbasSabra!

Reviewed By: steakhal

Differential Revision: https://reviews.llvm.org/D102280
The file was modifiedclang/lib/StaticAnalyzer/Core/CoreEngine.cpp
The file was addedclang/test/Analysis/ms-seh.cpp
Commit 648f34a2840b75f4081884052f2ccb11f62f8209 by clattner
Merge with mainline.

Differential Revision: https://reviews.llvm.org/D102636
The file was modifiedmlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was addedmlir/test/Transforms/canonicalize-td.mlir
The file was modifiedmlir/lib/Transforms/Canonicalizer.cpp
The file was modifiedmlir/lib/Transforms/Utils/FoldUtils.cpp
The file was modifiedmlir/include/mlir/Transforms/Passes.td
The file was modifiedmlir/include/mlir/Transforms/FoldUtils.h
The file was modifiedmlir/docs/PatternRewriter.md
Commit 4a12248ee27631c86c2c29d203b22599339ced92 by thakis
[lld/mac] Honor REFERENCED_DYAMICALLY, set it on __mh_execute_header

Has the effect that `__mh_execute_header` stays in the symbol table of
outputs even after running `strip` on the output. I don't know if that's
important for anything -- my motivation for the patch is just is to make
the output more similar to ld64.

(Corresponds to symbolTableInAndNeverStrip in ld64.)

Differential Revision: https://reviews.llvm.org/D102619
The file was modifiedlld/MachO/SymbolTable.h
The file was modifiedlld/test/MachO/stabs.s
The file was modifiedlld/MachO/MergedOutputSection.cpp
The file was modifiedlld/MachO/SyntheticSections.cpp
The file was modifiedlld/MachO/InputFiles.cpp
The file was addedlld/test/MachO/referenced-dynamically.s
The file was modifiedlld/MachO/Symbols.h
The file was modifiedlld/test/MachO/symtab.s
The file was modifiedlld/MachO/SymbolTable.cpp
The file was modifiedlld/MachO/Driver.cpp
The file was modifiedlld/MachO/UnwindInfoSection.cpp
Commit 5879da496cdf44e50cbd8ea062aa36370e218fdb by ajcbik
[mlir][sparse] replace experimental flag with inplace attribute

The experimental flag for "inplace" bufferization in the sparse
compiler can be replaced with the new inplace attribute. This gives
a uniform way of expressing the more efficient way of bufferization.

Reviewed By: bixia

Differential Revision: https://reviews.llvm.org/D102538
The file was modifiedmlir/test/Dialect/SparseTensor/sparse_lower.mlir
The file was modifiedmlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
The file was modifiedmlir/test/Integration/Dialect/SparseTensor/CPU/sparse_sampled_matmul.mlir
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
The file was addedmlir/test/Dialect/SparseTensor/sparse_lower_inplace.mlir
The file was modifiedmlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
Commit 0c557db617112b429e5abfbcec72d181221bfead by aeubanks
[NewPM] Add C bindings for new pass manager

This patch contains the bare minimum to run the new Pass Manager from the LLVM-C APIs. It does not feature PGOOptions, PassPlugins or Debugify in its current state. Bugzilla: PR48499

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D102136
The file was addedllvm/include/llvm-c/Transforms/PassBuilder.h
The file was addedllvm/unittests/Passes/PassBuilderBindingsTest.cpp
The file was addedllvm/lib/Passes/PassBuilderBindings.cpp
The file was modifiedllvm/lib/Passes/CMakeLists.txt
The file was modifiedllvm/unittests/Passes/CMakeLists.txt
Commit 24bf554b1059d1ee27040ea90fc046d75950e58d by jpienaar
Add type function for ConstShape op.

- Enables inferring return type for ConstShape, takes into account valid return types;
- The compatible return type function could be reused, leaving that for next use refactoring;

Differential Revision: https://reviews.llvm.org/D102182
The file was modifiedmlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
The file was modifiedmlir/test/Dialect/Shape/invalid.mlir
The file was modifiedmlir/test/Dialect/Shape/ops.mlir
The file was modifiedmlir/lib/Dialect/Shape/IR/Shape.cpp
Commit c870e36be1b21c1f306927fc9eb983390e434278 by peter
gn build: Only build the hwasan runtime in aliasing mode on x86.

The LAM mode is currently untested by check-hwasan, so we only need
to build the runtime in aliasing mode. Because LAM mode will always
need to be conditional (because only certain hardware will support
it) we can always just disable the LAM lit tests if it ever starts
being tested.
The file was modifiedllvm/utils/gn/secondary/compiler-rt/lib/hwasan/BUILD.gn
Commit 0f417789192e74f9d2fad0f6aee4efc394257176 by ndesaulniers
[AArch64] Support customizing stack protector guard

Follow up to D88631 but for aarch64; the Linux kernel uses the command
line flags:

1. -mstack-protector-guard=sysreg
2. -mstack-protector-guard-reg=sp_el0
3. -mstack-protector-guard-offset=0

to use the system register sp_el0 for the stack canary, enabling the
kernel to have a unique stack canary per task (like a thread, but not
limited to userspace as the kernel can preempt itself).

Address pr/47341 for aarch64.

Fixes: https://github.com/ClangBuiltLinux/linux/issues/289
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Reviewed By: xiangzhangllvm, DavidSpickett, dmgreen

Differential Revision: https://reviews.llvm.org/D100919
The file was modifiedclang/include/clang/Basic/CodeGenOptions.h
The file was modifiedclang/lib/CodeGen/BackendUtil.cpp
The file was modifiedclang/include/clang/Driver/Options.td
The file was modifiedllvm/include/llvm/Target/TargetOptions.h
The file was modifiedllvm/lib/CodeGen/CommandFlags.cpp
The file was modifiedclang/test/Driver/stack-protector-guard.c
The file was modifiedllvm/lib/Target/AArch64/AArch64InstrInfo.cpp
The file was addedllvm/test/CodeGen/AArch64/stack-guard-sysreg.ll
The file was modifiedclang/lib/Driver/ToolChains/Clang.cpp
Commit e9f600f20af66ce7a24adb3971453a1f7ce6bc29 by spatel
[InstCombine] add tests for fneg-of-select; NFC
The file was modifiedllvm/test/Transforms/InstCombine/fneg.ll
Commit 3cdd05e519ddab7d4e4864cadb977a876cd19046 by spatel
[InstCombine] fold fnegs around select

This is one of the folds requested in:
https://llvm.org/PR39480

https://alive2.llvm.org/ce/z/NczU3V

Note - this uses the normal FMF propagation logic
(flags transfer from the final value to new/intermediate ops).
It's not clear if this matches what Alive2 implements,
so we may want to adjust one or the other.
The file was modifiedllvm/test/Transforms/InstCombine/fneg.ll
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
Commit 11c857c71d62b50a8e8b3b2c5ec1488d60bdafab by llvmgnsyncbot
[gn build] Port 0c557db61711
The file was modifiedllvm/utils/gn/secondary/llvm/lib/Passes/BUILD.gn