Skip to content

[vm] Use BoolToIntInstr in FlowGraphBuilder::BoolToInt #47487

Open
@dcharkes

Description

@dcharkes

Edit 2024-01-31: We should replace Fragment FlowGraphBuilder::BoolToInt to use BoolToIntInstr and implement BoolToIntInstr on the other platforms.

===== Old description =====

We could consider making IfThenElseInstr support unboxed output values.

It would remove two shifts (and a move) from the below code generated in FFI trampolines (after CL).

        ;; v111 <- IfThenElse(===, v12 T{*}, v41 ? 1 : 0) T{_Smi}
0x7f92e71a89e2    4833d2                 xorq rdx,rdx
0x7f92e71a89e5    493b9ed0000000         cmpq rbx,[thr+0xd0]   true
0x7f92e71a89ec    0f94c2                 setzl rdx
0x7f92e71a89ef    48d1e2                 shlq rdx,1
        ;; ParallelMove rbx <- rdx
0x7f92e71a89f2    4889d3                 movq rbx,rdx
        ;; v77 <- UnboxUint32([tr], [non-speculative], v111) T{int}
0x7f92e71a89f5    48d1fb                 sarq rbx,1

Metadata

Metadata

Assignees

Labels

area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.contributions-welcomeContributions welcome to help resolve this (the resolution is expected to be clear from the issue)vm-technical-debtThis label tries to capture all the technical debt that we have accumulated in the Dart VM

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions