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

poor codegen for code size #1668

Closed
lattner opened this issue Mar 31, 2007 · 3 comments
Closed

poor codegen for code size #1668

lattner opened this issue Mar 31, 2007 · 3 comments
Assignees
Labels
bugzilla Issues migrated from bugzilla code-quality llvm:codegen

Comments

@lattner
Copy link
Collaborator

lattner commented Mar 31, 2007

Bugzilla Link 1296
Resolution FIXED
Resolved on Feb 22, 2010 12:48
Version 1.0
OS All
CC @nlewycky

Extended Description

This contrived testcase:

int foo(int A, int B, int C) {
int i;
int result = 0;

if (A == 1) {
for (i = 0; i < 1000; ++i) {
if (i & B) {result = 1; break; }
}
} else if (A == 0) {
for (i = 0; i < 1000; ++i) {
if (i & C) {result = 1; break; }
}
} else if (A == 2) {
for (i = 0; i < 1000; ++i) {
if (i & C) {result = 1; break; }
}
}

out:
return result;
}

Produces silly code like this:

LBB1_19: #bb13.out.loopexit1_crit_edge
movl $1, %eax
jmp LBB1_15 #out
LBB1_20: #bb.out.loopexit_crit_edge
movl $1, %eax
jmp LBB1_15 #out
LBB1_21: #bb27.out.loopexit3_crit_edge
movl $1, %eax
jmp LBB1_15 #out

@lattner
Copy link
Collaborator Author

lattner commented Mar 31, 2007

assigned to @lattner

@lattner
Copy link
Collaborator Author

lattner commented Mar 31, 2007

mine

@lattner
Copy link
Collaborator Author

lattner commented Apr 2, 2007

Implemented. Patch here:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070326/046639.html

Testcase here: CodeGen/Generic/phi-immediate-factoring.ll

-Chris

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
kitano-metro added a commit to RIKEN-RCCS/llvm-project that referenced this issue Jul 14, 2023
refs llvm#1668 pragma pipeline_initiation_intervalが記述された場合のメッセージ改善

See merge request a64fx-swpl/llvm-project!130
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla code-quality llvm:codegen
Projects
None yet
Development

No branches or pull requests

1 participant