UnstableChanges

Summary

  1. [mlir][ArmSVE] Add masked arithmetic operations (details)
  2. [LV] Workaround PR49900 (a crash due to analyzing partially mutated IR) (details)
  3. [MC] Untangle MCContext and MCObjectFileInfo (details)
  4. [NFC][X86][CostModel] Add tests for byteswap intrinsic (details)
  5. RISSCV: clang-format RISC-V AsmParser (NFC) (details)
  6. [llvm-objcopy][ELF] --only-keep-debug: set offset/size of segments with no sections to zero (details)
  7. [NFC][SimplifyCFG] Update documentation comments for SinkCommonCodeFromPredecessors() after 1886aad (details)
Commit 95861216ac6558dc0dbcf638902feb9072c84661 by javier.setoain
[mlir][ArmSVE] Add masked arithmetic operations

These instructions map to SVE-specific instrinsics that accept a
predicate operand to support control flow in vector code.

Differential Revision: https://reviews.llvm.org/D100982
The file was modifiedmlir/lib/Dialect/ArmSVE/Transforms/LegalizeForLLVMExport.cpp
The file was modifiedmlir/lib/Dialect/ArmSVE/IR/ArmSVEDialect.cpp
The file was modifiedmlir/test/Dialect/ArmSVE/legalize-for-llvm.mlir
The file was modifiedmlir/test/Dialect/ArmSVE/roundtrip.mlir
The file was modifiedmlir/include/mlir/Dialect/ArmSVE/ArmSVE.td
The file was modifiedmlir/test/Target/LLVMIR/arm-sve.mlir
Commit 80e8025083982f4eca8ca8200eafecf4a5c3ae6e by listmail
[LV] Workaround PR49900 (a crash due to analyzing partially mutated IR)

LoopVectorize has a fairly deeply baked in design problem where it will try to query analysis (primarily SCEV, but also ValueTracking) in the midst of mutating IR. In particular, the intermediate IR state does not represent the semantics of the original (or final) program.

Fixing this for real is hard, but all of the cases seen so far share a common symptom. In cases seen to date, the analysis being queried is the computation of the original loop's trip count. We can fix this particular instance of the issue by simply computing the trip count early, and caching it.

I want to be really clear that this is nothing but a workaround. It does nothing to fix the root issue, and at best, delays the time until we have to fix this for real. Florian and I have discussed an eventual solution in the review comments for https://reviews.llvm.org/D100663, but it's a lot of work.

Test taken from https://reviews.llvm.org/D100663.

Differential Revision: https://reviews.llvm.org/D101487
The file was addedllvm/test/Transforms/LoopVectorize/scev-during-mutation.ll
The file was modifiedllvm/lib/Transforms/Vectorize/LoopVectorize.cpp
Commit 632ebc4ab4374e53fce1ec870465c587e0a33668 by i
[MC] Untangle MCContext and MCObjectFileInfo

This untangles the MCContext and the MCObjectFileInfo. There is a circular
dependency between MCContext and MCObjectFileInfo. Currently this dependency
also exists during construction: You can't contruct a MOFI without a MCContext
without constructing the MCContext with a dummy version of that MOFI first.
This removes this dependency during construction. In a perfect world,
MCObjectFileInfo wouldn't depend on MCContext at all, but only be stored in the
MCContext, like other MC information. This is future work.

This also shifts/adds more information to the MCContext making it more
available to the different targets. Namely:

