SuccessChanges

Summary

  1. [libcxx] [test] Pass some windows environment variables through to test processes (details)
  2. [llvm-jitlink] Prevent missing symbols from JITLoaderGDB with MSVC mangling (details)
  3. [mlir][linalg] Only generate one var for an attrUse. (details)
  4. [AArch64][GlobalISel] Enable use of the optsize predicate in the selector. (details)
  5. [lld-macho] Rework length check when opening input files (details)
  6. Add __builtin_isnan(__fp16) testcase (details)
  7. BPF: Fix a bug in peephole TRUNC elimination optimization (details)
Commit 34ee3d91a80cd58ee2ae5309b24ea1b72c3a7b79 by martin
[libcxx] [test] Pass some windows environment variables through to test processes

Normally, the run.py wrapper script runs the child processes in
a clean environment, with only the environment variables available
that are passed via the --env parameter.

However, the COMSPEC and TEMP variables are kind of necessary when
running some tests; COMSPEC is necessary for finding the interpreter
when executing commands via std::system().

Before f1a96de1bc8db527b5eb820c36c17e275900ca2b, tests were executed
via an intermediate shell which implicitly readded the COMSPEC variable.

The TEMP variable allows temp files to be placed in a sensible
location; if unset, they're placed in the default temp fallback of
C:\Windows instead.

Differential Revision: https://reviews.llvm.org/D97452
The file was modifiedlibcxx/utils/run.py (diff)
Commit bbdb4c8c9bcef0e8db751630accc04ad874f54e7 by Stefan Gränitz
[llvm-jitlink] Prevent missing symbols from JITLoaderGDB with MSVC mangling

The issue came up on builder clang-x64-windows-msvc after 5182a7901a5d83dfd15021d01e8a1899910130ec
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp (diff)
Commit c0f8115c73b758b992f237b531f4b807c0c1c810 by hanchung
[mlir][linalg] Only generate one var for an attrUse.

Some variables are unused after D97383 landed. We should generate one symbol for one attrUse.

Reviewed By: stellaraccident

Differential Revision: https://reviews.llvm.org/D97794
The file was modifiedmlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-gen.cpp (diff)
The file was modifiedmlir/test/mlir-linalg-ods-gen/test-linalg-ods-gen.tc (diff)
Commit 8a316045ede4f598c22a175875231684ac2fb234 by Amara Emerson
[AArch64][GlobalISel] Enable use of the optsize predicate in the selector.

To do this while supporting the existing functionality in SelectionDAG of using
PGO info, we add the ProfileSummaryInfo and LazyBlockFrequencyInfo analysis
dependencies to the instruction selector pass.

Then, use the predicate to generate constant pool loads for f32 materialization,
if we're targeting optsize/minsize.

Differential Revision: https://reviews.llvm.org/D97732
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/InstructionSelect.h (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/RISCV/RISCVTargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/AArch64/GISel/AArch64InstructionSelector.cpp (diff)
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/select-imm.mir (diff)
The file was modifiedllvm/lib/Target/ARM/ARMTargetMachine.cpp (diff)
The file was modifiedllvm/test/CodeGen/AArch64/O0-pipeline.ll (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp (diff)
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/Utils.h (diff)
The file was modifiedllvm/lib/CodeGen/GlobalISel/Utils.cpp (diff)
The file was modifiedllvm/utils/TableGen/GlobalISelEmitter.cpp (diff)
The file was modifiedllvm/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll (diff)
The file was modifiedllvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h (diff)
The file was modifiedllvm/lib/Target/AArch64/AArch64TargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/PowerPC/PPCTargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/X86/X86TargetMachine.cpp (diff)
The file was modifiedllvm/lib/Target/Mips/MipsTargetMachine.cpp (diff)
The file was modifiedllvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp (diff)
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h (diff)
Commit 4af1522a855e94c909630a1f1962241c1573eac8 by gkm
[lld-macho] Rework length check when opening input files

This reverts diff D97610 (commit 0223ab035c199e537a0040857ba147ced87fd533) and adds a one-line fix to verify that a `MemoryBufferRef` has sufficient length before reading a 4-byte magic number.

Differential Revision: https://reviews.llvm.org/D97757
The file was removedlld/test/MachO/invalid/tiny-input.s
The file was modifiedlld/MachO/Driver.cpp (diff)
The file was modifiedlld/MachO/InputFiles.cpp (diff)
The file was modifiedlld/test/MachO/rename.s (diff)
The file was modifiedlld/MachO/InputFiles.h (diff)
The file was modifiedlld/MachO/DriverUtils.cpp (diff)
Commit e77b5c40d57633a66842e75410585696895ecf4d by thomasp
Add __builtin_isnan(__fp16) testcase

Reviewed By: rjmccall

Differential Revision: https://reviews.llvm.org/D97777
The file was modifiedclang/test/CodeGen/strictfp_builtins.c (diff)
Commit 51cdb780db3b9b46c783efcec672c4da272e9992 by yhs
BPF: Fix a bug in peephole TRUNC elimination optimization

Andrei Matei reported a llvm11 core dump for his bpf program
   https://bugs.llvm.org/show_bug.cgi?id=48578
The core dump happens in LiveVariables analysis phase.
  #4 0x00007fce54356bb0 __restore_rt
  #5 0x00007fce4d51785e llvm::LiveVariables::HandleVirtRegUse(unsigned int,
      llvm::MachineBasicBlock*, llvm::MachineInstr&)
  #6 0x00007fce4d519abe llvm::LiveVariables::runOnInstr(llvm::MachineInstr&,
      llvm::SmallVectorImpl<unsigned int>&)
  #7 0x00007fce4d519ec6 llvm::LiveVariables::runOnBlock(llvm::MachineBasicBlock*, unsigned int)
  #8 0x00007fce4d51a4bf llvm::LiveVariables::runOnMachineFunction(llvm::MachineFunction&)
The bug can be reproduced with llvm12 and latest trunk as well.

Futher analysis shows that there is a bug in BPF peephole
TRUNC elimination optimization, which tries to remove
unnecessary TRUNC operations (a <<= 32; a >>= 32).
Specifically, the compiler did wrong transformation for the
following patterns:
   %1 = LDW ...
   %2 = SLL_ri %1, 32
   %3 = SRL_ri %2, 32
   ... %3 ...
   %4 = SRA_ri %2, 32
   ... %4 ...

The current transformation did not check how many uses of %2
and did transformation like
   %1 = LDW ...
   ... %1 ...
   %4 = SRL_ri %2, 32
   ... %4 ...
and pseudo register %2 is used by not defined and
caused LiveVariables analysis core dump.

To fix the issue, when traversing back from SRL_ri to SLL_ri,
check to ensure SLL_ri has only one use. Otherwise, don't
do transformation.

Differential Revision: https://reviews.llvm.org/D97792
The file was addedllvm/test/CodeGen/BPF/remove_truncate_8.ll
The file was modifiedllvm/lib/Target/BPF/BPFMIPeephole.cpp (diff)