This should fix https://github.com/llvm/llvm-project/issues/58890
Details
Diff Detail
Event Timeline
Can you please add a test case?
What about other unsized types? This is probably not a token specific problem.
hey: I've attached a test case in the original github issue, not sure what else should be done here?
@Naville It looks like current test coverage is practically non-existent, but you can add your test case to llvm/test/Transforms/Reg2Mem.
@nikic Added, anything more needed to do? I say we keep it restricted to token type for now and fix future issues if they appear
llvm/lib/Transforms/Scalar/Reg2Mem.cpp | ||
---|---|---|
43 | Check !Inst.getType()->isSized() instead. Also drop the {} for single-line if. You can add this to your test case to test a non-token unsized value: %opaque = type opaque declare %opaque @ret_opaque() declare void @pass_opaque(%opaque) define void @test() { %x = call %opaque @ret_opaque() br label %next next: call void @pass_opaque(%opaque %x) ret void } | |
llvm/test/Transforms/Reg2Mem/catchswitch-crash.ll | ||
2 | Use RUN: opt -passes=reg2mem -S < %s | FileCheck %s and update_test_checks.py to generate check lines. | |
7 | Drop all of these, they shouldn't be necessary. | |
11 | Drop the dso_local and local_unnamed_addr, they shouldn't be necessary. | |
34 | Drop the attributes and metadata, they shouldn't be necessary. |
llvm/test/Transforms/Reg2Mem/catchswitch-crash.ll | ||
---|---|---|
2 | It looks like something went wrong here and no check lines were generated, which makes the test fail now. I wonder whether this might be related to the weird function names? Maybe replacing them with something like @test would make it work? |
@nikic Thanks, yeah the Windows name mangling was the issue, guess that's a bug for another day. Updated the test case which now has proper "CHECK*" tags
LGTM
If you don't have commit access, can you tell me which Name <email> to use for the commit?
Check !Inst.getType()->isSized() instead. Also drop the {} for single-line if.
You can add this to your test case to test a non-token unsized value: