Skip to content

Conversation

@0xzre
Copy link
Contributor

@0xzre 0xzre commented Dec 29, 2025

Resolves #173770

Adds m_SpecificNeg(SDValue V) to match either m_Neg(m_Specific(V)) or
constant/build-vector where elements are the negation of V's constants

Has unit test coverage on SelectionDAGPatternMatchTest.cpp

@github-actions
Copy link

🪟 Windows x64 Test Results

  • 128963 tests passed
  • 2842 tests skipped
  • 1 test failed

Failed Tests

(click on a test name to see its output)

LLVM-Unit

LLVM-Unit.CodeGen/_/CodeGenTests_exe/15/39
Script(shard):
--
GTEST_OUTPUT=json:C:\_work\llvm-project\llvm-project\build\unittests\CodeGen\.\CodeGenTests.exe-LLVM-Unit-26168-15-39.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=39 GTEST_SHARD_INDEX=15 C:\_work\llvm-project\llvm-project\build\unittests\CodeGen\.\CodeGenTests.exe
--

Note: This is test shard 16 of 39.

[==========] Running 8 tests from 8 test suites.

[----------] Global test environment set-up.

[----------] 1 test from AsmPrinterEmitDwarfSymbolReferenceTest

[ RUN      ] AsmPrinterEmitDwarfSymbolReferenceTest.ELFDWARF64

[       OK ] AsmPrinterEmitDwarfSymbolReferenceTest.ELFDWARF64 (0 ms)

[----------] 1 test from AsmPrinterEmitDwarfSymbolReferenceTest (0 ms total)



[----------] 1 test from DroppedVariableStatsMIR

[ RUN      ] DroppedVariableStatsMIR.UnrelatedScopes

!dbg attachment points at wrong subprogram for function

!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !9)

ptr @_Z3fooi

  %add = add nsw i32 %x, 1, !dbg !12

!12 = !DILocation(line: 2, column: 11, scope: !13)

!13 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !9)

!13 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !9)

invalid retained nodes, retained node does not belong to subprogram

!13 = distinct !DISubprogram(name: "bar", linkageName: "_Z3bari", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !9)

!9 = !{!10}

!10 = !DILocalVariable(name: "x", arg: 1, scope: !4, file: !5, line: 1, type: !8)

!4 = distinct !DISubprogram(name: "foo", linkageName: "_Z3fooi", scope: !5, file: !5, line: 1, type: !6, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !9)

warning: ignoring invalid debug info in 

[       OK ] DroppedVariableStatsMIR.UnrelatedScopes (7 ms)

[----------] 1 test from DroppedVariableStatsMIR (7 ms total)



[----------] 1 test from LowLevelTypeTest

[ RUN      ] LowLevelTypeTest.Divide

[       OK ] LowLevelTypeTest.Divide (0 ms)

[----------] 1 test from LowLevelTypeTest (0 ms total)



[----------] 1 test from MachineOperandTest

[ RUN      ] MachineOperandTest.PrintJumpTableIndex

[       OK ] MachineOperandTest.PrintJumpTableIndex (0 ms)

[----------] 1 test from MachineOperandTest (0 ms total)



[----------] 1 test from ResourceSegmentsDeath

[ RUN      ] ResourceSegmentsDeath.OverwriteOnRight

[       OK ] ResourceSegmentsDeath.OverwriteOnRight (47 ms)

[----------] 1 test from ResourceSegmentsDeath (47 ms total)



[----------] 1 test from SelectionDAGAddressAnalysisTest

[ RUN      ] SelectionDAGAddressAnalysisTest.fixedSizeFrameObjectsOutOfDiff

[       OK ] SelectionDAGAddressAnalysisTest.fixedSizeFrameObjectsOutOfDiff (2 ms)

[----------] 1 test from SelectionDAGAddressAnalysisTest (2 ms total)



[----------] 1 test from SelectionDAGPatternMatchTest

[ RUN      ] SelectionDAGPatternMatchTest.MatchSpecificNeg

Assertion failed: llvm::isUIntN(BitWidth, val) && "Value is not an N-bit unsigned value", file C:\_work\llvm-project\llvm-project\llvm\include\llvm/ADT/APInt.h, line 128


--
exit: 3
--
shard JSON output does not exist: C:\_work\llvm-project\llvm-project\build\unittests\CodeGen\.\CodeGenTests.exe-LLVM-Unit-26168-15-39.json

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@github-actions
Copy link

🐧 Linux x64 Test Results

  • 167503 tests passed
  • 2970 tests skipped
  • 1 test failed

Failed Tests

(click on a test name to see its output)

LLVM-Unit

LLVM-Unit.CodeGen/_/CodeGenTests/18/77
Script(shard):
--
GTEST_OUTPUT=json:/home/gha/actions-runner/_work/llvm-project/llvm-project/build/unittests/CodeGen/./CodeGenTests-LLVM-Unit-1183681-18-77.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=77 GTEST_SHARD_INDEX=18 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/unittests/CodeGen/./CodeGenTests
--

Note: This is test shard 19 of 77.
[==========] Running 4 tests from 4 test suites.
[----------] Global test environment set-up.
[----------] 1 test from AsmPrinterEmitDwarfStringOffsetTest
[ RUN      ] AsmPrinterEmitDwarfStringOffsetTest.DWARF32NoRelocationsAcrossSections
[       OK ] AsmPrinterEmitDwarfStringOffsetTest.DWARF32NoRelocationsAcrossSections (0 ms)
[----------] 1 test from AsmPrinterEmitDwarfStringOffsetTest (0 ms total)

[----------] 1 test from LowLevelTypeTest
[ RUN      ] LowLevelTypeTest.ConstExpr
[       OK ] LowLevelTypeTest.ConstExpr (0 ms)
[----------] 1 test from LowLevelTypeTest (0 ms total)

[----------] 1 test from ResourceSegmentsDeath
[ RUN      ] ResourceSegmentsDeath.OverwriteOnLeft
[       OK ] ResourceSegmentsDeath.OverwriteOnLeft (0 ms)
[----------] 1 test from ResourceSegmentsDeath (0 ms total)

[----------] 1 test from SelectionDAGPatternMatchTest
[ RUN      ] SelectionDAGPatternMatchTest.MatchSpecificNeg
CodeGenTests: /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/APInt.h:128: llvm::APInt::APInt(unsigned int, uint64_t, bool, bool): Assertion `llvm::isUIntN(BitWidth, val) && "Value is not an N-bit unsigned value"' failed.

--
exit: -6
--
shard JSON output does not exist: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/unittests/CodeGen/./CodeGenTests-LLVM-Unit-1183681-18-77.json

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[DAG] SDPatternMatch - add a m_SpecificNeg() matcher

1 participant