Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 628 - Type Shrinkage and Memory Alignment #630

Closed
wants to merge 15 commits into from
Closed

Conversation

PeiMu
Copy link
Collaborator

@PeiMu PeiMu commented Nov 7, 2022

A PR for issue 628.

In this PR, I'm going to implement the type shrinkage with memory alignment.

@PeiMu PeiMu self-assigned this Nov 7, 2022
@PeiMu PeiMu linked an issue Nov 7, 2022 that may be closed by this pull request
Copy link
Collaborator

@KomaGR KomaGR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Could you do a pass to observe code conventions like if-clause formatting and whitespace?

src/newton/newton-irPass-LLVMIR-optimizeByRange.cpp Outdated Show resolved Hide resolved
src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp Outdated Show resolved Hide resolved
src/newton/newton-irPass-LLVMIR-shrinkTypeByRange.cpp Outdated Show resolved Hide resolved
@PeiMu PeiMu requested a review from KomaGR November 15, 2022 15:25
@PeiMu
Copy link
Collaborator Author

PeiMu commented Nov 15, 2022

I reformated the files by clang-format tool.

@KomaGR KomaGR changed the base branch from master to issue-644 February 24, 2023 15:54
Copy link
Collaborator

@KomaGR KomaGR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Please make all code follows the coding conventions as specified in https://github.com/phillipstanleymarbell/Noisy-lang-compiler/blob/master/README-CodingConventions.md.

sourceOperand->getType()->isIntegerTy())
{
// float fa = (float)ia;
bool isSinged = sourceInst->getOpcode() == Instruction::SIToFP;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be isSigned instead of isSinged?

@@ -44,6 +44,7 @@
#include <cmath>
#include <float.h>
#include <limits>
#include <math.h>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this suddenly included here?

@@ -245,7 +247,7 @@ getTypeInfo(State * N, Value * inValue,
switch (inInstType->getTypeID())
{
case Type::IntegerTyID:
typeInformation = getShrinkIntType(N, inValue, vrRangeIt->second);
typeInformation = getShrinkIntType(N, inValue, vrRangeIt->second);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a mismatched indentation. Please also use brackets with switch cases.

@PeiMu
Copy link
Collaborator Author

PeiMu commented Mar 5, 2023

The code base is super different. I merge the code manually.

@PeiMu PeiMu closed this Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type Shrinkage and Memory Alignment
3 participants