Issue 235728
Summary llubi accepts a value change after an invariant load
Labels new issue
Assignees
Reporter Roticv912
    A byte read by an !invariant.load is subsequently changed while the allocation remains accessible without any undefined behavior diagnostic.

### Program
```llvm
!0 = !{}

define i32 @main() {
entry:
  %p = alloca i8
  store i8 0, ptr %p
  %x = load i8, ptr %p, !invariant.load !0
  store i8 1, ptr %p
  ret i32 0
}
```

### Output
```
Entering function: main
  %p = alloca i8, align 1 => ptr 0x8 [p]
  store i8 0, ptr %p, align 1
  %x = load i8, ptr %p, align 1, !invariant.load !0 => i8 0
  store i8 1, ptr %p, align 1
  ret i32 0
Exiting function: main
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to