gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: base,arch,mem: Remove {GE}M5_VAR_USED instances

BB
Bobby Bruce (Gerrit)
Mon, May 8, 2023 10:54 PM

Bobby Bruce has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/70397?usp=email )

Change subject: base,arch,mem: Remove {GE}M5_VAR_USED instances
......................................................................

base,arch,mem: Remove {GE}M5_VAR_USED instances

[[maybe_unused]] is to be used to specify that a variable is used.

Change-Id: Ife2ac96111b3af13e182baba1f3456e48c3a9f9b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70397
Reviewed-by: Jason Lowe-Power power.jg@gmail.com
Maintainer: Bobby Bruce bbruce@ucdavis.edu
Tested-by: kokoro noreply+kokoro@google.com
Reviewed-by: Daniel Carvalho odanrc@yahoo.com.br

M src/arch/arm/isa/insts/sme.isa
M src/base/gtest/serialization_fixture.hh
M src/base/inet.cc
M src/base/stats/group.cc
M src/mem/ruby/system/Sequencer.cc
5 files changed, 17 insertions(+), 16 deletions(-)

Approvals:
Daniel Carvalho: Looks good to me, approved
Bobby Bruce: Looks good to me, approved
Jason Lowe-Power: Looks good to me, approved
kokoro: Regressions pass

diff --git a/src/arch/arm/isa/insts/sme.isa b/src/arch/arm/isa/insts/sme.isa
index b9f6115..03a1b2c 100644
--- a/src/arch/arm/isa/insts/sme.isa
+++ b/src/arch/arm/isa/insts/sme.isa
@@ -100,12 +100,12 @@
xc->tcBase());

          uint8_t offset = imm & (0xf >> (findMsbSet(sizeof(TPElem))));
  •        M5_VAR_USED uint8_t tile_idx =
    
  •        [[maybe_unused]] uint8_t tile_idx =
                imm >> (4 - findMsbSet(sizeof(TPElem)));
    
  •        M5_VAR_USED uint8_t vec_idx = (WOp2 + offset) % eCount;
    
  •        [[maybe_unused]] uint8_t vec_idx = (WOp2 + offset) % eCount;
    
            // Calculate the address
    
  •        M5_VAR_USED Addr EA = XOp1 + XOp3 * sizeof(TPElem);
    
  •        [[maybe_unused]] Addr EA = XOp1 + XOp3 * sizeof(TPElem);
    
            // Calculate the read predicate. One boolean per byte,
            // initialised to all true.
    

