https://bugs.llvm.org/show_bug.cgi?id=40455
Bug ID: 40455
Summary: CodeExtractor miscompiles invokes with uses outside of
the extraction region
Product: libraries
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Interprocedural Optimizations
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
The pattern that triggers the miscompile is:
```
extract1:
%call = invoke i8* @foo(...)
to label %outside-extraction-region unwind label %extract2
extract2:
landingpad i8 cleanup
ret void
outside-extraction-region:
call void @use(i8* %call)
ret void
```
When CodeExtractor extracts the blocks extract{1,2}, it sees that %call is used
outside of the extraction region. So it extracts the invoke and stores its
result in an in-out param ("%call.out"). But the store is placed in
%outside-extraction-region, i.e., in the wrong function.
To fix this, exit stubs need to be created before stores to outputs occur.
Then, the store to the in-out param can be placed in the exit stub where it
belongs.
--
You are receiving this mail because:
You are on the CC list for the bug._______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs