Closed mattst88 closed 3 months ago
cc: @AlexeySotkin
Looks like Alexey is no longer working on SPIR-V.
Maybe @MrSidims can offer some advice.
I talked with Alexey and he explained how this works to me and pointed me to https://llvm.org/docs/CommandGuide/FileCheck.html#the-filecheck-check-prefix-option
Now that I understand a little bit better, I think I've recognized what the real problem is: these tests compile some .ll
files with target triple = spir64-unknown-unknown
and check for some x86-64-specifics in the resulting output, but there's no connection between spir64-unknown-unknown
and x86-64.
AFAIU, spir64-unknown-unknown
is SPIR-V targets a platform with 64-bit pointers and spir-unknown-unknown
targets a platform with 32-bit pointers. I assume you can compile -mtriple=spir64-unknown-unknown
for any CPU architecture LLVM supports, so checking for assembly instructions for a particular CPU isn't reliable.
Does this make sense?
@mattst88 thanks for the contribution! We can either put something like REQUIRES: X86-64 or create a check logic depending on the architecture. I just returned from a vacation and will take a look throughout the day at the problem and suggest the appropriate changes.
@mattst88 agree, mtriple should be not %triple in this case. Instead it should be either x86_64-unknown-linux-gnu with the CHECK lines remain to be as is or instead RUN strings be duplicated having both 32 and 64 bit triples with the appropriate FileChecks to be FileCheck %s --check-prefixes=CHECK-x86-64
and FileCheck %s --check-prefixes=CHECK-X86-32
.
I would ask you to just set triple -mtriple=x86_64-unknown-linux-gnu in this PR and if necessary we extend the testing on our own.
The updated PR works for me on SPIRV-LLVM-Translator 17 and 18.1.
It was generated by
sed -i -e 's/%triple/x86_64-unknown-linux-gnu/' \
test/DebugInfo/X86/dbg-declare-alloca.ll \
test/DebugInfo/X86/dbg-declare-arg.ll \
test/DebugInfo/X86/dbg-value-const-byref.ll \
test/DebugInfo/X86/dw_op_minus_direct.ll \
test/DebugInfo/X86/dwarf-aranges-no-dwarf-labels.ll \
test/DebugInfo/X86/frame-register.ll \
test/DebugInfo/X86/this-stack_value.ll
That was enough to make the whole test suite pass on x86-32, but there are still failures when running it on other platforms like aarch64. Looks like sed -i -e 's/%triple/x86_64-unknown-linux-gnu/' test/DebugInfo/X86/*.ll
is enough to make at least all of test/DebugInfo/X86
pass on aarch64.
Should I update the PR to do that?
Should I update the PR to do that?
Speculatively updated.
Does this look good to you, @MrSidims?
These tests fail on 32-bit x86:
The causes are all pretty simple differences from the x86-64 expectations in the tests today. E.g.:
Or
With these expectation updates, the test suite passes on x86-32:
However, I do not know how to conditionalize the
CHECK
/CHECK-NEXT
/DWARF
/DWARF-NEXT
statements. I found that some tests in LLVM useX86
/X86-NEXT
/X64
/X64-NEXT
statements, but I do not understand things well enough to use them in these tests. This is where I need help.