As part of https://discourse.llvm.org/t/rfc-remove-most-constant-expressions/63179, this removes support for and and or constant expressions. Places creating such expressions have been migrated in advance, so this is mostly API removal and test updates.
Details
Diff Detail
Event Timeline
This broke cross-language LTO with rust (based on LLVM 16) when e.g. building Firefox. It fails with this error message:
ThinLTO: /builds/worker/workspace/obj-build/x86_64-apple-darwin/release/libgkrust.a(rust_cascade-c3f1dd825cdd83c5.rust_cascade.d5b61b9a28017227-cgu.0.rcgu.o)2898: error: Invalid value reference from metadata LLVM ERROR: Can't load module, abort.
@glandium Could you please share the relevant bitcode file? We generally can't auto-upgrade constant expressions in metadata (because we can't materialize instructions in that context), but depending on how it is used, we may be able to drop it entirely.
It looks like the instruction in question is:
call void @llvm.dbg.value(metadata i64 or (i64 zext (i32 ptrtoint (ptr @anon.436463c58f189989edb51bc04335cb6d.21 to i32) to i64), i64 shl (i64 zext (i32 trunc (i64 lshr (i64 ptrtoint (ptr @anon.436463c58f189989edb51bc04335cb6d.21 to i64), i64 32) to i32) to i64), i64 32)), metadata !4453, metadata !DIExpression(DW_OP_LLVM_fragment, 64, 64)), !dbg !4493
@glandium Sorry for the long delay here. I've added support for expanding constant expressions in function metadata in https://github.com/llvm/llvm-project/commit/05b86a8fea23865e4a437efa9cb4f6844ccbf50e, so this should work fine now.
This either didn't work or wasn't enough. Or something else broke in between. I'll dig deeper and will open an issue.
Yeah, it's happening in a different file, now.
How did you figure out the exact instruction?