Changes

Summary

  1. [Orc][LLJIT] Use JITLink on RISC-V (details)
  2. [OffloadPackager] Use appropriate kind for LTO bitcode (details)
  3. [InstCombine] add helper function for sub-of-min/max folds; NFC (details)
  4. [InstCombine] add tests for sub of smin/smax; NFC (details)
  5. [InstCombine] fold sub of min/max of sub with common operand (details)
Commit a4e2c1f762959b18f185cec4fd30d9ba982d4af5 by hahnjo
[Orc][LLJIT] Use JITLink on RISC-V

RuntimeDyld does not support RISC-V, so it makes sense to enable
JITLink by default. This also makes relocations work without support
for a large code model.

Differential Revision: https://reviews.llvm.org/D129092
The file was modifiedllvm/lib/ExecutionEngine/Orc/LLJIT.cpp
Commit b6178ccfe85238e123ecf29a12af23d3b70bef22 by jhuber6
[OffloadPackager] Use appropriate kind for LTO bitcode

Summary:
Currently we just check the extension to set the image kind. This
incorrectly labels the `.o` files created during LTO as object files.
This patch simply adds a check for the bitcode magic bytes instead.
The file was modifiedclang/tools/clang-offload-packager/CMakeLists.txt
The file was modifiedclang/tools/clang-offload-packager/ClangOffloadPackager.cpp
Commit 4276d00b125351ebb2420e598332800976809a9e by spatel
[InstCombine] add helper function for sub-of-min/max folds; NFC

The test diffs are cosmetic -- but improvements -- because we
let instcombine handle replacement. Instead of dropping the
old value name, it propagates to the new instruction.
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sub-minmax.ll
Commit 8ef053273abf2ae3ae05801808908af9dd7887c3 by spatel
[InstCombine] add tests for sub of smin/smax; NFC

issue #55470
The file was modifiedllvm/test/Transforms/InstCombine/sub-minmax.ll
Commit 142aca7741d5b06207e87bf4880fbe308c8d6823 by spatel
[InstCombine] fold sub of min/max of sub with common operand

  x - max(x - y, 0) --> min(x, y)
  x - min(x - y, 0) --> max(x, y)

https://alive2.llvm.org/ce/z/2YkqFe

issue #55470
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
The file was modifiedllvm/test/Transforms/InstCombine/sub-minmax.ll