Add -fno-merge-cond-motion option
This disables code motion during V3MergeCond, for debugging.
This commit is contained in:
parent
d721f70690
commit
0c2c097377
|
|
@ -459,6 +459,8 @@ Summary:
|
|||
|
||||
.. option:: -fno-merge-cond
|
||||
|
||||
.. option:: -fno-merge-cond-motion
|
||||
|
||||
.. option:: -fno-merge-const-pool
|
||||
|
||||
.. option:: -fno-reloop
|
||||
|
|
|
|||
|
|
@ -477,10 +477,12 @@ private:
|
|||
AstNode* currp = m_workQueuep->front();
|
||||
m_workQueuep->pop();
|
||||
|
||||
// Analyse sub-tree list for code motion
|
||||
// Analyse sub-tree list for code motion and conditional merging
|
||||
CodeMotionAnalysisVisitor::analyze(currp, stmtProperties);
|
||||
// Perform the code motion within the whole sub-tree list
|
||||
currp = CodeMotionOptimizeVisitor::optimize(currp, stmtProperties);
|
||||
if (v3Global.opt.fMergeCondMotion()) {
|
||||
currp = CodeMotionOptimizeVisitor::optimize(currp, stmtProperties);
|
||||
}
|
||||
|
||||
// Merge conditionals in the whole sub-tree list (this might create new work items)
|
||||
iterateAndNextNull(currp);
|
||||
|
|
|
|||
|
|
@ -1097,6 +1097,7 @@ void V3Options::parseOptsList(FileLine* fl, const string& optdir, int argc, char
|
|||
DECL_OPTION("-flife-post", FOnOff, &m_fLifePost);
|
||||
DECL_OPTION("-flocalize", FOnOff, &m_fLocalize);
|
||||
DECL_OPTION("-fmerge-cond", FOnOff, &m_fMergeCond);
|
||||
DECL_OPTION("-fmerge-cond-motion", FOnOff, &m_fMergeCondMotion);
|
||||
DECL_OPTION("-fmerge-const-pool", FOnOff, &m_fMergeConstPool);
|
||||
DECL_OPTION("-freloop", FOnOff, &m_fReloop);
|
||||
DECL_OPTION("-freorder", FOnOff, &m_fReorder);
|
||||
|
|
|
|||
|
|
@ -354,7 +354,8 @@ private:
|
|||
bool m_fLifePost; // main switch: -fno-life-post: delayed assignment elimination
|
||||
bool m_fLocalize; // main switch: -fno-localize: convert temps to local variables
|
||||
bool m_fMergeCond; // main switch: -fno-merge-cond: merge conditionals
|
||||
bool m_fMergeConstPool = true; // main switch: --fmerge-const-pool
|
||||
bool m_fMergeCondMotion = true; // main switch: -fno-merge-cond-motion: perform code motion
|
||||
bool m_fMergeConstPool = true; // main switch: -fno-merge-const-pool
|
||||
bool m_fReloop; // main switch: -fno-reloop: reform loops
|
||||
bool m_fReorder; // main switch: -fno-reorder: reorder assignments in blocks
|
||||
bool m_fSplit; // main switch: -fno-split: always assignment splitting
|
||||
|
|
@ -587,6 +588,7 @@ public:
|
|||
bool fLifePost() const { return m_fLifePost; }
|
||||
bool fLocalize() const { return m_fLocalize; }
|
||||
bool fMergeCond() const { return m_fMergeCond; }
|
||||
bool fMergeCondMotion() const { return m_fMergeCondMotion; }
|
||||
bool fMergeConstPool() const { return m_fMergeConstPool; }
|
||||
bool fReloop() const { return m_fReloop; }
|
||||
bool fReorder() const { return m_fReorder; }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
#!/usr/bin/env perl
|
||||
if (!$::Driver) { use FindBin; exec("$FindBin::Bin/bootstrap.pl", @ARGV, $0); die; }
|
||||
# DESCRIPTION: Verilator: Verilog Test driver/expect definition
|
||||
#
|
||||
# Copyright 2022 by Geza Lore. This program is free software; you
|
||||
# can redistribute it and/or modify it under the terms of either the GNU
|
||||
# Lesser General Public License Version 3 or the Perl Artistic License
|
||||
# Version 2.0.
|
||||
# SPDX-License-Identifier: LGPL-3.0-only OR Artistic-2.0
|
||||
|
||||
scenarios(vlt_all => 1);
|
||||
|
||||
top_filename("t/t_merge_cond.v");
|
||||
|
||||
compile(
|
||||
verilator_flags2 => ["-unroll-count 64", "--stats", "-fno-merge-cond-motion"],
|
||||
);
|
||||
|
||||
execute(
|
||||
check_finished => 1,
|
||||
);
|
||||
|
||||
if ($Self->{vlt}) {
|
||||
# Note, with vltmt this might be split differently, so only checking vlt
|
||||
file_grep($Self->{stats}, qr/Optimizations, MergeCond merges\s+(\d+)/i,
|
||||
10);
|
||||
file_grep($Self->{stats}, qr/Optimizations, MergeCond merged items\s+(\d+)/i,
|
||||
580);
|
||||
file_grep($Self->{stats}, qr/Optimizations, MergeCond longest merge\s+(\d+)/i,
|
||||
64);
|
||||
}
|
||||
|
||||
ok(1);
|
||||
1;
|
||||
Loading…
Reference in New Issue