Issue 97375
Summary [DebugInfo][SpeculativeExecution] Hoisting an in-branch instruction without dropping its debug location
Labels debuginfo, new issue, llvm:transforms
Assignees
Reporter Apochens
    [**SpeculativeExecution-L330**](https://github.com/llvm/llvm-project/blob/9b8c2fae38bcff0b16d996ee002ff1e989fa23ea/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp#L330)

In function `considerHoistingFromTo`, instructions in one of the `else` or `then` branch will be hoisted out of the branch, but no debug location dropping is performed. (`considerHoistingFromTo` is called in function [`runOnBasicBlock`](https://github.com/llvm/llvm-project/blob/9b8c2fae38bcff0b16d996ee002ff1e989fa23ea/llvm/lib/Transforms/Scalar/SpeculativeExecution.cpp#L169))

```cpp
if (!NotHoisted.count(&*Current)) {
 Current->moveBefore(ToBlock.getTerminator());
}
```

godbolt: https://godbolt.org/z/E9r3bTnYb (the hoisted add instruction)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to