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

[Meta] Missed combines using freeze #49274

Open
RKSimon opened this issue Apr 12, 2021 · 3 comments
Open

[Meta] Missed combines using freeze #49274

RKSimon opened this issue Apr 12, 2021 · 3 comments
Labels
bugzilla Issues migrated from bugzilla metabug Issue to collect references to a group of similar or related issues.

Comments

@RKSimon
Copy link
Collaborator

RKSimon commented Apr 12, 2021

Bugzilla Link 49930
Version trunk
OS Windows NT
Depends On #7145 #40657 #49175 #43481 #50630
CC @davidbolvansky,@aqjune,@LebedevRI,@nunoplopes,@rotateright

Extended Description

Now that we have the freeze instruction (and we really want to get rid of undef), we should be more willing to perform folds that introduce freeze.

Part of this is a general apprehension about using freeze, and also we need to decide how freeze counts in the 'is this simpler or not' metric that we use for InstCombine combine rules.

For example, https://reviews.llvm.org/D100211 [Bug #​44136], proposed the fold:

define i1 @src(i8 %a, i8 %b) {
  %n = xor i8 %a, -1
  %o = and i8 %n, %b
  %c = icmp eq i8 %o, 0
  ret i1 %c
}

define i1 @tgt(i8 %a, i8 %b) {
  %aa = freeze i8 %a
  %o = or i8 %aa, %b
  %c = icmp eq i8 %o, %aa
  ret i1 %c
}

The freeze is necessary for the fold to be valid, but means we don't reduce the instruction count (but does freeze count as an instruction in the same way?). And some were worried about freeze preventing later folds from occurring.

@aqjune
Copy link
Contributor

aqjune commented Apr 19, 2021

Another possible enhancement in floating point op optimization:
https://llvm.org/pr49831

@jeremy-rifkin
Copy link
Mannequin

jeremy-rifkin mannequin commented Nov 27, 2021

mentioned in issue #50630

@llvmbot
Copy link
Member

llvmbot commented Nov 27, 2021

mentioned in issue #7145

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 11, 2021
@EugeneZelenko EugeneZelenko added the metabug Issue to collect references to a group of similar or related issues. label Jan 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla metabug Issue to collect references to a group of similar or related issues.
Projects
None yet
Development

No branches or pull requests

4 participants