Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[EarlyCSE] Don't DSE across readnone functions that may throw
Summary: Depends on D28740 Reviewers: dberlin, chandlerc, hfinkel, majnemer Subscribers: mcrosier, llvm-commits Differential Revision: https://reviews.llvm.org/D28741 llvm-svn: 292249
- Loading branch information
Showing
2 changed files
with
22 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; RUN: opt -S -early-cse < %s | FileCheck %s | ||
|
||
declare void @readnone_may_unwind() readnone | ||
|
||
define void @f(i32* %ptr) { | ||
; CHECK-LABEL: @f( | ||
; CHECK: store i32 100, i32* %ptr | ||
; CHECK: call void @readnone_may_unwind() | ||
; CHECK: store i32 200, i32* %ptr | ||
|
||
store i32 100, i32* %ptr | ||
call void @readnone_may_unwind() | ||
store i32 200, i32* %ptr | ||
ret void | ||
} |