Skip to content

Missed optimization opportunity with duplicated conditional (JumpThreading?) #8480

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

Open
llvmbot opened this issue Sep 8, 2010 · 0 comments
Labels
bugzilla Issues migrated from bugzilla missed-optimization

Comments

@llvmbot
Copy link
Member

llvmbot commented Sep 8, 2010

Bugzilla Link 8108
Version trunk
OS All
Attachments missed.ll
Reporter LLVM Bugzilla Contributor

Extended Description

See the attached .ll files. In particular, note this snippet:

lor.rhs.i:
%cmp9.i = icmp eq i32 %tmp2, 16
br label %_Z16sparc_floating_pPK4type.exit

_Z16sparc_floating_pPK4type.exit:
%call19 = phi i1 [ true, %sw.bb.i ], [ %cmp9.i, %lor.rhs.i ], [ true, %sw.bb.i ]
%cmp = icmp eq i32 %tmp2, 16
%or.cond = and i1 %call19, %cmp
br i1 %or.cond, label %if.end18, label %sw.bb.i24

Notice that the comparison of %tmp2 with 16 is repeated. If this edge were to be threaded by JumpThreading, GVN would pick up the duplication and get rid of it. However, because we can't actually determine a value for the comparison JumpThreading does not currently choose to thread this edge.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
Michael137 pushed a commit to Michael137/llvm-project that referenced this issue Apr 2, 2024
Clear the Clang type cache when new modules are loaded / Create non-null typerefs in field descriptors for Clang types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla missed-optimization
Projects
None yet
Development

No branches or pull requests

2 participants