- TargetTriple
- ObjectFileType
- SubtargetInfo

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D101462
The file was modifiedllvm/tools/llvm-objdump/llvm-objdump.cpp
The file was modifiedllvm/unittests/MC/DwarfLineTables.cpp
The file was modifiedllvm/unittests/DebugInfo/DWARF/DwarfGenerator.cpp
The file was modifiedllvm/unittests/CodeGen/MachineInstrTest.cpp
The file was modifiedllvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
The file was modifiedllvm/lib/DWARFLinker/DWARFStreamer.cpp
The file was modifiedllvm/lib/MC/MCMachOStreamer.cpp
The file was modifiedllvm/tools/llvm-jitlink/llvm-jitlink.cpp
The file was modifiedllvm/unittests/CodeGen/TestAsmPrinter.cpp
The file was modifiedclang/lib/Parse/ParseStmtAsm.cpp
The file was modifiedllvm/tools/llvm-mc-assemble-fuzzer/llvm-mc-assemble-fuzzer.cpp
The file was modifiedllvm/lib/MC/MCObjectFileInfo.cpp
The file was modifiedllvm/tools/llvm-ml/Disassembler.cpp
The file was modifiedllvm/tools/llvm-objdump/MachODump.cpp
The file was modifiedllvm/lib/CodeGen/MachineModuleInfo.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/SnippetFile.cpp
The file was modifiedclang/tools/driver/cc1as_main.cpp
The file was modifiedllvm/lib/MC/MCContext.cpp
The file was modifiedllvm/include/llvm/MC/MCObjectFileInfo.h
The file was modifiedllvm/tools/llvm-profgen/ProfiledBinary.cpp
The file was modifiedllvm/lib/MC/MCWinCOFFStreamer.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/LlvmState.cpp
The file was modifiedllvm/lib/MC/MCDisassembler/Disassembler.cpp
The file was modifiedllvm/lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
The file was modifiedlldb/source/Plugins/Disassembler/LLVMC/DisassemblerLLVMC.cpp
The file was modifiedllvm/lib/Object/ModuleSymbolTable.cpp
The file was modifiedllvm/lib/MC/MCAsmStreamer.cpp
The file was modifiedllvm/lib/MC/MCParser/COFFAsmParser.cpp
The file was modifiedllvm/lib/MC/MCParser/DarwinAsmParser.cpp
The file was modifiedllvm/tools/sancov/sancov.cpp
The file was modifiedllvm/lib/MC/MCStreamer.cpp
The file was modifiedllvm/tools/llvm-rtdyld/llvm-rtdyld.cpp
The file was modifiedllvm/lib/MC/MCParser/AsmParser.cpp
The file was modifiedlldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
The file was modifiedlldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
The file was modifiedllvm/include/llvm/MC/MCContext.h
The file was modifiedllvm/tools/llvm-dwp/llvm-dwp.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/SerializeToHsaco.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/Analysis.cpp
The file was modifiedllvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
The file was modifiedllvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
The file was modifiedllvm/tools/llvm-mc/llvm-mc.cpp
The file was modifiedllvm/lib/Target/TargetLoweringObjectFile.cpp
The file was modifiedllvm/tools/llvm-ml/llvm-ml.cpp
The file was modifiedllvm/tools/llvm-cfi-verify/lib/FileAnalysis.cpp
The file was modifiedllvm/lib/Target/NVPTX/MCTargetDesc/NVPTXTargetStreamer.cpp
The file was modifiedllvm/lib/MC/MCParser/MasmParser.cpp
The file was modifiedllvm/tools/llvm-mca/llvm-mca.cpp
The file was modifiedllvm/unittests/CodeGen/MachineOperandTest.cpp
Commit 833b33a7f4dc1d1f1a75bb3e04dee7ce8ed22f06 by lebedev.ri
[NFC][X86][CostModel] Add tests for byteswap intrinsic
The file was modifiedllvm/test/Analysis/CostModel/X86/bswap.ll
The file was addedllvm/test/Analysis/CostModel/X86/bswap-vec.ll
The file was addedllvm/test/Analysis/CostModel/X86/bswap-store.ll
The file was addedllvm/test/Analysis/CostModel/X86/load-bswap.ll
Commit ba5c122647c79586a6d060ca649e586feb7f57a0 by Saleem Abdulrasool
RISSCV: clang-format RISC-V AsmParser (NFC)

This corrects a few issues identified by `clang-format`.  This is meant
to be preparation for a subsequent change.
The file was modifiedllvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
Commit b3336bfa2e6a38f16c4ecf4d77bd0f97ec5a46eb by i
[llvm-objcopy][ELF] --only-keep-debug: set offset/size of segments with no sections to zero

PR50160: we currently ignore non-PT_PHDR segments with no sections, not
accounting for its p_offset and p_filesz: this can cause an out-of-bounds write
in `writeSegmentData` if the p_offset+p_filesz is larger than the total file
size.

This can be fixed by setting p_offset=p_filesz=0. The logic nicely unifies with
the logic added in D90897.

Reviewed By: jhenderson, rupprecht

Differential Revision: https://reviews.llvm.org/D101560
The file was modifiedllvm/tools/llvm-objcopy/ELF/Object.cpp
The file was modifiedllvm/test/tools/llvm-objcopy/ELF/only-keep-debug.test
Commit 8048005739ebf6734b2d841a528c06595062f899 by lebedev.ri
[NFC][SimplifyCFG] Update documentation comments for SinkCommonCodeFromPredecessors() after 1886aad
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp