Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
ba52053b
Commit
ba52053b
authored
Jan 12, 2012
by
dterei
Browse files
Add '-fllvm-tbaa' flag for controlling LLVM TBAA opt.
parent
c55bb603
Changes
3
Hide whitespace changes
Inline
Side-by-side
compiler/main/DriverPipeline.hs
View file @
ba52053b
...
...
@@ -1306,15 +1306,18 @@ runPhase SplitAs _input_fn dflags
runPhase
LlvmOpt
input_fn
dflags
=
do
let
lo_opts
=
getOpts
dflags
opt_lo
let
opt_lvl
=
max
0
(
min
2
$
optLevel
dflags
)
-- don't specify anything if user has specified commands. We do this for
-- opt but not llc since opt is very specifically for optimisation passes
-- only, so if the user is passing us extra options we assume they know
-- what they are doing and don't get in the way.
let
optFlag
=
if
null
lo_opts
then
[
SysTools
.
Option
(
llvmOpts
!!
opt_lvl
)]
else
[]
let
lo_opts
=
getOpts
dflags
opt_lo
opt_lvl
=
max
0
(
min
2
$
optLevel
dflags
)
-- don't specify anything if user has specified commands. We do this
-- for opt but not llc since opt is very specifically for optimisation
-- passes only, so if the user is passing us extra options we assume
-- they know what they are doing and don't get in the way.
optFlag
=
if
null
lo_opts
then
[
SysTools
.
Option
(
llvmOpts
!!
opt_lvl
)]
else
[]
tbaa
|
dopt
Opt_LlvmTBAA
dflags
=
"--enable-tbaa=true"
|
otherwise
=
"--enable-tbaa=false"
output_fn
<-
phaseOutputFilename
LlvmLlc
...
...
@@ -1323,6 +1326,7 @@ runPhase LlvmOpt input_fn dflags
SysTools
.
Option
"-o"
,
SysTools
.
FileOption
""
output_fn
]
++
optFlag
++
[
SysTools
.
Option
tbaa
]
++
map
SysTools
.
Option
lo_opts
)
return
(
LlvmLlc
,
output_fn
)
...
...
@@ -1341,6 +1345,8 @@ runPhase LlvmLlc input_fn dflags
rmodel
|
opt_PIC
=
"pic"
|
not
opt_Static
=
"dynamic-no-pic"
|
otherwise
=
"static"
tbaa
|
dopt
Opt_LlvmTBAA
dflags
=
"--enable-tbaa=true"
|
otherwise
=
"--enable-tbaa=false"
-- hidden debugging flag '-dno-llvm-mangler' to skip mangling
let
next_phase
=
case
dopt
Opt_NoLlvmMangler
dflags
of
...
...
@@ -1356,6 +1362,7 @@ runPhase LlvmLlc input_fn dflags
SysTools
.
FileOption
""
input_fn
,
SysTools
.
Option
"-o"
,
SysTools
.
FileOption
""
output_fn
]
++
map
SysTools
.
Option
lc_opts
++
[
SysTools
.
Option
tbaa
]
++
map
SysTools
.
Option
fpOpts
)
return
(
next_phase
,
output_fn
)
...
...
@@ -1373,7 +1380,7 @@ runPhase LlvmLlc input_fn dflags
else
if
(
elem
VFPv3D16
ext
)
then
[
"-mattr=+v7,+vfp3,+d16"
]
else
[]
_
->
[]
_
->
[]
-----------------------------------------------------------------------------
-- LlvmMangle phase
...
...
compiler/main/DynFlags.hs
View file @
ba52053b
...
...
@@ -250,6 +250,7 @@ data DynFlag
|
Opt_RegsGraph
-- do graph coloring register allocation
|
Opt_RegsIterative
-- do iterative coalescing graph coloring register allocation
|
Opt_PedanticBottoms
-- Be picky about how we treat bottom
|
Opt_LlvmTBAA
-- Use LLVM TBAA infastructure for improving AA
-- Interface files
|
Opt_IgnoreInterfacePragmas
...
...
@@ -1823,6 +1824,7 @@ fFlags = [
(
"vectorise"
,
Opt_Vectorise
,
nop
),
(
"regs-graph"
,
Opt_RegsGraph
,
nop
),
(
"regs-iterative"
,
Opt_RegsIterative
,
nop
),
(
"llvm-tbaa"
,
Opt_LlvmTBAA
,
nop
),
(
"gen-manifest"
,
Opt_GenManifest
,
nop
),
(
"embed-manifest"
,
Opt_EmbedManifest
,
nop
),
(
"ext-core"
,
Opt_EmitExternalCore
,
nop
),
...
...
@@ -2071,6 +2073,7 @@ optLevelFlags
,
([
2
],
Opt_LiberateCase
)
,
([
2
],
Opt_SpecConstr
)
,
([
2
],
Opt_RegsGraph
)
,
([
0
,
1
,
2
],
Opt_LlvmTBAA
)
-- , ([2], Opt_StaticArgumentTransformation)
-- Max writes: I think it's probably best not to enable SAT with -O2 for the
...
...
docs/users_guide/flags.xml
View file @
ba52053b
...
...
@@ -1545,6 +1545,15 @@
<entry><option>
-fno-liberate-case-threshold
</option></entry>
</row>
<row>
<entry><option>
-fllvm-tbaa
</replaceable></entry>
<entry>
Turn on Typed Based Alias Analysis information in the LLVM
backend. This enables more accurate and alias information in the LLVM
backend for better optimisation. (default: Enabled)
</entry>
<entry>
dynamic
</entry>
<entry><option>
-fno-llvm-tbaa
</option></entry>
</row>
<row>
<entry><option>
-fmax-simplifier-iterations
</option></entry>
<entry>
Set the max iterations for the simplifier
</entry>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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