-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[ValueTracking] Use SimplifyQuery in isKnownNonEqual
#124942
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -1609,17 +1609,13 @@ if.else: | |||||||||||||||||||||||
| ret i16 0 | ||||||||||||||||||||||||
| } | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ; TODO: %cmp always evaluates to false | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| define i1 @test_simplify_icmp2(double %x) { | ||||||||||||||||||||||||
| ; CHECK-LABEL: @test_simplify_icmp2( | ||||||||||||||||||||||||
| ; CHECK-NEXT: [[ABS:%.*]] = tail call double @llvm.fabs.f64(double [[X:%.*]]) | ||||||||||||||||||||||||
| ; CHECK-NEXT: [[COND:%.*]] = fcmp oeq double [[ABS]], 0x7FF0000000000000 | ||||||||||||||||||||||||
| ; CHECK-NEXT: br i1 [[COND]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]] | ||||||||||||||||||||||||
| ; CHECK: if.then: | ||||||||||||||||||||||||
| ; CHECK-NEXT: [[CAST:%.*]] = bitcast double [[X]] to i64 | ||||||||||||||||||||||||
| ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i64 [[CAST]], 3458764513820540928 | ||||||||||||||||||||||||
| ; CHECK-NEXT: ret i1 [[CMP]] | ||||||||||||||||||||||||
| ; CHECK-NEXT: ret i1 false | ||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't quite understand why this change isn't NFC
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With DC we will have a more precise KnownBits: llvm-project/llvm/lib/Analysis/ValueTracking.cpp Lines 3830 to 3840 in 8af24ce
|
||||||||||||||||||||||||
| ; CHECK: if.else: | ||||||||||||||||||||||||
| ; CHECK-NEXT: ret i1 false | ||||||||||||||||||||||||
| ; | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should do safeCxtI adjustment when an explicit SimplifyQuery has been provided. We don't do this for the other functions either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I set CxtI in
BasicAAResult::aliasGEPto avoid a regression inllvm/test/Analysis/BasicAA/sequential-gep.ll:add_non_zero_assume.