@@ -164,10 +164,10 @@
unsigned eCount = ArmStaticInst::getCurSmeVecLen<uint8_t>(
xc->tcBase());

  •        M5_VAR_USED uint8_t vec_index = (WOp2 + imm) % eCount;
    
  •        [[maybe_unused]] uint8_t vec_index = (WOp2 + imm) % eCount;
    
            // Calculate the address
    
  •        M5_VAR_USED Addr EA = XOp1 + imm;
    
  •        [[maybe_unused]] Addr EA = XOp1 + imm;
            '''
    
        iop = InstObjParams(name, "Sme" + Name, "SmeLdrStrOp",
    

@@ -378,12 +378,12 @@
xc->tcBase());

          uint8_t offset = imm & (0xf >> (findMsbSet(sizeof(TPElem))));
  •        M5_VAR_USED uint8_t tile_idx =
    
  •        [[maybe_unused]] uint8_t tile_idx =
                imm >> (4 - findMsbSet(sizeof(TPElem)));
    
  •        M5_VAR_USED uint8_t vec_idx = (WOp2 + offset) % eCount;
    
  •        [[maybe_unused]] uint8_t vec_idx = (WOp2 + offset) % eCount;
    
            // Calculate the address
    
  •        M5_VAR_USED Addr EA = XOp1 + XOp3 * sizeof(TPElem);
    
  •        [[maybe_unused]] Addr EA = XOp1 + XOp3 * sizeof(TPElem);
    
            // Calculate the write predicate. One boolean per byte,
            // initialised to all true.
    

@@ -446,7 +446,7 @@
auto row = getTileHSlice<uint8_t>(ZA, 0, vec_index);

          // Calculate the address
  •        M5_VAR_USED Addr EA = XOp1 + imm;
    
  •        [[maybe_unused]] Addr EA = XOp1 + imm;
    
            uint8_t data[MaxSmeVecLenInBytes];
    

diff --git a/src/base/gtest/serialization_fixture.hh
b/src/base/gtest/serialization_fixture.hh
index 65269e0..9184e7f 100644
--- a/src/base/gtest/serialization_fixture.hh
+++ b/src/base/gtest/serialization_fixture.hh
@@ -99,7 +99,7 @@
{
// Create the directory
dirName = generateTempDirName();

  •    M5_VAR_USED int success = mkdir(dirName.c_str(), 0775);
    
  •    [[maybe_unused]] int success = mkdir(dirName.c_str(), 0775);
        assert(!(success == -1 && errno != EEXIST));
    }
    

@@ -110,7 +110,7 @@
// rmdir does not work
std::remove(getCptPath().c_str());
// Remove the directory we created on SetUp

  •    M5_VAR_USED int success = rmdir(dirName.c_str());
    
  •    [[maybe_unused]] int success = rmdir(dirName.c_str());
        assert(success == 0);
    }
    
    };
    diff --git a/src/base/inet.cc b/src/base/inet.cc
    index fc7505e..24c8e7e 100644
    --- a/src/base/inet.cc
    +++ b/src/base/inet.cc
    @@ -301,7 +301,7 @@
    const uint8_t *data = bytes() + IP6_HDR_LEN;
    uint8_t nxt = ip6_nxt;
    int len = 0;
  • GEM5_VAR_USED int all = plen();
  • [[maybe_unused]] int all = plen();

    while (ip6Extension(nxt)) {
    const Ip6Opt *ext = (const Ip6Opt *)data;
    @@ -324,7 +324,7 @@
    const uint8_t data = bytes() + IP6_HDR_LEN;
    uint8_t nxt = ip6_nxt;
    Ip6Opt
    opt = NULL;

  • GEM5_VAR_USED int all = plen();
  • [[maybe_unused]] int all = plen();

    while (ip6Extension(nxt)) {
    opt = (Ip6Opt *)data;
    @@ -349,7 +349,7 @@
    {
    const uint8_t *data = bytes() + IP6_HDR_LEN;
    uint8_t nxt = ip6_nxt;

  • GEM5_VAR_USED int all = plen();
  • [[maybe_unused]] int all = plen();

    while (ip6Extension(nxt)) {
    const Ip6Opt *ext = (const Ip6Opt *)data;
    diff --git a/src/base/stats/group.cc b/src/base/stats/group.cc
    index 93e7183..addfdf9 100644
    --- a/src/base/stats/group.cc
    +++ b/src/base/stats/group.cc
    @@ -72,7 +72,8 @@

    for (auto &g : statGroups) {
    if (debug::Stats) {

  •        M5_VAR_USED const Named *named = dynamic_cast<const Named  
    

*>(this);

  •        [[maybe_unused]] const Named *named = \
    
  •            dynamic_cast<const Named *>(this);
            DPRINTF(Stats, "%s: regStats in group %s\n",
                    named ? named->name() : "?",
                    g.first);
    

diff --git a/src/mem/ruby/system/Sequencer.cc
b/src/mem/ruby/system/Sequencer.cc
index 3b75619..82fc19b 100644
--- a/src/mem/ruby/system/Sequencer.cc
+++ b/src/mem/ruby/system/Sequencer.cc
@@ -230,7 +230,7 @@
Cycles current_time = curCycle();

  // Check across all outstanding requests
  • GEM5_VAR_USED int total_outstanding = 0;
  • [[maybe_unused]] int total_outstanding = 0;

    for (const auto &table_entry : m_RequestTable) {
    for (const auto &seq_req : table_entry.second) {

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/70397?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Ife2ac96111b3af13e182baba1f3456e48c3a9f9b
Gerrit-Change-Number: 70397
Gerrit-PatchSet: 3
Gerrit-Owner: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Bobby Bruce bbruce@ucdavis.edu
Gerrit-Reviewer: Daniel Carvalho odanrc@yahoo.com.br
Gerrit-Reviewer: Gabe Black gabe.black@gmail.com
Gerrit-Reviewer: Jason Lowe-Power power.jg@gmail.com
Gerrit-Reviewer: Nikos Nikoleris nikos.nikoleris@arm.com
Gerrit-Reviewer: kokoro noreply+kokoro@google.com

Bobby Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/70397?usp=email ) Change subject: base,arch,mem: Remove {GE}M5_VAR_USED instances ...................................................................... base,arch,mem: Remove {GE}M5_VAR_USED instances `[[maybe_unused]]` is to be used to specify that a variable is used. Change-Id: Ife2ac96111b3af13e182baba1f3456e48c3a9f9b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/70397 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Bobby Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br> --- M src/arch/arm/isa/insts/sme.isa M src/base/gtest/serialization_fixture.hh M src/base/inet.cc M src/base/stats/group.cc M src/mem/ruby/system/Sequencer.cc 5 files changed, 17 insertions(+), 16 deletions(-) Approvals: Daniel Carvalho: Looks good to me, approved Bobby Bruce: Looks good to me, approved Jason Lowe-Power: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/arm/isa/insts/sme.isa b/src/arch/arm/isa/insts/sme.isa index b9f6115..03a1b2c 100644 --- a/src/arch/arm/isa/insts/sme.isa +++ b/src/arch/arm/isa/insts/sme.isa @@ -100,12 +100,12 @@ xc->tcBase()); uint8_t offset = imm & (0xf >> (findMsbSet(sizeof(TPElem)))); - M5_VAR_USED uint8_t tile_idx = + [[maybe_unused]] uint8_t tile_idx = imm >> (4 - findMsbSet(sizeof(TPElem))); - M5_VAR_USED uint8_t vec_idx = (WOp2 + offset) % eCount; + [[maybe_unused]] uint8_t vec_idx = (WOp2 + offset) % eCount; // Calculate the address - M5_VAR_USED Addr EA = XOp1 + XOp3 * sizeof(TPElem); + [[maybe_unused]] Addr EA = XOp1 + XOp3 * sizeof(TPElem); // Calculate the read predicate. One boolean per byte, // initialised to all true. @@ -164,10 +164,10 @@ unsigned eCount = ArmStaticInst::getCurSmeVecLen<uint8_t>( xc->tcBase()); - M5_VAR_USED uint8_t vec_index = (WOp2 + imm) % eCount; + [[maybe_unused]] uint8_t vec_index = (WOp2 + imm) % eCount; // Calculate the address - M5_VAR_USED Addr EA = XOp1 + imm; + [[maybe_unused]] Addr EA = XOp1 + imm; ''' iop = InstObjParams(name, "Sme" + Name, "SmeLdrStrOp", @@ -378,12 +378,12 @@ xc->tcBase()); uint8_t offset = imm & (0xf >> (findMsbSet(sizeof(TPElem)))); - M5_VAR_USED uint8_t tile_idx = + [[maybe_unused]] uint8_t tile_idx = imm >> (4 - findMsbSet(sizeof(TPElem))); - M5_VAR_USED uint8_t vec_idx = (WOp2 + offset) % eCount; + [[maybe_unused]] uint8_t vec_idx = (WOp2 + offset) % eCount; // Calculate the address - M5_VAR_USED Addr EA = XOp1 + XOp3 * sizeof(TPElem); + [[maybe_unused]] Addr EA = XOp1 + XOp3 * sizeof(TPElem); // Calculate the write predicate. One boolean per byte, // initialised to all true. @@ -446,7 +446,7 @@ auto row = getTileHSlice<uint8_t>(ZA, 0, vec_index); // Calculate the address - M5_VAR_USED Addr EA = XOp1 + imm; + [[maybe_unused]] Addr EA = XOp1 + imm; uint8_t data[MaxSmeVecLenInBytes]; diff --git a/src/base/gtest/serialization_fixture.hh b/src/base/gtest/serialization_fixture.hh index 65269e0..9184e7f 100644 --- a/src/base/gtest/serialization_fixture.hh +++ b/src/base/gtest/serialization_fixture.hh @@ -99,7 +99,7 @@ { // Create the directory dirName = generateTempDirName(); - M5_VAR_USED int success = mkdir(dirName.c_str(), 0775); + [[maybe_unused]] int success = mkdir(dirName.c_str(), 0775); assert(!(success == -1 && errno != EEXIST)); } @@ -110,7 +110,7 @@ // rmdir does not work std::remove(getCptPath().c_str()); // Remove the directory we created on SetUp - M5_VAR_USED int success = rmdir(dirName.c_str()); + [[maybe_unused]] int success = rmdir(dirName.c_str()); assert(success == 0); } }; diff --git a/src/base/inet.cc b/src/base/inet.cc index fc7505e..24c8e7e 100644 --- a/src/base/inet.cc +++ b/src/base/inet.cc @@ -301,7 +301,7 @@ const uint8_t *data = bytes() + IP6_HDR_LEN; uint8_t nxt = ip6_nxt; int len = 0; - GEM5_VAR_USED int all = plen(); + [[maybe_unused]] int all = plen(); while (ip6Extension(nxt)) { const Ip6Opt *ext = (const Ip6Opt *)data; @@ -324,7 +324,7 @@ const uint8_t *data = bytes() + IP6_HDR_LEN; uint8_t nxt = ip6_nxt; Ip6Opt* opt = NULL; - GEM5_VAR_USED int all = plen(); + [[maybe_unused]] int all = plen(); while (ip6Extension(nxt)) { opt = (Ip6Opt *)data; @@ -349,7 +349,7 @@ { const uint8_t *data = bytes() + IP6_HDR_LEN; uint8_t nxt = ip6_nxt; - GEM5_VAR_USED int all = plen(); + [[maybe_unused]] int all = plen(); while (ip6Extension(nxt)) { const Ip6Opt *ext = (const Ip6Opt *)data; diff --git a/src/base/stats/group.cc b/src/base/stats/group.cc index 93e7183..addfdf9 100644 --- a/src/base/stats/group.cc +++ b/src/base/stats/group.cc @@ -72,7 +72,8 @@ for (auto &g : statGroups) { if (debug::Stats) { - M5_VAR_USED const Named *named = dynamic_cast<const Named *>(this); + [[maybe_unused]] const Named *named = \ + dynamic_cast<const Named *>(this); DPRINTF(Stats, "%s: regStats in group %s\n", named ? named->name() : "?", g.first); diff --git a/src/mem/ruby/system/Sequencer.cc b/src/mem/ruby/system/Sequencer.cc index 3b75619..82fc19b 100644 --- a/src/mem/ruby/system/Sequencer.cc +++ b/src/mem/ruby/system/Sequencer.cc @@ -230,7 +230,7 @@ Cycles current_time = curCycle(); // Check across all outstanding requests - GEM5_VAR_USED int total_outstanding = 0; + [[maybe_unused]] int total_outstanding = 0; for (const auto &table_entry : m_RequestTable) { for (const auto &seq_req : table_entry.second) { -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/70397?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: Ife2ac96111b3af13e182baba1f3456e48c3a9f9b Gerrit-Change-Number: 70397 Gerrit-PatchSet: 3 Gerrit-Owner: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-Reviewer: Bobby Bruce <bbruce@ucdavis.edu> Gerrit-Reviewer: Daniel Carvalho <odanrc@yahoo.com.br> Gerrit-Reviewer: Gabe Black <gabe.black@gmail.com> Gerrit-Reviewer: Jason Lowe-Power <power.jg@gmail.com> Gerrit-Reviewer: Nikos Nikoleris <nikos.nikoleris@arm.com> Gerrit-Reviewer: kokoro <noreply+kokoro@google.com>