Issue |
120696
|
Summary |
DSE removes store to an alloca that is passed to a byval parameter
|
Labels |
new issue
|
Assignees |
|
Reporter |
rofirrim
|
The following IR, which I think is correct (but I admit I'm not 100% sure due to the constraints of `tail` calls though I think the `byval` makes it correct?)
```llvm
%_QMmooTtoken_t = type { [64 x i32] }
define void @_QMmooPsub(ptr nocapture %0) #0 {
%2 = alloca %_QMmooTtoken_t, i64 1, align 8
%3 = load %_QMmooTtoken_t, ptr %0, align 4
store %_QMmooTtoken_t %3, ptr %2, align 4
tail call void @foo(ptr %2)
ret void
}
declare void @foo(ptr byval(%_QMmooTtoken_t) align 4) local_unnamed_addr
```
is simplified by DSE (`opt -passes=dse`) like so:
```llvm
%_QMmooTtoken_t = type { [64 x i32] }
define void @_QMmooPsub(ptr nocapture %0) {
%2 = alloca %_QMmooTtoken_t, i64 1, align 8
tail call void @foo(ptr %2)
ret void
}
declare void @foo(ptr byval(%_QMmooTtoken_t) align 4) local_unnamed_addr
```
which I don't think preserves the original meaning because we're now passing a copy (`byval`) of an uninitialised value into `@foo` rather than the value pointed by `%0`.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs