mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-08 11:37:03 +00:00
Fix errors in this llvm ir example.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131416 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
97c07dac7f
commit
64f9fb1975
@ -2446,11 +2446,11 @@ entry:
|
|||||||
|
|
||||||
%narrowaddr = bitcast i32* @g to i16*
|
%narrowaddr = bitcast i32* @g to i16*
|
||||||
%wideaddr = bitcast i32* @g to i64*
|
%wideaddr = bitcast i32* @g to i64*
|
||||||
%trap3 = load 16* %narrowaddr ; Returns a trap value.
|
%trap3 = load i16* %narrowaddr ; Returns a trap value.
|
||||||
%trap4 = load i64* %widaddr ; Returns a trap value.
|
%trap4 = load i64* %wideaddr ; Returns a trap value.
|
||||||
|
|
||||||
%cmp = icmp i32 slt %trap, 0 ; Returns a trap value.
|
%cmp = icmp slt i32 %trap, 0 ; Returns a trap value.
|
||||||
%br i1 %cmp, %true, %end ; Branch to either destination.
|
br i1 %cmp, label %true, label %end ; Branch to either destination.
|
||||||
|
|
||||||
true:
|
true:
|
||||||
volatile store i32 0, i32* @g ; This is control-dependent on %cmp, so
|
volatile store i32 0, i32* @g ; This is control-dependent on %cmp, so
|
||||||
@ -2467,19 +2467,19 @@ end:
|
|||||||
; if %cmp is true, or the store in %entry
|
; if %cmp is true, or the store in %entry
|
||||||
; otherwise, so this is undefined behavior.
|
; otherwise, so this is undefined behavior.
|
||||||
|
|
||||||
%br i1 %cmp, %second_true, %second_end
|
br i1 %cmp, label %second_true, label %second_end
|
||||||
; The same branch again, but this time the
|
; The same branch again, but this time the
|
||||||
; true block doesn't have side effects.
|
; true block doesn't have side effects.
|
||||||
|
|
||||||
second_true:
|
second_true:
|
||||||
; No side effects!
|
; No side effects!
|
||||||
br label %end
|
ret void
|
||||||
|
|
||||||
second_end:
|
second_end:
|
||||||
volatile store i32 0, i32* @g ; This time, the instruction always depends
|
volatile store i32 0, i32* @g ; This time, the instruction always depends
|
||||||
; on the store in %end. Also, it is
|
; on the store in %end. Also, it is
|
||||||
; control-equivalent to %end, so this is
|
; control-equivalent to %end, so this is
|
||||||
; well- defined (again, ignoring earlier
|
; well-defined (again, ignoring earlier
|
||||||
; undefined behavior in this example).
|
; undefined behavior in this example).
|
||||||
</pre>
|
</pre>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user