Skip to content

Commit 9cfb94f

Browse files
committed
Merge remote-tracking branch '1/main' into main
* 1/main: [SelectionDAG] Use APInt::zextOrSelf instead of zextOrTrunc in ComputePHILiveOutRegInfo Add DXIL triple [lldb/test] Fix typo in eventlistener.py (NFC) [CMake] Update cache file for Win to ARM Linux cross toolchain builders. NFC. [MLIR][SCF] Place hoisted scf.if->select prior to the remaining if Ensure that APIRecords get destroyed correctly. [flang] Error recovery improvement in runtime (IOMSG=) [flang] Accept legacy aliases for intrinsic function names [flang] Convert RUNTIME_CHECK to better error for user errors in transformational.cpp [lldb/test] Add events listener helper class to lldbtest [flang] Add explanatory messages to grammar for language extensions [ARM] Fix shouldExpandAtomicLoadInIR for subtargets without ldrexd. Autogenerate llvm/test/CodeGen/ARM/atomic-load-store.ll [slp][tests] Add missing function attributes [mlir] Remove incorrect builders for ExpandShapeOp [AMDGPU] Add gfx940 run line to gfx90a mfma test. NFC. [X86] Adjust tests to run on gfni capable cpu levels [X86] Fix typo in gfni funnel shift test [GlobalOpt] Don't replace alias with aliasee if either alias/aliasee may be preemptible [NewPM] Don't skip SCCs not in current RefSCC [RGT] StencilTest: Fix an assertion [OpenMP] Initial parsing/sema for the 'omp target teams loop' construct Fix computation of MadeChange bit in AtomicExpandPass. Driver: Make macOS the default target OS for -arch arm64 [AMDGPU] Added gfx940 mfma dst constraint test. NFC. [AMDGPU] gfx940 basic speed model [AMDGPU] Disable some MFMA instructions on gfx940 Update llvm-config.h.cmake for 7b98391 [AMDGPU] reuse blgp as neg in 2 mfma operations on gfx940 [scudo] Fix static and unused function type annotations [scudo] Don't assume preprocessor macro is defined [ARM] Fix ARM backend to correctly use atomic expansion routines. Reland "[gn build] (manually) port 6316129" [libc++] Enable modernize-loop-convert [polly] Fix NPM unittests after D121566. Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled Use llvm::append_range where applicable [CostModel][X86] Reduce cost of extracting bool vector elements [SLP] Add comment clarifying assumption that tripped me up [NFC] [Vectorize] Fix an 'unused function' warning [VE] Fix an 'unused variable' warning [Vectorize] Fix an 'unused variable' warning [SCCP] do not clean up dead blocks that have their address taken [libc++] Make shared_ptr move unique_ptr's deleter Revert "[SLP] Optionally preserve MemorySSA" [HWASan] do not replace lifetime intrinsics with tagged address. [trace][intelpt] fix some test failures Revert "[pseudo] Split greatergreater token." Implement __cpuid and __cpuidex as Clang builtins [CMake][Fuchsia] Drop Darwin architectures [CMake][Fuchsia] Include llvm-undname Revert "[HWASan] do not replace lifetime intrinsics with tagged address." [MLIR][MemRef] Nested allocation scope inlining [runtimes] Detect changes to Tests.cmake [MLIR][SCF] Combine nested ifs with yields [LICM] Add allowspeculation pass options. [HWASan] do not replace lifetime intrinsics with tagged address. [RISCV][NFC] Add tests to address invalid arch dependencies. [flang][Parser] Add a node for individual sections in sections construct [ARM][AArch64] generate subtarget feature flags [lldb] Remove lldb/lldb subdir created by wrong patch level [OpenMP][FIX] Make test check lines less strict [MLIR][SCF] Create selects from if yield results which are not defined in the body [InstCombine] add tests for bswap with shifted operand; NFC [NFC][mlir] Run clang-format on file. [mlir] Add support for the nest attribute to the LLVM-IR dialect conversion. tsan: print signal num in errno spoiling reports [gn build] Port a36c2dd [flang] Lower select case statement [BasicAA] Account for wrapping when using abs(VarIndex) >= abs(Scale). [clang][dataflow] Add modeling of Chromium's CHECK functionality [SLP][X86] Add baseline SSE2 test run to lookahead.ll [FPEnv][InstSimplify] Teach CannotBeNegativeZero() about constrained intrinsics. [clang-format] Refactor ShouldBreakBeforeBrace to use switch. NFC. [clang][SVE] Add support for bitwise operators on SVE types Add validation for number of arguments of __builtin_memcpy_inline [clang-format] Expect instead of setting the same value in tests. NFC. [clang-format] Use range-for loop. NFC. [clang-format] Refactor BreakableBlockComment constructor. NFC. [LowerConstantIntrinsics] Make TLI a required dependency [flang] Lower length on character storage [LowerConstantIntrinsics] Add test for objectsize of malloc (NFC) [flang][NFC] Add lowering tests [flang] Lower statement function [OpenMPRuntime] Specify correct pointer type [BOLT] LongJmp speedup refactoring [gn build] Port f83d833 [gn build] (manually) port a954ade (gen X86GenMnemonicTables.inc) [gn build] (semiautomatically) port fdcb256 [lldb] Require x86 target for NativePDB test Revert "[gn build] (manually) port 6316129" [Clang] Support multiple attributes in a single pragma Revert "[ARM][AArch64] generate subtarget feature flags" [AArch64] Custom lower concat(v4i8 load, ...) [libc++][ranges] Implement ranges::min [ARM][AArch64] generate subtarget feature flags [CostModel][X86] Update RUN -passes=* to double quotes to appease update scripts on windows [lldb] Increase timeout in TestProcessIOHandlerInterrupt [SCEV] Use constant ranges when determining reachable blocks (PR54434) [lldb] Fix TestProcessIOHandlerInterrupt.py for macos [clang-format] Copy help options to the doc directory. [flang][lowering] Add support for lowering of the `ior` intrinsic [RISCV] Add more sign-extending ops to MIR sext.w pass. [AMDGPU][DOC][NFC] Added links to MI200 documentation [flang][lowering] Add support for lowering of the `{l|u}bound` intrinsics [CodeGen] Store element type in DominatingValue<RValue> [flang][lowering] Add support for lowering of the `merge` intrinsics [CodeGen] Remove some uses of deprecated Address constructor [bazel] Port a954ade [bazel] Sync llvm-config.h after 112aafc [InstCombine] Remove integer SPF of SPF folds (NFCI) [Flang] Lower the spacing, rrspacing intrinsics [MemorySSA] Don't optimize uses during construction [LoopSimplifyCFG] Check predecessors of exits before marking them dead. [BOLT][NFC] Use X86 mnemonic tables [X86][NFC] Generate mnemonic tables [TableGen] X86 mnemonic tables backend [flang][NFC] Move random test in Instriscs folder Revert "Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled" [MLIR][Presburger] introduce SetCoalescer [mlir][Math] Add constant folder for sqrt. [lldb] Fix ^C handling in IOHandlerProcessSTDIO Revert "[lldb] Fix ^C handling in IOHandlerProcessSTDIO" Remove a top-level "using namespace" directive from LegalizationArtifactCombiner.h [lldb] Add more documentation on test variants [lldb] Remove process->LoadModules call from DynamicLoaderPOSIXDYLD [flang] Lower more array expression [mlir][SymbolDCE] Track the number of symbols DCE'd Fix llvm-strip --only-keep-debug documentation for ELF [X86][NFC] Rename target feature hasCMov->hasCMOV [AtomicExpand][PowerPC] Fix all-one mask value [X86] Rename more target feature related things consistency. NFC [PowerPC][NFC] Add atomic alignments and ops tests for powerpc [X86] Set Int_MemBarrier as a meta-instruction [Codegen][tablgen][NFC] Allow meta instruction to be target dependent [InstCombine] Sink instructions with multiple users in a successor block. [libc][NFC] Add the platform independent file target only if mutex is available. Reland "Load pass plugins during option processing, so that plugin options are registered and live." [AMDGPU] Use COPY_TO_REGCLASS for buffer_atomic_cmpswap selection [libc++][ranges] Implement changes to reverse_iterator from One Ranges Proposal. Correct and complete dependency sets after 74b411d [RISCV] Fix buildbot breakage by explicitly instantiating templates Fix invalid preprocessor directive. Update llvm-config.h.cmake for LLVM_UNREACHABLE_OPTIMIZE [LoongArch] Add some blank lines to make .td more tidy. NFC Revert "[SLP] Fix lookahead operand reordering for splat loads." due to build failures [SLP][NFC] Added a test for a followup patch that enables handling splat loads with uses. [SLP] Fix lookahead operand reordering for splat loads. [SLP][NFC] This adds a test for a follow-up patch that fixes a look-ahead operand reordering issue Use llvm::append_range instead of push_back loops where applicable. NFCI. Revert "Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics""" [gn build] (manually) port 6316129 Revert "Revert "[misexpect] Re-implement MisExpect Diagnostics"" Revert "[misexpect] Re-implement MisExpect Diagnostics" [misexpect] Re-implement MisExpect Diagnostics [BPF] handle unsigned icmp ops in BPFAdjustOpt pass [docs] Fix codeblock. Revert "[MLIR][Presburger] introduce SetCoalescer" [AMDGPU] Add 2 gfx940 mfma tests. NFC. [Attributor] Remove more non-deterministic behavior and debug output [OpenMP][FIX] Initialize member to avoid undefined value in debug output [Attributor][FIX] Remove reference into map that might dangle [AlwaysInliner] Emit inline remark only when successful [docs] Add details to MemorySSA docs. [WebAssembly] Add end-to-end codegen tests for wasm_simd128.h Add a cmake flag to turn `llvm_unreachable()` into builtin_trap() when assertions are disabled [lldb] Migrate ProcessGDBRemote to ReportWarning [ObjCARC] Fix non-determinism [libc++] [test] Add ranges_robust_against_copying_*.pass.cpp [libc++] Install psutil on CI builders AMDGPU: Use the implicit kernargs for code object version 5 [libc++] Add missing <cstddef> include [lld][WebAssembly] Fix crash accessing non-live __tls_base symbol [IndVars] Add a new test affected by 62f86d4 [IROutliner] Make sure that loop debug info is stripped. [flang] Add array constructor lowering tests [AMDGPU] New MFMA names for existing instructions [AMDGPU] Add gfx90a and gfx940 to get_elf_mach_gfx_name.cpp [VFS] Add print/dump to the whole FileSystem hierarchy [OpenMP][FIX] Make metadata and attribute check lines less detailed [MLIR][Presburger] introduce SetCoalescer [dsymutil] Store possible Swift reflection sections in an array [mlir] Move InterfaceMap::InterfaceMap to the cpp file [mlir] Use array_pod_sort for sorting stats/counters. [AMDGPU] Allow v_accvgpr_write to use SGPR src on gfx940 [gn build] Port 22570ba Precommit test for D121483: [FPEnv][InstSimplify] Teach CannotBeNegativeZero() about constrained intrinsics. [OpenMP][FIX] Relax test check lines [lldb] Fix ^C handling in IOHandlerProcessSTDIO Currently the control of the eval-method is mixed with fast-math. FLT_EVAL_METHOD tells the user the precision at which, temporary results are evaluated but when fast-math is enabled, the numeric values are not guaranteed to match the source semantics, so the eval-method is meaningless. For example, the expression `x + y + z` has as source semantics `(x + y) + z`. FLT_EVAL_METHOD is telling the user at which precision `(x + y)` is evaluated. With fast-math enable the compiler can choose to evaluate the expression as `(y + z) + x`. The correct behavior is to set the FLT_EVAL_METHOD to `-1` to tell the user that the precision of the intermediate values is unknow. This patch is doing that. [AMDGPU] Fix PreRARematerialize scheduler pass sinking subreg defs Reland "Use a stable-sort when combining bases" [libc++] Switch to the new testing configurations by default [MLIR][Math] Add constant folder for powf [SLP]Do not schedule instructions with constants/argument/phi operands and external users. [scudo] Use portable sysconf instead of deprecated getpagesize [MLIR] Add affine.load fold hook on global constant memrefs Reapply "[OpenMP][FIX] Allow device constructors for AMD GPU" Add another office hour Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO [mlir][sparse] Introduce new binary and unary op [ARM] Fix Decode of tsb csync [dsymutil] Apply relocations present in Swift reflection sections [scudo][tests] Pass read-only vector by reference [scudo] Fix test harness integration [scudo] Use nullptr instead of integer-to-pointer cast [scudo] Don't unmap other low memory pages if mapping doesn't exist [scudo] Explicitly mark enum as unsigned [scudo] Remove unused vector value initializer [AlwaysInliner] Check inliner errors even without assserts [NFC] Disable clang/SymbolGraph test [RISCV] Mention Zvfh extension in release notes. NFC [PS4] Make __BIGGEST_ALIGNMENT__ 32bytes Revert "RegAllocGreedy: Fix last chance recolor assert in impossible case" [clang][dataflow] Model the behavior of non-standard optional assignment [RISCV] Add +experimental-zvfh extension to cover half types in vectors. [LoopSimplifyCFG] Add test case for PR54023. [gn build] Port 1af5fbd Revert "Use a stable-sort when combining bases" Attempt forward fix for Linux buildbots for D116385 [flang][nfc] Move a test [RISCV] Simplify scalable vector case in lowerVectorMaskExt. [mlir][docs] Fix formatting issue in Dialects/Vector.md. [NFC][ InstCombine] precommit test for D121585 [BPF] Fix a bug in BPFAdjustOpt pass for icmp transformation [mlir] Extend SimplifyTrivialLoops [AArch64][SVE] InstCombine llvm.aarch64.sve.sel to select [flang] Lower some numeric intrinsics [flang] Add equivalence lowering tests [clang] AddObjCKeyValueCompletions - use castAs<> instead of getAs<> to avoid dereference of nullptr [flang] Add more lowering tests for dummy arguments Use a stable-sort when combining bases [flang] Add IO lowering test [AtomicExpandPass][NFC] Reformat with clang-format [LTO][ELF] Require asserts for --stats-file= tests. [CodeGen] Avoid pointer element type access for blocks [LLDB] Modifying expression code in MakeLoadImageUtilityFunction to be more consistent [Coroutines][NFC] Format line to 80 cols [libc][NFC] Add a separate flag for capturing the '+' in fopen mode string. [OpaquePtr][LLParser] Automatically detect opaque pointers in .ll files [CodeGen] Avoid some pointer element type accesses [lldb] Skip invalid-condition.test on Windows [CodeGen] Avoid some pointer element type accesses [clangd] Code action for creating an ObjC initializer [Clang] Added info about noinline/always_inline statement attributes to release notes [AArch64] Add extra insert-subvector tests. NFC [AMDGPU] Stop using getMinimalPhysRegClass in LowerFormalArguments [DebugInfo][InstrRef] Prefer stack locations for variables [CodeGen] Avoid some pointer element type accesses [Instruction] Introduce getAtomicSyncScopeID() [CGObjCGNU] Remove pointer element type uses [Flang] Lower the repeat intrinsic [flang] Lower command and environment intrinsics [LV] Use usesScalars in widenPHIInstruction. [Flang] Lower the transpose intrinsic [x86] try harder to use shift instead of test if it can save some immediate bytes [pseudo] Tweak some docs, NFC [clangd] Re-enable clang-tidy's nolint blocks [pseudo] Split greatergreater token. [Flang] Lower the trim intrinsic [Flang] Lower Matmul intrinsic [Sema] add warning for tautological FP compare with literal [flang] Lower misc intrinsics [flang] Lower present intrinsic [flang] Lower exit intrinsic [flang][lowering] Add support for lowering of the `index` intrinsics [VPlan] VPInterleaveRecipe only requires the first lane of the address. [flang][nfc] Update comment in test [AMDGPU][MC] A fix for commit 5977dfb [clang-tidy][run-clang-tidy.py] Add --config-file=<string> option [clang-tidy] Don't check decltype return types in `readability-const-return-type` [SLP] Avoid unnecessary getIncomingValueForBlock() call (NFC) Revert "[libcxx][CI] Use temporary clang-13 bots for Arm/AArch64" [X86] Use the unaligned vector typedefs for the lddqu intrinsics pointer arguments (PR20670) [mlir][bazel] make .pyi files available to Bazel [flang] handle allocatable components when creating array temps [Bazel] Update Bazel build to add symbol_graph. [Clang][VE] Add vector mask intrinsics to clang [LegacyPassManager] Move structural hashing into Pass classes. NFC. [AArch64] Combine ISD::AND into AArch64ISD::ANDS [mlir][Bazel] Add missing dependency. [mlir][Bazel] Adapt BUILD.bazel for move of lsp-server support files. Reapply [InstCombine] Support switch in phi to cond fold [pseudo] Fix some naming-style violations. [clang-format][docs] Regenerate ClangFormatStyleOptions.rst [mlir][Bazel] Also fix mlir/unittests/BUILD.bazel. [clang-format] Correctly recognize binary operators in template arguments with parenthesized literals. Reland "[clang][driver] Emit a warning if -xc/-xc++ is after the last input file" [clang-format] Reformat. NFC. [mlir][Bazel] Adapt to move of FuncOp. [mlir] Make header standalone (NFC) [RISCV] Add patterns for vnsrl.wi and vnsra.wi instructions [mlir][NFC] Move the LSP agnostic files to a new lsp-server directory [PDLL] Add proper expansive documentation for PDLL [flang] Lower array related intrinsics [lldb] Migrate runtime instrumentation plugins to ReportWarning [flang] Lower character related intrinsics [lldb] Remove commented-out code in CommandObjectExpression (NFC) [lldb] Migrate condition evaluation failure to ReportError [mlir] Refactor DialectRegistry delayed interface support into a general DialectExtension mechanism [lldb] Fix flakiness in command-disassemble-process.yaml (2/2) [mlir][vscode] Don't inject inside strings [AMDGPU] Select buffer_atomic_cmpswap* in tblgen [lldb] Fix flakyness in command-disassemble-process.yaml [lldb] Fix flakyness in Minidump/no-process-id.yaml [lldb] Update TargetProperties::CheckJITObjectsDir to use ReportError [LTO][ELF] Add --stats-file= option. [WebAssembly] Disable SimplifyDemandedVectorElts after legalization [WebAssembly] Improve EH/SjLj error messages [NFC][MLIR][Affine] Add todo for adding affine namespace [MLIR][Affine] Expose region-based isTopLevelValue [MLIR][Affine] Expose getAffineScope as a utility function [AMDGPU][SIFoldOperands] Consider the alignment constraints [AMDGPU][MachineVerifier] Alignment check for fp32 packed math instructions [RISCV][NFC] Replace redundant code with VLOpFrag Stricter use-after-dtor detection for trivial members. Use-after-dtor detection for trivial base classes. [Clang] [P2025] More exhaustive tests for NRVO [FIX][NFC] Fix a test case in clang/SymbolGraph [mlir:FunctionOpInterface] Rename the "type" attribute to "function_type" [mlir] Move the Builtin FuncOp to the Func dialect [mlir] Add C API for ControlFlow dialect [gn build] Port 2207762 [CodeGen] Inline _byteswap_* builtins. [gn build] (manually) port 5aab45f (SymbolGraph) [libc++] Remove <utility> includes [libc++] Add warning pragma macros in the test suite [flang] Remove unused code and redundant assertion. [FIX][clang-extract-api] Fix scope naming violation [lldb/crashlog] Create artificial frames for non-crashed scripted threads [bazel] Port 50f82e6 Revert "[OpenMP][FIX] Allow device constructors for AMD GPU" Minor refactor and renaming: - Rename IntelPTManager class and files to IntelPTCollector - Change GetTimestampCounter API to general trace counter API, GetCounter [clang][extract-api] Add global record support [OpenMP][FIX] Allow device constructors for AMD GPU [lldb] Expose diagnostic events through the SB API [RISCV] Remove stale FIXME from a test. NFC [RISCV] Improve detection of when to skip (and (srl x, c2) c1) -> (srli (slli x, c3-c2), c3) isel. [mlir] Fix missing verification after running an OpToOpAdaptorPass [OpenMP] Initial parsing/sema for the 'omp teams loop' construct [lld-macho] Extend lto-internalize-unnamed-addr.ll [libc++][NFC] Reindent release notes bullet points [OpaquePtr][ARM] Use elementtype on ldrex/ldaex/stlex/strex [CODE_OWNERS/CREDITS] Update my email address Revert "[SLP]Do not schedule instructions with constants/argument/phi operands and external users." [clang-format] Reformat. NFC. [SCCP] update test to NPM, update_test_checks. NFC [flang] Include missing internal interfaces in .mod files [WebAssembly] Fix names of SIMD instructions containing '_zero' [flang] Lower pack|unpack intrinsics [ConstraintElimination] Add missing dominance check. [AMDGPU] Define new feature HasFlatScratchSVSMode. NFC. [clang][dataflow] Add an API for dataflow "models" -- reusable analysis components. [libc++][NFC] Rename member variables to avoid shadowing conflict in future patch [flang] Lower numeric related instrinsics [libc] Remove references to the std threads library from __support/threads. [flang] Exclude IO test for windows [BPF] fix a CO-RE bitfield relocation error with >8 record alignment [libc][NFC] Keep the mutex with the base File data structure. [AMDGPU] Correct gfx940 memory model documentation. [libc][Obvious] Add missing licence headers and fix an include pattern. [RISCV] Ensure PseudoLA* can be hoisted [NFC][RISCV] Pre-commit tests for hoisting of PseudoLLA/PseudoLA* [docs] Fix typo in tutorial [flang] Keep ifdef macro for INT128 [bazel] Add build rule for llvm-remark-size-diff [lldb] add missed handling for new BTFTagAttributed type [HWASan] add shortgranule tests to use-after-scope. [x86] reduce indentation; NFC [ASan] Added .section statement to each function so they can be removed by --gc-sections. [HWASan] Update use-after-scope test to use ARM64. [flang][lowering] Add support for lowering of the `i{a}char` intrinsics [memprof] Add a test to verify callstack order. Revert "[CMake][Fuchsia] Use correct architecture for iossim" [flang][lowering] Add support for lowering of the `ibclr` intrinsic [ASan] Add read to large_func_test.cpp to prevent optimization. [MLIR] [LangRef] Clarify parsing of dense<...> [clangd] Handle more than two conflicting semantic tokens in resolveConflict() [flang][lowering] Add support for lowering of the `ieor` intrinsic [llvm-objcopy] --weaken-symbol/--weaken: weaken STB_GNU_UNIQUE symbols [SelectionDAG][NFC] Clean up SDCallSiteDbgInfo accessors [Symbolize] Fix overflow warning on 32-bit hosts. [libc++][NFC] Add TEST_HAS_NO_INCOMPLETE_RANGES. [NFC][clang][SVE] Auto-generate SVE operator tests. [BOLT] Strip redundant AdSize override prefix [libc++][tests] Use CMake provided paths for includes and libdir instead of hardcoding them [VPlan] Avoid collecting scalars for SVE [lldb] Fix Minidump/no-process-id.yaml [flang][lowering] Add lowering for the `size` intrinsic Revert "[FuzzMutate] Don't insert instructions after musttail call" [flang] Lower shift intrinsics [flang] Lower IO input with vector subscripts [FuzzMutate] Don't insert instructions after musttail call [Attr] Fix a btf_type_tag AST generation [VE] Remove output to /dev/stdout [lldb] Report debugger diagnostics as events [X86] Emit REX prefix immediately before the opcode [X86] Preserve redundant Address-Size override prefix [pseudo] Cleanup the leftover header guards after the movement, NFC. [gn build] Port c2f62ab [BOLT][NFC] Move isMOVSX64rm32 out of MCPlusBuilder [Clang][VE] Add the rest of intrinsics to clang [flang][lowering] Add lowering for the `set_exponent` intrinsic [AMDGPU] Calculate RegWidth in bits in AsmParser [flang] Relax fir.rebox verifier with characters [lldb] Change back LLDBLog::Commands->Types in a couple more places [SROA] Handle over-large loads during presplitting [LLDB] Change enumaration to enumeration [LLDB] Fix typos in LLDB help output. [mlir][bufferize] Update documentation with allow-return-allocs [mlir][bufferize] Allow non-equivalent yields from scf.for loops [NFC][CodeGen] Remove redundant if clause in TargetPassConfig::addPass [ConstraintElimination] Support BBs with single successor in CanAdd. [mlir][bufferize] Deallocate returned buffers with `BufferDeallocation` let EST_Uninstantiated in FunctionProtoType::canThrow return CT_Dependent [libc] Let exhaustive tests indicate each interval PASSED/FAILED. [mlir][linalg] Implement RegionBranchOpInterface and fix memory effects [flang] Lower count intrinsic [mlir][bufferize] Support layout maps in bufferization.clone lowering [SLP]Do not schedule instructions with constants/argument/phi operands and external users. [AMDGPU][MC][NFC] Refactored custom operands handling [libc++] Fix incorrect availability markup for bad_optional_access & friends [BOLT] LongJmp: Fix hot text section alignment [libc++] Do not install the C++ ABI library's headers as part of libc++'s build [clang][deps] NFC: Align path separator conversion in tests [clang][deps] Attempt to fix test on Windows [NFC][CodeGen] Rename some functions in MachineInstr.h and remove duplicated comments [gn build] (manually) port e4cab4e [clang][deps] Fix traversal of precompiled dependencies [clang][deps] Don't prune search paths used by dependencies [clang][deps] NFC: Use range-based for loop instead of iterators [clang][deps] Modules don't contribute to search path usage [X86] computeKnownBitsForTargetNode - add X86ISD::AND KnownBits handling [X86] Add PR54171 test case [mlir][SCF] Implement RegionBranchOpInterface on ExecuteRegionOp [mlir][bufferize][NFC] Rename allow-return-memref to allow-return-allocs [flang][driver] Add support for `-mllvm` [flang] Lower adjustl and adjustr intrinsics [flang] Lower transfer instrinsic [flang][lowering] Add support for lowering of the `ibset` intrinsic [VE] v512|256 f32|64 fneg isel and tests [FunctionAttrs] Infer argmemonly . [Clang] Allow "ext_vector_type" applied to Booleans [mlir][bufferize] Do not deallocate allocs that are returned from a block [mlir][tensor] Implement ReifyRankedShapedTypeOpInterface on GenerateOp [Tests] Update pipeline tests [ConstraintElimination] Add additional tests with uncond branches. [AArch64] Regenerate and extend peephole-and-tst.ll tests. NFC [RelLookupTableConverter] Avoid querying TTI for declarations [SelectionDAG] Emit calls to __divei4 and friends for division/remainder of large integers [AAEval] Remove unused function (NFC) Missing include in Support/Host.cpp under __MVS__ [AAEval] Make compatible with opaque pointers Use lit_config.substitute instead of foo % lit_config.params everywhere [flang] Lower system_clock intrinsic [clang-format] Fix crashes due to missing l_paren [llvm][ADT] Remove duplicate code in llvm::StringMapImpl::RehashTable [clang] CWG 2354: prohibit alignas for enums Cleanup codegen includes [ELF] Move invalid binding diagnostic from initializeSymbols to postParse [LoongArch] Add some missing comments. NFC [ELF] Use endianness-aware read32 to avoid dispatch. NFC [ELF] Inline ARMExidxSyntheticSection::classof. NFC [ELF] Optimize "Strip sections" [flang] Lower date_and_time and cpu_time intrinsics [flang][NFC] Remove duplicated header file [NFC][X86] Rename some variables and functions about target features [mlir][Linalg] Add multi-result op cast test. [mlir:OpenMP] Fix memory leak in asan translation [libc] Unlock after pop_back [libc][NFC] Use more common variable naming convention [msan] Add interceptors for Linux 64-bit stat variants Updated mlir-tablegen dependencies for f96a867 [ELF] Move section assignment from initializeSymbols to postParse [RISCV] Select SRLI+SLLI for AND with leading ones mask [lit] Remove clang_libs_dir Revert D120626 "[ELF] Move section assignment from initializeSymbols to postParse" [ELF][test] Improve i386-linkonce.s [LLDB][NFC] Remove dead code from Section.cpp [lsan] Attempt to fix s390x after a63932a [lld][WebAssembly] Take advantage of extended const expressions when available [LLDB][NativePDB] Remove REQUIRES: system-windows for local-variables-regsiters.s [gn build] (manually) port 89cd86b (clang-pseudo move) [mlir][sparse] add one extra index test on f32 matrix [mlir:PDLInterp][NFC] Switch to using prefixed accessors [mlir:Toy][NFC] Switch toy to use prefixed accessors [lld-macho] Set FinalDefinitionInLinkageUnit on most LTO externs [ELF] Suppress duplicate symbol error for __x86.get_pc_thunk.bx [libfuzzer] improve introductory sentence Reapply [pseudo] Move pseudoparser from clang to clang-tools-extra" Revert "[pseudo] Move pseudoparser from clang to clang-tools-extra" [libc][bazel] split support_standalone_cpp target [SLP] Optionally preserve MemorySSA [pseudo] Move pseudoparser from clang to clang-tools-extra [gn build] (manually) port 2b69eb4 [mlir][sparse][taco] Support the use of index values in tensor expressions. [lld][WebAssembly] Add --unresolved-symbols=import-dynamic [flang] Move null entry at the correct place [mlir][toy] Define a FuncOp operation in toy and drop the dependence on FuncOp [mlir][PDL] Define a new PDLInterp::FuncOp operation and drop uses of FuncOp [libc][NFC] Fix typos and reduntent code triggering compiler warinings. [MLIR] UnknownLoc on Inlinable Calls in LLVMIR Translation [ELF] Work around not-fully-supported .gnu.linkonce.t.__x86.get_pc_thunk.bx [lldb] Fix AppleObjCRuntime log channels [flang] Fix intrinsic entry [flang] Lower random_[init|number|seed] intrinsics [sanitizer] Always initialize the regex in the regcomp() interceptor [flang] Lower min|max intrinsics X86ISelDAGToDAG: Transform TEST + MOV64ri to SHR + TEST Add tests for D121320 [libc++] Define _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER whenever we enable warnings in the test suite [flang] Lower character related intrinsic [clang-tools-extra] Reuse llvm_config.use_clang() to set up test environment [flang] Lower allocated intrinsic Fix sphinx build because of indentation [lit] add lit_config.substitute to interpolate lit_config.params [LLDB][NativePDB] Don't complete static members' types when completing a record type. [flang] Lower alternate return [flang] Lower entry statement [flang] Lower more pointer assignments/disassociation cases reland: [clang] Don't append the working directory to absolute paths [clang-format] Fix crash with ObjC Blocks [libc++] Add workaround to avoid breaking users of <span> when <ranges> are disabled [lsan] Allow suppression of "unknown module" [libc++] Update URL to old libc++ dylibs [Concepts] Fix an assertion failure while diagnosing constrained function candidates Avoid using a variable-sized array for a tiny allocation. Re-land "[lldb] Synchronize output through the IOHandler" [BOLT][NFC] Remove unused function [FunctionAttrs] Replace MemoryAccessKind with FMRB. [clang][parser] Allow GNU attributes before namespace identifier [NFC][AIX] Disable precompiled module file test on AIX [BOLT] Set cold sections alignment explicitly [PowerPC][P10] Add Vector pair calling convention Complete the list of single-underscore keywords for MSVC compat. [MLIR][Linalg] Canonicalization patterns for linalg.generic. Fold linalg.fill into linalg.generic. Remove dead arguments used in linalg.generic. [gn build] Port d46409f Move DWARFRecordSectionSplitter code to its own file [WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349 [libc++] Make __dir_stream visibility declaration consistent Allow newline characters as separators for checks in Clang-Tidy configurations [Debuginfod] Check libcurl via CMake library. [AMDGPU] Regen checks again no-remat-indirect-mov [AMDGPU] Regen checks for schedule-barrier [AMDGPU] Regen checks for no-remat-indirect-mov [mlir][sparse] more test cases for linalg.index [X86] Fix AMD Znver3 model checks Revert "[clang][driver] Emit a warning if -xc/-xc++ is after the last input file" [clang][driver] Emit a warning if -xc/-xc++ is after the last input file [AMDGPU] Fix typo consecutive in GCNNSAReassign Revert "[lldb] Synchronize output through the IOHandler" [llvm-cov gcov] Fix calculating coverage of template functions [LLDB] Fixing DWARFExpression handling of ValueType::FileAddress case for DW_OP_deref_size [flang][lowering] Add support for lowering of the `ibits` intrinsic [lldb] Make the PlatformMacOSX unit test Apple specific [lldb] Synchronize output through the IOHandler [flang][lowering] Add support for lowering the `dim` intrinsic [libc] Add implementation of POSIX lseek function. [lldb] Fix platform selection on Apple Silicon (again) [flang][lowering] Add support for lowering the `dot_product` intrinsic [mlir][sparse][taco] Reorder a class. [LegalizeTypes][RISCV][WebAssembly] Expand ABS in PromoteIntRes_ABS if it will expand to sra+xor+sub later. [DAGCombiner][RISCV] Adjust (aext (and (trunc x), cst)) -> (and x, cst) to sext cst based on target preference Revert "[lldb/test] Make category-skipping logic "platform"-independent" [RISCV] Remove lowerSPLAT_VECTOR [libc] Fix exit not calling new handlers registered from a call to atexit in atexit handler [libc][BlockStore] Add back, pop_back and empty methods [clang][dataflow] Allow disabling built-in transfer functions for CFG terminators [InstCombine] try harder to propagate 'nsz' through fneg-of-select [InstCombine] add tests for fneg-of-select with FMF; NFC [libc++] Overhaul all tests for assertions and debug mode [VE] strided v256.23 isel and tests [mlir] Fix --convert-func-to-llvm=emit-c-wrappers argument and result attribute handling [libc] Implement expm1f function that is correctly rounded for all rounding modes. [InstCombine] Add general constant support to eq/ne icmp(add(X,C1),add(Y,C2)) -> icmp(add(X,C1-C2),Y) fold [JITLink] Fix -Wparentheses warning in R_RISCV_SUB6 case. [AARCH64] ssbs should be enabled by default for cortex-x1, cortex-x1c, cortex-a77 [MLIR][OpenMP] Add support for basic SIMD construct [ASAN] Fix darwin-interface test [gn build] Port 7262eac Revert "Load pass plugins during option processing, so that plugin options are registered and live." Revert rG9c542a5a4e1ba36c24e48185712779df52b7f7a6 "Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO" Remove a top-level "using namespace" in TargetTransformInfoImpl.h Load pass plugins during option processing, so that plugin options are registered and live. [lldb/test] Make category-skipping logic "platform"-independent [BasicAA] Add test showing incorrect noalias result with wrapping. [mlir][bufferize] Extract buffer hoisting into separate function [clang-format] Correctly format variable templates. [X86] combineSelect - canonicalize (vXi1 bitcast(iX Cond)) with combineToExtendBoolVectorInReg before legalization [clang-format] Add regression tests for function ref qualifiers on operator definition. NFC. [LV] Make reduction-order.ll test independent of instruction naming. [NFC] Add LazyValueInfo::clear method [clang-format] Correctly recognize arrays in template parameter list. [mlir][gpu] Introduce gpu.global_id op [mlir][spirv] Add AssumeTrueKHROp [mlir][bufferize][NFC] Deallocate all buffers at the end of bufferization [OpenMPOpt] Avoid pointer element type access during region merging [mlir][bufferize][NFC] Split BufferizationState into AnalysisState/BufferizationState [flang] fulfill -Msave/-fno-automatic in main programs too [mlir][bufferize] Fix config not passed to greedy rewriter [libc][Obvious] Fix typo in CMake file. [flang] Hanlde COMPLEX 2/3/10 in runtime TypeCode(cat, kind) [MachineLICM] Simplify code and avoid adding nullptr values to ParentMap. NFC [LV] Remove LoopVectorBody from InnerLoopVectorizer. (NFCI) [mlir] Remove the deprecated ODS Op verifier/parser/printer code blocks [clang][dataflow] Model the behavior of non-standard optional constructors [mlir][Bazel] Adjust build file to account for new td files. [PowerPC] Disable perfect shuffle by default [mlir] Refactor how parser/printers are specified for AttrDef/TypeDef [mlir] Rewrite and modernize the documentation for defining Attributes/Types [mlir] Split out AttrDef/TypeDef and pattern constructs from OpBase.td [mlir][ods] Add support for custom directive in attr/type formats [NFC][XCOFF] Refactor and format XCOFFObjectWriter.cpp. [llvm-objcopy] Simplify CompressedSection creation. NFC [MC][test] Add more .loc directives to improve portability with older zlib Revert "[mlirTranslateMain] Add a customization callback." [mlir][nvvm] Fix bug in ldmatrix intrinsic conversion [lldb] Cleanup MacOSX platform headers (NFC) [clang] Fix DIFile directory root on Windows [test] Add lit helper for windows paths [WebAssembly] Fix asan issue from https://reviews.llvm.org/D121349 AMDGPU: Use removeAllRegUnitsForPhysReg() [CMake][Fuchsia] Use correct architecture for iossim [lld-macho] -flat_namespace for dylibs should make all externs interposable [lld-macho][nfc] Allow Defined symbols to be placed in binding sections [clang-format] Don't unwrap lines preceded by line comments [OpenMP][Fix] Fix test failing after patch [OpenMP][Fix] Add offloading kind to AMDGPU libraries [gn build] Port 9c542a5 Lower `@llvm.global_dtors` using `__cxa_atexit` on MachO [CUDA] Add CUDA fatbinary magic [OpenMP][NFC] Refactor new driver to be more general [Clang] Add offload kind to embedded offload object [OpenMP] Implement dense map info for device file [OpenMP] Try to embed offloading objects after codegen [AMDGPU] gfx940: disable OP_SEL on V_DOT instructions Reland "[lld-macho] Avoid using bump-alloc in TrieBuider"" [AMDGPU] Add symbolic names for gfx940 HWREGs [DFSan] Remove trampolines to unblock opaque pointers. (Reland with fix) [AMDGPU] Support for gfx940 flat lds opcodes [AMDGPU] Support gfx940 v_lshl_add_u64 instruction [ARM] __cxa_end_cleanup: avoid clobbering r4 [Clang] noinline stmt attribute - emit warnings rather than errors Don't report memory return values on MacOS_arm64 of SysV_arm64 ABI's. [AMDGPU] flat scratch SVS addressing mode for gfx940 Revert "[lld-macho] Avoid using bump-alloc in TrieBuider" [flang] IEEE_ARITHMETIC must imply USE IEEE_EXCEPTIONS [AMDGPU] gfx940 memory model [IROutliner] Ensure merged PHINodes respect order and incoming blocks, not just incoming values [InstCombine] Fold select based logic of fcmps with same operands when FMF is present. [IRLinker] make IRLinker::AddLazyFor optional (llvm::unique_function). NFC [lld-macho] Avoid using bump-alloc in TrieBuider [X86] Fix avx512.mask.vpshld/vpshrd tests to correctly test maskz cases [AttrDocs] try to fix build [ELF] Move section assignment from initializeSymbols to postParse NFC: Remove unterminated string from Python pyi file. [AMDGPU] Restrict machine copy propagation from creating unaligned classes [flang] Lower any intrinsic [GlobalISel] Fix store merging incorrectly merging volatile stores. Revert "[DFSan] Remove trampolines to unblock opaque pointers." [Clang] always_inline statement attribute [DFSan] Remove trampolines to unblock opaque pointers. [MTE] Add test that stack tagging does not mess up stack coloring. [LLDB] Applying clang-tidy modernize-use-default-member-init over LLDB [IROutliner] Separate split PHI nodes from multiple exits by different outlinable regions. gn build: Add support for building with libcurl. [LV] Check for users of truncated IVs, add more detailed comment. [X86] Fix cosmetic issues in instruction mnemonics [lldb] Plumb process host architecture through platform selection [ELF] Set the priority of STB_GNU_UNIQUE the same as STB_WEAK [Support] Add const to `FileError::getFileName` [VFS] Rename `RedirectingFileSystem::dump` to `print` [CodeGen] Remove an unused variable introduced in D121128 [Support] Change zlib::compress to return void [lldb] Fix the Windows build after D121536 [flang] LBOUND() edge case: empty dimension Write a pass to annotate constant operands on FIR ops. This works around the feature in MLIR's canonicalizer, which considers the semantics of constants differently based on how they are packaged and not their values and use. Add test. Revert "[flang] IEEE_ARITHMETIC must imply USE IEEE_EXCEPTIONS" [RISCV] Add MIR tests exposing missed InstAliases [libc++][NFC] Remove several redundant #if _LIBCPP_STD_VER > 17 in <span> [regalloc] Remove -consider-local-interval-cost [flang] IEEE_ARITHMETIC must imply USE IEEE_EXCEPTIONS [lldb] Use the debugger's asynchronous output stream for progress events. [AArch64] Perform last active true vector combine [clang][dataflow] Add support for nested composite bool expressions [WebAssembly] Remove unused method from WebAssemblyTargetStreamer. NFC [WPD] Extend checking mode to support fallback to indirect call [flang] Lower format statement [llvm] Fix warning: missing submodule 'LLVM_Analysis.ScalarFuncs' [lldb] Use the IOHandler's stream instead of the debugger's in PrintAsync [OpaquePtr][AArch64] Use elementtype on ldxr/stxr [flang] Lower common block [DFSan] Remove use of setarch in dfsan test. [IROutliner] Avoid reusing PHINodes that have already been matched when merging outlined functions' phi node blocks [gn build] Port 5e65e79 [flang] Lower all intrinsic Fix the implicit module build (2/2) [NewPM] Actually recompute GlobalsAA before module optimization pipeline [test] Add phase ordering test [flang] Lower elemental calls [ValueTracking] Simplify llvm::isPointerOffset() Fix issing header on z/OS [lldb] Skip Test11588 on Windows Fix the implicit module build [lldb] Move ProgressEventData out of debugger and into its own file (NFC) [TLI] Check that malloc argument has type size_t [mlir][vector] Implement unrolling of ReductionOp [WebAssembly] Rename member in WasmYAML.h to avoid compiler warning clang-tidy: discover binaries in build dir [WebAssembly] Second phase of implemented extended const proposal [SLPVectorizer] Handle external load/store pointer uses with opaque pointers [lldb] Require native for command-thread-siginfo.test [LV] Remove dead Loop argument from emitMinimumVector... (NFC) [polly] Introduce -polly-print-* passes to replace -analyze. [mlir][vector] Add unrolling pattern for multidim_reduce op [Verifier] Verify llvm.access.group metadata [PowerPC] Add missed VSX shuffles instead of Altivec ones Revert "[clang-format] Correctly format variable templates." [VE] v256f32|64 fma isel [lld-link] Tweak winsysroottest.test to have passing links on happy path Silence -Wlogical-op-parentheses and fix a logic bug while doing so [libc] Include -150 to the special cases at the beginning of exp2f function. [SCCP][IR] Landing pads are not safe to remove [libc] Implement exp2f function that is correctly rounded for all rounding modes. Implement literal suffixes for _BitInt Have cpu-specific variants set 'tune-cpu' as an optimization hint [mlir][bufferization] Update public MLIR documentation [LV] Remove dead Loop argument from emitSCEVChecks. (NFC) [CoroSplit] Avoid self-replacement [Clang][Sema] Avoid crashing for `__builtin_memcpy_inline` with an array argument [LV] Do not set insert point in completeLoopSkeleton. (NFCI) [DeadArgElim] Guard against function type mismatch [GVN] Check load type in select PRE [clang-format] Fix crash on asm block with label [clang-format][NFC] Left renamed to OpeningBrace... [clang-format] Fix crash on invalid requires expression [clang-format][NFC] Rename Left to OpeningParen... Expose ScalarizerPass options to C++ (not just commandline) [clang-format] Clean up UnwrappedLineParser::parseRecord. NFC. [X86] Update AVX512 VBMI2 VL intrinsic tests to avoid adds [mlir][linalg] Replace linalg.fill by OpDSL variant. [flang][NFC] Use TODO with location [VE] Support more intrinsics [VE] v256i32|64 reduction isel and tests [flang][NFC] Add todo in CallInterface [VE] v256.32|64 gather|scatter isel and tests [flang] Add runtime support for GET_COMMAND Add BasicTTIImpl cost model for llvm.get.active.lane.mask intrinsic [flang] Add support for linkonce_odr in FIR [VE] Transfer backend ownership [mlir][linalg] Use explicit replace in canonicalization pattern (NFC). Add cmake_parse_arguments() to `tablegen()` CMake function [clang][dataflow] Model the behavior of various optional members Correctly find builtins library with clang-cl [cmake] Add LLVM_THINLTO_CACHE_PATH [NFC] Fix go binding build [MCA] Removed unused variable. [clang-format] Add option to align compound assignments like `+=` [clang-format] Extract doc for entire configuration structs [yamlio] Allow parsing an entire mapping as an enumeration Remove include_directories() from cmake `mlir_tablegen()` function (NFC) [MCA] Moved six instruction flags from InstrDesc to InstructionBase. [IRSim] Make sure the first instruction of a block doesn't get missed if it is the first valid instruction in Module. [RISCV] Add basic code modeling for fixed length vector reduction. [RISCV] Merge ReplaceNodeResults code for SHFL and GREV/GORC. NFC [X86] Update avx512vbmi2vl intrinsic tests to avoid adds [IRSim][IROutliner] Ignoring Musttail Function Revert "[IRSim][IROutliner] Ignoring Musttail Function" [IRSim][IROutliner] Ignoring Musttail Function [VPlan] Ensure each iv user is only visited once in transform. [clang-format] Fix incorrect assertion on macro definitions with keyword class. [clang-format] Correctly format variable templates. [clang-format] Add space to comments starting with '#'. [clang-format] Handle attributes before case label. [X86] Update AVX512 intrinsic tests to avoid adds [PhaseOrdering] Update naming of blocks after 95f76bf. [X86] Update AVX512VL intrinsic tests to avoid adds [LV] Create & use VPScalarIVSteps for all scalar users. [clang-tidy][docs] Fix wrong url in DontModifyStdNamespaceCheck [clang-tidy][docs][NFC] Update URL and docs of PostfixOperatorCheck [clang-tidy][docs][NFC] Refer to the CERT rule in bugprone-shared-ptr-array-mismatch docs [libc++] Replace _LIBCPP_HAS_NO_CONCEPTS with _LIBCPP_STD_VER > 17. NFCI. [SDAG] simplify bitwise logic with repeated operand [AArch64] add tests for bitwise logic reassociation; NFC [InstCombine] Add additional icmp eq/ne test coverage for Issue llvm#32161 [MLIR][Presburger][NFC] Fix doc for PresburgerSpace::numLocals [PhaseOrdering] loop-rotation-vs-common-code-hoisting.ll - merge equivalent check-prefixes [MLIR][NFC] Fix deprecation message. [MLIR][Presburger] Add support for PresburgerRelation [X86] combineCMP - peek through zero-extensions for X86cmp(zext(x0),0) zero tests (PR38960) Signed-off-by: kyvangka1610 <[email protected]>
2 parents 90c201b + 306ff74 commit 9cfb94f

File tree

5,191 files changed

+144700
-39277
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

5,191 files changed

+144700
-39277
lines changed

bolt/include/bolt/Core/MCPlusBuilder.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,6 @@ class MCPlusBuilder {
526526
return false;
527527
}
528528

529-
virtual bool isMOVSX64rm32(const MCInst &Inst) const {
530-
llvm_unreachable("not implemented");
531-
return false;
532-
}
533-
534529
virtual bool isLeave(const MCInst &Inst) const {
535530
llvm_unreachable("not implemented");
536531
return false;
@@ -1287,7 +1282,8 @@ class MCPlusBuilder {
12871282

12881283
/// Replace instruction with a shorter version that could be relaxed later
12891284
/// if needed.
1290-
virtual bool shortenInstruction(MCInst &Inst) const {
1285+
virtual bool shortenInstruction(MCInst &Inst,
1286+
const MCSubtargetInfo &STI) const {
12911287
llvm_unreachable("not implemented");
12921288
return false;
12931289
}

bolt/include/bolt/Utils/CommandLineOpts.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ extern llvm::cl::OptionCategory BoltInstrCategory;
3030
extern llvm::cl::OptionCategory HeatmapCategory;
3131

3232
extern llvm::cl::opt<unsigned> AlignText;
33+
extern llvm::cl::opt<unsigned> AlignFunctions;
3334
extern llvm::cl::opt<bool> AggregateOnly;
3435
extern llvm::cl::opt<unsigned> BucketsPerLine;
3536
extern llvm::cl::opt<bool> DiffOnly;

bolt/lib/Core/BinaryEmitter.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ bool BinaryEmitter::emitFunction(BinaryFunction &Function, bool EmitColdPart) {
291291
BC.Ctx->addGenDwarfSection(Section);
292292

293293
if (BC.HasRelocations) {
294+
// Set section alignment to at least maximum possible object alignment.
295+
// We need this to support LongJmp and other passes that calculates
296+
// tentative layout.
297+
if (Section->getAlignment() < opts::AlignFunctions)
298+
Section->setAlignment(Align(opts::AlignFunctions));
299+
294300
Streamer.emitCodeAlignment(BinaryFunction::MinAlign, &*BC.STI);
295301
uint16_t MaxAlignBytes = EmitColdPart ? Function.getMaxColdAlignmentBytes()
296302
: Function.getMaxAlignmentBytes();

bolt/lib/Passes/Aligner.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ extern cl::OptionCategory BoltOptCategory;
2323

2424
extern cl::opt<bool> AlignBlocks;
2525
extern cl::opt<bool> PreserveBlocksAlignment;
26+
extern cl::opt<unsigned> AlignFunctions;
2627

2728
cl::opt<unsigned>
2829
AlignBlocksMinSize("align-blocks-min-size",
@@ -43,13 +44,6 @@ AlignBlocksThreshold("align-blocks-threshold",
4344
cl::Hidden,
4445
cl::cat(BoltOptCategory));
4546

46-
cl::opt<unsigned>
47-
AlignFunctions("align-functions",
48-
cl::desc("align functions at a given value (relocation mode)"),
49-
cl::init(64),
50-
cl::ZeroOrMore,
51-
cl::cat(BoltOptCategory));
52-
5347
cl::opt<unsigned>
5448
AlignFunctionsMaxBytes("align-functions-max-bytes",
5549
cl::desc("maximum number of bytes to use to align functions"),

bolt/lib/Passes/BinaryPasses.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ uint64_t ShortenInstructions::shortenInstructions(BinaryFunction &Function) {
10111011
if (opts::Verbosity > 2)
10121012
OriginalInst = Inst;
10131013

1014-
if (!BC.MIB->shortenInstruction(Inst))
1014+
if (!BC.MIB->shortenInstruction(Inst, *BC.STI))
10151015
continue;
10161016

10171017
if (opts::Verbosity > 2) {

bolt/lib/Passes/LongJmp.cpp

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
//===----------------------------------------------------------------------===//
1212

1313
#include "bolt/Passes/LongJmp.h"
14-
#include "llvm/Support/Alignment.h"
1514

1615
#define DEBUG_TYPE "longjmp"
1716

1817
using namespace llvm;
1918

2019
namespace opts {
2120
extern cl::OptionCategory BoltOptCategory;
22-
21+
extern llvm::cl::opt<unsigned> AlignText;
22+
extern cl::opt<unsigned> AlignFunctions;
2323
extern cl::opt<bool> UseOldText;
2424
extern cl::opt<bool> HotFunctionsAtEnd;
2525

@@ -295,6 +295,7 @@ void LongJmpPass::tentativeBBLayout(const BinaryFunction &Func) {
295295
uint64_t LongJmpPass::tentativeLayoutRelocColdPart(
296296
const BinaryContext &BC, std::vector<BinaryFunction *> &SortedFunctions,
297297
uint64_t DotAddress) {
298+
DotAddress = alignTo(DotAddress, llvm::Align(opts::AlignFunctions));
298299
for (BinaryFunction *Func : SortedFunctions) {
299300
if (!Func->isSplit())
300301
continue;
@@ -321,14 +322,20 @@ uint64_t LongJmpPass::tentativeLayoutRelocMode(
321322
uint32_t CurrentIndex = 0;
322323
if (opts::HotFunctionsAtEnd) {
323324
for (BinaryFunction *BF : SortedFunctions) {
324-
if (BF->hasValidIndex() && LastHotIndex == -1u)
325+
if (BF->hasValidIndex()) {
325326
LastHotIndex = CurrentIndex;
327+
break;
328+
}
329+
326330
++CurrentIndex;
327331
}
328332
} else {
329333
for (BinaryFunction *BF : SortedFunctions) {
330-
if (!BF->hasValidIndex() && LastHotIndex == -1u)
334+
if (!BF->hasValidIndex()) {
331335
LastHotIndex = CurrentIndex;
336+
break;
337+
}
338+
332339
++CurrentIndex;
333340
}
334341
}
@@ -342,7 +349,7 @@ uint64_t LongJmpPass::tentativeLayoutRelocMode(
342349
tentativeLayoutRelocColdPart(BC, SortedFunctions, DotAddress);
343350
ColdLayoutDone = true;
344351
if (opts::HotFunctionsAtEnd)
345-
DotAddress = alignTo(DotAddress, BC.PageAlign);
352+
DotAddress = alignTo(DotAddress, opts::AlignText);
346353
}
347354

348355
DotAddress = alignTo(DotAddress, BinaryFunction::MinAlign);
@@ -385,18 +392,24 @@ void LongJmpPass::tentativeLayout(
385392
}
386393

387394
// Relocation mode
388-
uint64_t EstimatedTextSize = tentativeLayoutRelocMode(BC, SortedFunctions, 0);
389-
390-
// Initial padding
391-
if (opts::UseOldText && EstimatedTextSize <= BC.OldTextSectionSize) {
392-
DotAddress = BC.OldTextSectionAddress;
393-
uint64_t Pad = offsetToAlignment(DotAddress, llvm::Align(BC.PageAlign));
394-
if (Pad + EstimatedTextSize <= BC.OldTextSectionSize)
395-
DotAddress += Pad;
396-
} else {
397-
DotAddress = alignTo(BC.LayoutStartAddress, BC.PageAlign);
395+
uint64_t EstimatedTextSize = 0;
396+
if (opts::UseOldText) {
397+
EstimatedTextSize = tentativeLayoutRelocMode(BC, SortedFunctions, 0);
398+
399+
// Initial padding
400+
if (EstimatedTextSize <= BC.OldTextSectionSize) {
401+
DotAddress = BC.OldTextSectionAddress;
402+
uint64_t Pad =
403+
offsetToAlignment(DotAddress, llvm::Align(opts::AlignText));
404+
if (Pad + EstimatedTextSize <= BC.OldTextSectionSize) {
405+
DotAddress += Pad;
406+
}
407+
}
398408
}
399409

410+
if (!EstimatedTextSize || EstimatedTextSize > BC.OldTextSectionSize)
411+
DotAddress = alignTo(BC.LayoutStartAddress, opts::AlignText);
412+
400413
tentativeLayoutRelocMode(BC, SortedFunctions, DotAddress);
401414
}
402415

bolt/lib/Rewrite/DWARFRewriter.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,6 @@ getDWOName(llvm::DWARFUnit &CU,
149149
return DWOName;
150150
}
151151

152-
static bool isHighPcFormEightBytes(dwarf::Form DwarfForm) {
153-
return DwarfForm == dwarf::DW_FORM_addr || DwarfForm == dwarf::DW_FORM_data8;
154-
}
155-
156152
void DWARFRewriter::updateDebugInfo() {
157153
ErrorOr<BinarySection &> DebugInfo = BC.getUniqueSectionByName(".debug_info");
158154
if (!DebugInfo)

bolt/lib/Rewrite/RewriteInstance.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,9 @@ void RewriteInstance::adjustCommandLineOptions() {
17431743
if (!opts::AlignText.getNumOccurrences())
17441744
opts::AlignText = BC->PageAlign;
17451745

1746+
if (opts::AlignText < opts::AlignFunctions)
1747+
opts::AlignText = (unsigned)opts::AlignFunctions;
1748+
17461749
if (BC->isX86() && opts::Lite.getNumOccurrences() == 0 && !opts::StrictMode &&
17471750
!opts::UseOldText)
17481751
opts::Lite = true;

bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ class AArch64MCPlusBuilder : public MCPlusBuilder {
5151
return false;
5252
}
5353

54-
bool shortenInstruction(MCInst &) const override { return false; }
54+
bool shortenInstruction(MCInst &, const MCSubtargetInfo &) const override {
55+
return false;
56+
}
5557

5658
bool isADRP(const MCInst &Inst) const override {
5759
return Inst.getOpcode() == AArch64::ADRP;

bolt/lib/Target/X86/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
set(LLVM_LINK_COMPONENTS
22
BOLTCore
3+
BOLTUtils
34
MC
45
Object
56
Support

0 commit comments

Comments
 (0)