Closed MrSidims closed 1 month ago
The upstream RFC contains a list of constant expressions that will remain supported. Among those are inttoptr
and ptrtoint
which seem to be in this test too; so perhaps we should leave some testing in place?
As a first step, I think this particular test can be removed. There are other tests that do cover some of the supported const expressions. A cleanup to remove any unsupported const expressions may be warranted. Or I am also ok to react to fails if/when they crop up.
Thanks for addressing this @MrSidims
We still have tests like test/constexpr_phi.ll and test/constexpr_vector.ll (and may be elsewhere, which I can not find with ease using gitlog on SPIRVLowerConstExpr.cpp), both of them have bitcasts and ptrtoint used in constexpr context. I have an idea, will update PR in few minutes.
@svenvh @asudarsa should be slightly better. We ran out of the instructions to be used in constexpr context, but like this should be fine (bitcast from inttoptr) as it keeps original purpose of the test "calling one instruction from another to determine argument of a function call". I also simplified the test leaving "the latest" SPIR-V version there.
It started to fail again after deab451e7a7f . Only bitcast to inttoptr has left in constexpr context in this test.
TODO: do code cleanup in lib/SPIRV/SPIRVLowerConstExpr.cpp