Skip to content

Commit 867c2b6

Browse files
committed
Merge branch 'main' of https://github.com/llvm/llvm-project into index-to-i1
2 parents 5a93428 + 4829ded commit 867c2b6

File tree

7 files changed

+13581
-4719
lines changed

7 files changed

+13581
-4719
lines changed

lld/test/MachO/objc-category-merging-minimal.s

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
############ Test merging skipped due to invalid category name ############
3535
# Modify __OBJC_$_CATEGORY_MyBaseClass_$_Category01's name to point to L_OBJC_IMAGE_INFO+3
36-
# RUN: awk '/^__OBJC_\$_CATEGORY_MyBaseClass_\$_Category01:/ { print; getline; sub(/^[ \t]*\.quad[ \t]+l_OBJC_CLASS_NAME_$/, "\t.quad\tL_OBJC_IMAGE_INFO+3"); print; next } { print }' merge_cat_minimal.s > merge_cat_minimal_bad_name.s
36+
# RUN: awk '/^__OBJC_\\$_CATEGORY_MyBaseClass_\\$_Category01:/ { print; getline; sub(/^[ \t]*\.quad[ \t]+l_OBJC_CLASS_NAME_$/, "\t.quad\tL_OBJC_IMAGE_INFO+3"); print; next } { print }' merge_cat_minimal.s > merge_cat_minimal_bad_name.s
3737

3838
# Assemble the modified source
3939
# RUN: llvm-mc -filetype=obj -triple=arm64-apple-macos -o merge_cat_minimal_bad_name.o merge_cat_minimal_bad_name.s

lld/test/lit.cfg.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,21 @@
1616
# name: The name of this test suite.
1717
config.name = "lld"
1818

19+
# TODO: Consolidate the logic for turning on the internal shell by default for all LLVM test suites.
20+
# See https://github.com/llvm/llvm-project/issues/106636 for more details.
21+
#
22+
# We prefer the lit internal shell which provides a better user experience on failures
23+
# and is faster unless the user explicitly disables it with LIT_USE_INTERNAL_SHELL=0
24+
# env var.
25+
use_lit_shell = True
26+
lit_shell_env = os.environ.get("LIT_USE_INTERNAL_SHELL")
27+
if lit_shell_env:
28+
use_lit_shell = lit.util.pythonize_bool(lit_shell_env)
29+
1930
# testFormat: The test format to use to interpret tests.
2031
#
2132
# For now we require '&&' between commands, until they get globally killed and the test runner updated.
22-
config.test_format = lit.formats.ShTest(not llvm_config.use_lit_shell)
33+
config.test_format = lit.formats.ShTest(execute_external=not use_lit_shell)
2334

2435
# suffixes: A list of file extensions to treat as test files.
2536
config.suffixes = [".ll", ".s", ".test", ".yaml", ".objtxt"]

llvm/include/llvm/CodeGen/GlobalISel/LegalizerHelper.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,43 @@ class LegalizerHelper {
364364
LLT HalfTy,
365365
LLT ShiftAmtTy);
366366

367+
/// Multi-way shift legalization: directly split wide shifts into target-sized
368+
/// parts in a single step, avoiding recursive binary splitting.
369+
LLVM_ABI LegalizeResult narrowScalarShiftMultiway(MachineInstr &MI,
370+
LLT TargetTy);
371+
372+
/// Optimized path for constant shift amounts using static indexing.
373+
/// Directly calculates which source parts contribute to each output part
374+
/// without generating runtime select chains.
375+
LLVM_ABI LegalizeResult narrowScalarShiftByConstantMultiway(MachineInstr &MI,
376+
const APInt &Amt,
377+
LLT TargetTy,
378+
LLT ShiftAmtTy);
379+
380+
struct ShiftParams {
381+
Register WordShift; // Number of complete words to shift
382+
Register BitShift; // Number of bits to shift within words
383+
Register InvBitShift; // Complement bit shift (TargetBits - BitShift)
384+
Register Zero; // Zero constant for SHL/LSHR fill
385+
Register SignBit; // Sign extension value for ASHR fill
386+
};
387+
388+
/// Generates a single output part for constant shifts using direct indexing.
389+
/// Calculates which source parts contribute and how they're combined.
390+
LLVM_ABI Register buildConstantShiftPart(unsigned Opcode, unsigned PartIdx,
391+
unsigned NumParts,
392+
ArrayRef<Register> SrcParts,
393+
const ShiftParams &Params,
394+
LLT TargetTy, LLT ShiftAmtTy);
395+
396+
/// Generates a shift part with carry for variable shifts.
397+
/// Combines main operand shifted by BitShift with carry bits from adjacent
398+
/// operand.
399+
LLVM_ABI Register buildVariableShiftPart(unsigned Opcode,
400+
Register MainOperand,
401+
Register ShiftAmt, LLT TargetTy,
402+
Register CarryOperand = Register());
403+
367404
LLVM_ABI LegalizeResult fewerElementsVectorReductions(MachineInstr &MI,
368405
unsigned TypeIdx,
369406
LLT NarrowTy);

0 commit comments

Comments
 (0)