Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
swiftshader
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
swiftshader
Commits
360e3197
Commit
360e3197
authored
Aug 20, 2015
by
Qining Lu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug in the call to random number generator in Cfg's ctor
BUG= R=stichnot@chromium.org Review URL:
https://codereview.chromium.org/1306713002
.
parent
aee5fa8d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
29 deletions
+27
-29
IceCfg.cpp
src/IceCfg.cpp
+2
-4
randomize-pool-immediate-basic.ll
tests_lit/llvm2ice_tests/randomize-pool-immediate-basic.ll
+22
-22
rng.ll
tests_lit/llvm2ice_tests/rng.ll
+3
-3
No files found.
src/IceCfg.cpp
View file @
360e3197
...
@@ -43,15 +43,13 @@ Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber)
...
@@ -43,15 +43,13 @@ Cfg::Cfg(GlobalContext *Ctx, uint32_t SequenceNumber)
VMetadata
(
new
VariablesMetadata
(
this
)),
VMetadata
(
new
VariablesMetadata
(
this
)),
TargetAssembler
(
TargetLowering
::
createAssembler
(
TargetAssembler
(
TargetLowering
::
createAssembler
(
Ctx
->
getFlags
().
getTargetArch
(),
this
))
{
Ctx
->
getFlags
().
getTargetArch
(),
this
))
{
assert
(
!
Ctx
->
isIRGenerationDisabled
()
&&
"Attempt to build cfg when IR generation disabled"
);
if
(
Ctx
->
getFlags
().
getRandomizeAndPoolImmediatesOption
()
==
RPI_Randomize
)
{
if
(
Ctx
->
getFlags
().
getRandomizeAndPoolImmediatesOption
()
==
RPI_Randomize
)
{
// If -randomize-pool-immediates=randomize, create a random number generator
// If -randomize-pool-immediates=randomize, create a random number generator
// to generate a cookie for constant blinding.
// to generate a cookie for constant blinding.
RandomNumberGenerator
RNG
(
Ctx
->
getFlags
().
getRandomSeed
(),
RandomNumberGenerator
RNG
(
Ctx
->
getFlags
().
getRandomSeed
(),
RPE_ConstantBlinding
,
SequenceNumber
);
RPE_ConstantBlinding
,
this
->
SequenceNumber
);
ConstantBlindingCookie
=
ConstantBlindingCookie
=
(
uint32_t
)
RNG
.
next
((
uint64_t
)
std
::
numeric_limits
<
uint32_t
>::
max
+
1
);
(
uint32_t
)
RNG
.
next
((
uint64_t
)
std
::
numeric_limits
<
uint32_t
>::
max
()
+
1
);
}
}
}
}
...
...
tests_lit/llvm2ice_tests/randomize-pool-immediate-basic.ll
View file @
360e3197
...
@@ -25,12 +25,12 @@ entry:
...
@@ -25,12 +25,12 @@ entry:
ret
i32
%res
ret
i32
%res
; BLINDINGO2-LABEL: add_arg_plus_200000
; BLINDINGO2-LABEL: add_arg_plus_200000
; BLINDINGO2: mov [[REG:e[a-z]*]],0x
2c8df4
; BLINDINGO2: mov [[REG:e[a-z]*]],0x
669f4eea
; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
2980b4
{{[]]}}
; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
669c41aa
{{[]]}}
; BLINDINGOM1-LABEL: add_arg_plus_200000
; BLINDINGOM1-LABEL: add_arg_plus_200000
; BLINDINGOM1: mov [[REG:e[a-z]*]],0x
2c8df4
; BLINDINGOM1: mov [[REG:e[a-z]*]],0x
669f4eea
; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
2980b4
{{[]]}}
; BLINDINGOM1-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
669c41aa
{{[]]}}
; POOLING-LABEL: add_arg_plus_200000
; POOLING-LABEL: add_arg_plus_200000
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
...
@@ -44,10 +44,10 @@ entry:
...
@@ -44,10 +44,10 @@ entry:
%addr.load
=
load
float
,
float
*
%addr.ptr
,
align
4
%addr.load
=
load
float
,
float
*
%addr.ptr
,
align
4
ret
float
%addr.load
ret
float
%addr.load
; BLINDINGO2-LABEL: load_arg_plus_200000
; BLINDINGO2-LABEL: load_arg_plus_200000
; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x
32c814
{{[]]}}
; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x
69ed4ee7
{{[]]}}
; BLINDINGOM1-LABEL: load_arg_plus_200000
; BLINDINGOM1-LABEL: load_arg_plus_200000
; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x
2fbad4
{{[]]}}
; BLINDINGOM1: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}-0x
69ea41a7
{{[]]}}
; POOLING-LABEL: load_arg_plus_200000
; POOLING-LABEL: load_arg_plus_200000
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
...
@@ -61,13 +61,13 @@ entry:
...
@@ -61,13 +61,13 @@ entry:
; BLINDINGO2-LABEL: add_arg_plus_64bits
; BLINDINGO2-LABEL: add_arg_plus_64bits
; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f
; BLINDINGO2: sar [[RHI:e[a-z]*]],0x1f
; BLINDINGO2: mov [[RLO:e[a-z]*]],0x
f4a0f8f
8
; BLINDINGO2: mov [[RLO:e[a-z]*]],0x
61a345a
8
; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x
35f4f
8{{[]]}}
; BLINDINGO2-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x
6d3841a
8{{[]]}}
; BLINDINGOM1-LABEL: add_arg_plus_64bits
; BLINDINGOM1-LABEL: add_arg_plus_64bits
; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f
; BLINDINGOM1: sar [[RHI:e[a-z]*]],0x1f
; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x
f4a0f8f
8
; BLINDINGOM1: mov [[RLO:e[a-z]*]],0x
61a345a
8
; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x
35f4f
8{{[]]}}
; BLINDINGOM1-NEXT: lea [[RLO]],{{[[]}}[[RLO]]-0x
6d3841a
8{{[]]}}
; POOLING-LABEL: add_arg_plus_64bits
; POOLING-LABEL: add_arg_plus_64bits
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
; POOLING: mov e{{[a-z]*}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
...
@@ -82,12 +82,12 @@ entry:
...
@@ -82,12 +82,12 @@ entry:
ret
i64
%arg.load
ret
i64
%arg.load
; BLINDINGO2-LABEL: load_arg_plus_64bits
; BLINDINGO2-LABEL: load_arg_plus_64bits
; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x
3d8eac
{{[]]}}
; BLINDINGO2: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}+0x
7087a139
{{[]]}}
; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x
3c2f1c
{{[]]}}
; BLINDINGO2: mov e{{[a-z]*}},DWORD PTR {{[[]}}e{{[a-z]*}}-0x
708641a9
{{[]]}}
; BLINDINGOM1-LABEL: load_arg_plus_64bits
; BLINDINGOM1-LABEL: load_arg_plus_64bits
; BLINDINGOM1: mov e{{[a-z]*}},0x
3d8eac
; BLINDINGOM1: mov e{{[a-z]*}},0x
7087a139
; BLINDINGOM1-NEXT: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
3c2f1c
{{[]]}}
; BLINDINGOM1-NEXT: lea e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
708641a9
{{[]]}}
; POOLING-LABEL: load_arg_plus_64bits
; POOLING-LABEL: load_arg_plus_64bits
; POOLING: mov e{{[a-z]x}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
; POOLING: mov e{{[a-z]x}},DWORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i32${{[0-9]*}}
...
@@ -101,12 +101,12 @@ entry:
...
@@ -101,12 +101,12 @@ entry:
ret
i32
%ret
ret
i32
%ret
; BLINDINGO2-LABEL: add_const_8bits
; BLINDINGO2-LABEL: add_const_8bits
; BLINDINGO2: mov e{{[a-z]*}},0x
1d0aa
; BLINDINGO2: mov e{{[a-z]*}},0x
73d44225
; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
1d02f
{{[]]}}
; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
73d441aa
{{[]]}}
; BLINDINGOM1-LABEL: add_const_8bits
; BLINDINGOM1-LABEL: add_const_8bits
; BLINDINGOM1: mov e{{[a-z]*}},0x
1d0aa
; BLINDINGOM1: mov e{{[a-z]*}},0x
73d44225
; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
1d02f
{{[]]}}
; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
73d441aa
{{[]]}}
; POOLING-LABEL: add_const_8bits
; POOLING-LABEL: add_const_8bits
; POOLING: mov {{[a-z]l}},BYTE PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i8${{[0-9]*}}
; POOLING: mov {{[a-z]l}},BYTE PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i8${{[0-9]*}}
...
@@ -120,12 +120,12 @@ entry:
...
@@ -120,12 +120,12 @@ entry:
ret
i32
%ret
ret
i32
%ret
; BLINDINGO2-LABEL: add_const_16bits
; BLINDINGO2-LABEL: add_const_16bits
; BLINDINGO2: mov e{{[a-z]*}},0x
88a4d
; BLINDINGO2: mov e{{[a-z]*}},0x
7722c1a5
; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
80a4f
{{[]]}}
; BLINDINGO2-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
772241a7
{{[]]}}
; BLINDINGOM1-LABEL: add_const_16bits
; BLINDINGOM1-LABEL: add_const_16bits
; BLINDINGOM1: mov e{{[a-z]*}},0x
88a4d
; BLINDINGOM1: mov e{{[a-z]*}},0x
7722c1a5
; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
80a4f
{{[]]}}
; BLINDINGOM1-NEXT: e{{[a-z]*}},{{[[]}}e{{[a-z]*}}-0x
772241a7
{{[]]}}
; POOLING-LABEL: add_const_16bits
; POOLING-LABEL: add_const_16bits
; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16${{[0-9]*}}
; POOLING: mov {{[a-z]x}},WORD PTR ds:0x0 {{[0-9a-f]*}}: R_386_32 .L$i16${{[0-9]*}}
...
...
tests_lit/llvm2ice_tests/rng.ll
View file @
360e3197
...
@@ -145,7 +145,7 @@ entry:
...
@@ -145,7 +145,7 @@ entry:
ret
float
%addr.load
ret
float
%addr.load
; BLINDINGO2-LABEL: func2
; BLINDINGO2-LABEL: func2
; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x
32c814
{{[]]}}
; BLINDINGO2: lea [[REG:e[a-z]*]],{{[[]}}{{e[a-z]*}}+0x
69ed4ee7
{{[]]}}
}
}
define
float
@func3
(
i32
%arg
,
float
%input
)
{
define
float
@func3
(
i32
%arg
,
float
%input
)
{
...
@@ -229,8 +229,8 @@ entry:
...
@@ -229,8 +229,8 @@ entry:
ret
i32
%res
ret
i32
%res
; BLINDINGO2-LABEL: func6
; BLINDINGO2-LABEL: func6
; BLINDINGO2: mov [[REG:e[a-z]*]],0x
b178f
; BLINDINGO2: mov [[REG:e[a-z]*]],0x
77254ee7
; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
80a4f
{{[]]}}
; BLINDINGO2-NEXT: lea [[REG]],{{[[]}}[[REG]]-0x
772241a7
{{[]]}}
}
}
; Check for function reordering
; Check for function reordering
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment