Skip to content

Non-deterministic results from MemorySSAUpdater due to iteration order #132926

Open
@mikaelholmen

Description

@mikaelholmen

llvm commit: 6e66cfe

Build opt with and without LLVM_ENABLE_REVERSE_ITERATION and then do:

build-all/bin/opt "-passes=loop-mssa(licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>)" bbi-104167.ll -o bbi-104167.norev.ll -S
build-all-reverse/bin/opt "-passes=loop-mssa(licm<no-allowspeculation>,loop-rotate<header-duplication;no-prepare-for-lto>,licm<allowspeculation>)" bbi-104167.ll -o bbi-104167.rev.ll -S

Then if we diff the two output files:

diff bbi-104167.norev.ll bbi-104167.rev.ll

we get

11d10
<   %0 = load ptr, ptr @ao, align 1
15c14
<   %1 = load volatile i32, ptr null, align 1
---
>   %0 = load volatile i32, ptr null, align 1
42c41
<   %2 = load volatile i16, ptr null, align 1
---
>   %1 = load volatile i16, ptr null, align 1
77c76,77
<   store double 0.000000e+00, ptr %0, align 1
---
>   %2 = load ptr, ptr @ao, align 1
>   store double 0.000000e+00, ptr %2, align 1

bbi-104167.ll.gz

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions