LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 8 - [instcombine] setcc instructions should allow limited cast propagation
Summary: [instcombine] setcc instructions should allow limited cast propagation
Status: RESOLVED FIXED
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: trunk
Hardware: PC Linux
: P enhancement
Assignee: Chris Lattner
URL:
Keywords: quality-of-implementation
Depends on:
Blocks:
 
Reported: 2003-10-07 14:13 PDT by Chris Lattner
Modified: 2010-02-22 12:49 PST (History)
1 user (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Lattner 2003-10-07 14:13:03 PDT
The cast in this testcase should be eliminated:

bool %test(sbyte* %A) {
  %B = cast sbyte* %A to int*
  %C = seteq int* %B, null
  ret bool %C
}
Comment 1 Chris Lattner 2003-11-02 22:27:29 PST
This was easy, and I needed a break.  Here's the patch:
http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20031027/009058.html

This comes up a lot in C++ programs, after inlining.