Skip to content

Fix ConstStringFolder ICmp lowering for self-host probe (#1056, #1086)#1160

Merged
PurHur merged 2 commits into
masterfrom
fix/wave12-selfhost-probe-icmp
May 23, 2026
Merged

Fix ConstStringFolder ICmp lowering for self-host probe (#1056, #1086)#1160
PurHur merged 2 commits into
masterfrom
fix/wave12-selfhost-probe-icmp

Conversation

@PurHur
Copy link
Copy Markdown
Owner

@PurHur PurHur commented May 23, 2026

Summary

  • Fix LLVM ICmp type mismatch in ConstStringFolder::sourceDir by loading boxed value type tags via JitValueBox::valuePtrFromVariable in JitStringCompare::identicalValueToString (was comparing %__ref__ against i8 type tags).
  • Re-enable ConstStringFolder real JIT lowering (reverts Fix self-host probe LLVM call typing after value-box property regression (#1080) #1097 stub-only policy) with supporting fixes: value-box/object ===, foreach object copy, and simplified realpath checks in sourceDir.

Root cause

'' !== $resolved in ConstStringFolder::sourceDir lowers to string-vs-boxed !==. identicalValueToString used the raw __value__ alloca ($boxed->value) instead of a __value__* pointer, so structGep(..., 'type') read the wrong field and produced invalid icmp eq %__ref__ ..., i8 <tag> IR.

Test plan

  • make bootstrap-selfhost-probe exit 0
  • ./script/bootstrap-wave-check.sh green (selfhost-lint, aot-lint, probe)
  • test/bootstrap-aot/const_string_folder_* via aot-lint

refs #1056, #1086

Made with Cursor

PurHur and others added 2 commits May 23, 2026 21:11
Use JitValueBox::valuePtrFromVariable for string/boxed === comparisons so
type-tag loads use __value__* not __ref__ structs. Re-enable ConstStringFolder
real JIT lowering with value/object identity and foreach object copy support.

Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve JIT.php conflict: keep ConstStringFolder real LLVM lowering
(PR #1160) and drop master's short-name stub skip list for those methods.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur PurHur merged commit 13fc037 into master May 23, 2026
@PurHur PurHur deleted the fix/wave12-selfhost-probe-icmp branch May 23, 2026 19:24
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.

1 participant