1. Apr 30, 2024
    • Paul Kirth's avatar
      rebase · bf9ee5c9
      Paul Kirth authored
      Created using spr 1.3.4
      bf9ee5c9
    • Paul Kirth's avatar
      [𝘀𝗽𝗿] changes introduced through rebase · f53ab852
      Paul Kirth authored
      Created using spr 1.3.4
      
      [skip ci]
      f53ab852
    • Florian Hahn's avatar
      [LV] Don't consider the latch block as ScalarPredicatedBB. · 9c3f5fe8
      Florian Hahn authored
      The conditional branch from the loop latch will be replaced by a
      single branch controlling the loop, so there is no extra overhead from
      scalarization. This improves the cost esimates in some cases.
      9c3f5fe8
    • Amir Ayupov's avatar
      [BOLT] Use symbol table info in registerFragment (#89648) · a1e9608b
      Amir Ayupov authored
      Fragment matching relies on symbol names to identify and register split
      function fragments. However, as split fragments are often local symbols,
      name aliasing is possible. For such cases, use symbol table to resolve
      ambiguities.
      
      This requires the presence of FILE symbols in the input binary. As BOLT
      requires non-stripped binary, this is a reasonable assumption. Note that
      `strip -g` removes FILE symbols by default, but `--keep-file-symbols`
      can be used to preserve them.
      
      Depends on: https://github.com/llvm/llvm-project/pull/89861
      
      Test Plan:
      Updated X86/fragment-lite.s
      a1e9608b
    • Peiming Liu's avatar
      [mlir][sparse] use ValueRange instead of std::pair for iterator position. (#90243) · 7e2eeb57
      Peiming Liu authored
      `ValueRange` is more easy to be extended (e.g., for padded iterator).
      7e2eeb57
    • Mehdi Amini's avatar
      [MLIR] Improve KernelOutlining to avoid introducing an extra block (#90359) · d566a5cd
      Mehdi Amini authored
      This fixes a TODO in the code.
      d566a5cd
    • Wei Wang's avatar
      [Pipelines] Do not run CoroSplit and CoroCleanup in LTO pre-link pipeline (#90310) · cd68d7b3
      Wei Wang authored
      Skip CoroSplit and CoroCleanup in LTO pre-link pipeline so that
      CoroElide can happen after callee coroutine is imported into caller's
      module in ThinLTO.
      cd68d7b3
    • Krystian Stasiowski's avatar
      [Clang] Propagate 'SystemDrive' environment variable for unit tests (#90478) · fe3f6c63
      Krystian Stasiowski authored
      On Windows, running unit tests by directly invoking `llvm-lit.py` (e.g.
      `python3 llvm-lit.py clang/test/Unit`) may create a folder named `%SystemDrive%`
      in the current working directory. This appears to happen because `lit.cfg.py` in 
      `clang/test/Unit` does not propagate the `SystemDrive` environment variable.
      fe3f6c63
    • Craig Topper's avatar
      [RISCV] Break the (czero_eqz x, (setne x, 0)) -> x combine into 2 combines. (#90428) · f9d4d54a
      Craig Topper authored
      We can think of this as two separate combines
      
      (czero_eqz x, (setne y, 0)) -> (czero_eqz x, y)
      and
      (czero_eqz x, x) -> x
      
      Similary the (czero_nez x, (seteq x, 0)) -> x combine can be broken into
      
      (czero_nez x, (seteq y, 0)) -> (czero_eqz x, y)
      and
      (czero_eqz x, x) -> x
      
      isel already does the (czero_eqz x, (setne y, 0)) -> (czero_eqz x, y)
      and (czero_nez x, (seteq y, 0)) -> (czero_eqz x, y) combines, but doing
      them early could expose other opportunities.
      f9d4d54a
    • Craig Topper's avatar
      [RISCV] Support instruction sizes up to 176-bits in disassembler. (#90371) · 618adc76
      Craig Topper authored
      We don't have any instructions defined yet, but that we can still read the correct number of bytes when disassembling. This should better match GNU objdump behavior.
      618adc76
    • Haojian Wu's avatar
      [AST] Dump explicit template arguments for UnreslovedLookupExpr. (#90466) · 99df06ac
      Haojian Wu authored
      Having them dump is useful for ad-hoc debugging (context:
      https://github.com/llvm/llvm-project/issues/90046)
      99df06ac
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
      a025ef19
    • Simon Pilgrim's avatar
      54f09be9
    • Simon Pilgrim's avatar
      6d8cae7f
    • Lei Wang's avatar
      [PseudoProbe] Add an option to remove pseudo probes after profile annotation (#90293) · b7248d53
      Lei Wang authored
      This can be used for testing perf overhead of pseudo-probe.
      b7248d53
    • Ryosuke Niwa's avatar
    • Matthias Braun's avatar
      GlobalOpt: Handle threadlocal.address intrinsic (#88454) · dede19ca
      Matthias Braun authored
      This changes `GlobalOpt` to skip/look-through `threadlocal.address`
      intrinsic where apropriate.
      
      This fixes issue #73314
      dede19ca
    • Timm Bäder's avatar
      [clang][Interp] Support vec_step · 3590ede8
      Timm Bäder authored
      3590ede8
    • yonghong-song's avatar
      BPF: Use DebugLoc to find Filename for BTF line info (#90302) · 4c701577
      yonghong-song authored
      
      
      Andrii found an issue where the BTF line info may have empty source
      which seems wrong. The program is a Meta internal bpf program. I can
      reproduce with latest upstream compiler as well. Let the bpf program
      built without this patch and then with the following veristat check
      where veristat is a bpf verifier tool to do kernel verification for bpf
      programs:
      
        $ veristat -vl2 yhs.bpf.o --log-size=150000000 >& log
        $ rg '^;' log | sort | uniq -c | sort -nr | head -n10
         4206 ; } else if (action->dry_run) { @ src_mitigations.h:57
         3907 ; if (now < start_allow_time) { @ ban.h:17
         3674 ;  @ src_mitigations.h:0
      3223 ; if (action->vip_id != ALL_VIPS_ID && action->vip_id != vip_id) {
      @ src_mitigations.h:85
      1737 ; pkt_info->is_dry_run_drop = action->dry_run; @
      src_mitigations.h:26
         1737 ; if (mitigation == ALLOW) { @ src_mitigations.h:28
      1737 ; enum match_action mitigation = action->action; @
      src_mitigations.h:25
      1727 ; void* res = bpf_map_lookup_elem(bpf_map, key); @
      filter_helpers.h:498
      1691 ; bpf_map_lookup_elem(&rate_limit_config_map, rule_id); @
      rate_limit.h:76
         1688 ; if (throttle_cfg) { @ rate_limit.h:85
      
      You can see
      
         3674 ;  @ src_mitigations.h:0
      
      where we do not have proper line information and line number.
      
      In LLVM Machine IR, some instructions may carry DebugLoc information
      to specify where the corresponding source is for this instruction.
      The information includes file_name, line_num and col_num.
      Each instruction may also attribute to a function in debuginfo.
      So there are two ways to find file_name for a particular insn:
        (1) find the corresponding function in debuginfo
            (MI->getMF()->getFunction().getSubprogram()) and then
            find the file_name from DISubprogram.
        (2) find the corresponding file_name from DebugLoc.
      
      The option (1) is used in current implementation. This mostly works.
      But if one instruction is somehow generated from multiple functions,
      the compiler has to pick just one. This may cause a mismatch between
      file_name and line_num/col_num.
      
      Besides potential incorrect mismatch of file_name vs. line_num/col_num,
      There is another issue where some DebugLoc has line number 0. For
      example,
      I dumped the dwarf line table for the above bpf program:
          
      Address Line Column File ISA Discriminator OpIndex Flags
      ------------------ ------ ------ ------ --- ------------- -------
      -------------
      0x0000000000000000 96 0 17 0 0 0 is_stmt
      0x0000000000000010 100 12 17 0 0 0 is_stmt prologue_end
            0x0000000000000020      0     12     17   0             0       0
      0x0000000000000058 37 7 17 0 0 0 is_stmt
            0x0000000000000060      0      0     17   0             0       0
            0x0000000000000088     37      7     17   0             0       0
      0x0000000000000090 42 75 17 0 0 0 is_stmt
            0x00000000000000a8     42     52     17   0             0       0
      0x00000000000000c0 120 9 17 0 0 0 is_stmt
            0x00000000000000c8      0      9     17   0             0       0
      0x00000000000000d0 106 21 17 0 0 0 is_stmt
            0x00000000000000d8    106      3     17   0             0       0
      0x00000000000000e0 110 25 17 0 0 0 is_stmt
            0x00000000000000f8    110     36     17   0             0       0
            0x0000000000000100      0     36     17   0             0       0
            ...
          
      These DebugLoc with line number 0 needs to be skipped since we cannot
      map them to the correct source code. Note that selftest
      offset-reloc-basic.ll
      has this issue as well which is adjusted by this patch.
      
      With the above two fixes, empty lines for source annotation are removed.
      
        $ veristat -vl2 yhs.bpf.o --log-size=150000000 >& log
        $ rg '^;' log.latest | sort | uniq -c | sort -nr | head -n10
         4206 ; } else if (action->dry_run) { @ src_mitigations.h:57
         3907 ; if (now < start_allow_time) { @ ban.h:17
      3223 ; if (action->vip_id != ALL_VIPS_ID && action->vip_id != vip_id) {
      @ src_mitigations.h:85
      1737 ; pkt_info->is_dry_run_drop = action->dry_run; @
      src_mitigations.h:26
         1737 ; if (mitigation == ALLOW) { @ src_mitigations.h:28
      1737 ; enum match_action mitigation = action->action; @
      src_mitigations.h:25
      1727 ; void* res = bpf_map_lookup_elem(bpf_map, key); @
      filter_helpers.h:498
      1691 ; bpf_map_lookup_elem(&rate_limit_config_map, rule_id); @
      rate_limit.h:76
         1688 ; if (throttle_cfg) { @ rate_limit.h:85
         1670 ; if (rl_cfg) { @ rate_limit.h:77
      
      You can see that we do not have empty line any more.
      
      3223 ; if (action->vip_id != ALL_VIPS_ID && action->vip_id != vip_id) {
      @ src_mitigations.h:85
      
      Signed-off-by: default avatarYonghong Song <yonghong.song@linux.dev>
      4c701577
    • Joseph Huber's avatar
      [Libomptarget] Rework interface for enabling plugins (#86875) · b07177fb
      Joseph Huber authored
      Summary:
      Previously we would build all of the plugins by default and then only
      load some using the `LIBOMPTARGET_PLUGINS_TO_LOAD` variable. This patch
      renamed this to `LIBOMPTARGET_PLUGINS_TO_BUILD` and changes whether or
      not it will include the plugin in CMake.
      
      Additionally this patch creates a new `Targets.def` file that allows us
      to enumerate all of the enabled plugins. This is somewhat different from
      the old method, and it's done this way for future use that will need to
      be shared. This follows the same method that LLVM uses for its targets,
      however it does require adding an extra include path.
      
      Depends on https://github.com/llvm/llvm-project/pull/86868
      b07177fb
    • Jared Grubb's avatar
      [Clang] Add diagnostic about "%P" specifier with Objective-C pointers (#89977) · e3750fb6
      Jared Grubb authored
      A Darwin extension '%P' combined with an Objective-C pointer seems to
      always be a bug.
      
      '%P' will dump bytes at the pointed-to address (in contrast to '%p'
      which dumps the pointer itself). This extension is only allowed in "OS
      Log" contexts and is intended to be used like `%{uuid_t}.*16P` or
      `%{timeval}.*P`. If an ObjC pointer is used, then the internal runtime
      structure (aka, the is-a pointer and other runtime metadata) will be
      dumped, which (IMO) is never the expectation.
      
      A simple diagnostic can help flag these scenarios.
      
      Resolves https://github.com/llvm/llvm-project/issues/89968
      
      
      
      Co-authored-by: default avatarJared Grubb <jgrubb@apple.com>
      e3750fb6
    • Pol Marcet Sardà's avatar
      Squashed commit of the following: · 2903df02
      Pol Marcet Sardà authored
      
      
      commit 8d41d93e3fceb3f3af77266f5a8388fc585150a5
      Author: Pol Marcet Sardà <polmarcetsarda@gmail.com>
      Date:   Sat Apr 20 12:19:49 2024 +0200
      
          Address some misc comments; added a diagnostic and expanded macros in
          testing.
      
      commit 9493c0f290b558947d8b3ae8e1adf909b0fb9dcd
      Author: Pol Marcet Sardà <polmarcetsarda@gmail.com>
      Date:   Sun Mar 31 18:18:45 2024 +0200
      
          Following the review of sethp, I have made the following changes:
      
          -- Added diagnostic for the undefined shuffle of -1
          -- Validated support for _BitInt
          -- A bunch of other minnor tweaks here and there
      
      commit 8273abc8d56ef8225cf4dba84f66a1e54a2ef036
      Author: Pol Marcet Sardà <polmarcetsarda@gmail.com>
      Date:   Thu Jan 4 12:31:08 2024 +0100
      
          Fix typo in file name
      
      commit ff68f23921966c7d9605f91a47d6b481bf1d7a7b
      Author: Pol Marcet Sardà <polmarcetsarda@gmail.com>
      Date:   Thu Jan 4 11:26:08 2024 +0100
      
          Address suggestions from RKSimon
      
      commit c14783de45687c754253c0cbf8a7834c7f986d80
      Author: Pol Marcet Sardà <polmarcetsarda@gmail.com>
      Date:   Sat Dec 30 13:59:00 2023 +0100
      
          [clang] Constexpr for __builtin_shufflevector and __builtin_convertvector
      
          Summary:
      
          This patch adds constexpr support for __builtin_shufflevector
          and __builtin_convertvector.
      
          A small oddity encountered was that the arg to the intrinsics may be an
          lvalue without any sort of implicit cast of any kind. I solved this
          through the EvaluateVectorOrLValue function, which treats the lvalue as
          if it was in an rvalue cast, which gets me the desired vector.
      
      Co-Authored-By: default avatarSeth Pellegrino <seth@codecopse.net>
      2903df02
    • Amir Ayupov's avatar
      [Object] Provide operator< for ELFSymbolRef (#89861) · df6d2faa
      Amir Ayupov authored
      Normally, operator< accepting DataRefImpl is used when comparing
      SymbolRef/ELFSymbolRef. However, it uses std::memcmp which interprets
      DataRefImpl union as char string so that the result depends on host
      endianness.
      For ELFSymbolRef a specialized operator< can be used instead to produce
      consistent ordering regardless of endianness by comparing the symbol
      table index and symbol index fields separately.
      df6d2faa
    • Kai Nacke's avatar
      [TableGen][GISel] Handle frameindex/tframeindex (#90475) · 1e174a76
      Kai Nacke authored
      Support patterns like
      
        Pat<(p0 frameindex:$fi), (ADD tframeindex:$fi, 0)>;
      
      in the GlobalISel emitter in TableGen. Currently, using such a pattern
      results in an error message.
      1e174a76
  2. Apr 29, 2024