Skip to content

#78023 is revert #78024

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

Closed
vitalybuka opened this issue Jan 13, 2024 · 2 comments
Closed

#78023 is revert #78024

vitalybuka opened this issue Jan 13, 2024 · 2 comments

Comments

@vitalybuka
Copy link
Collaborator

Breaking https://lab.llvm.org/buildbot/#/builders/236/builds/8673

@vitalybuka
Copy link
Collaborator Author

I believe the issue is that truncation will change results e.g. here
A1 = 0xff000000
A2 = 0xff00000000

define i1 @test4_icmp_with_var_mismatched_type(i32 %A1, i64 %A2) {
; CHECK-LABEL: @test4_icmp_with_var_mismatched_type(
; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[A2:%.*]] to i32
; CHECK-NEXT:    [[C:%.*]] = icmp ult i32 [[TMP1]], [[A1:%.*]]
; CHECK-NEXT:    ret i1 [[C]]
;
  %B1 = inttoptr i32 %A1 to ptr
  %B2 = inttoptr i64 %A2 to ptr
  %C = icmp ugt ptr %B1, %B2
  ret i1 %C
}

@dtcxzyw
Copy link
Member

dtcxzyw commented Jan 13, 2024

I believe the issue is that truncation will change results e.g. here A1 = 0xff000000 A2 = 0xff00000000

define i1 @test4_icmp_with_var_mismatched_type(i32 %A1, i64 %A2) {
; CHECK-LABEL: @test4_icmp_with_var_mismatched_type(
; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[A2:%.*]] to i32
; CHECK-NEXT:    [[C:%.*]] = icmp ult i32 [[TMP1]], [[A1:%.*]]
; CHECK-NEXT:    ret i1 [[C]]
;
  %B1 = inttoptr i32 %A1 to ptr
  %B2 = inttoptr i64 %A2 to ptr
  %C = icmp ugt ptr %B1, %B2
  ret i1 %C
}

It is correct because the bit width of pointer is 32 in the test...

vitalybuka added a commit that referenced this issue Jan 13, 2024
…cmp pred X, Y`" (#78023)

Reverts #77832

To fix https://lab.llvm.org/buildbot/#/builders/236/builds/8673

Also truncation to shorter type looks incorrect.

Issue for tracking #78024 .
@dtcxzyw dtcxzyw closed this as completed Jan 14, 2024
justinfargnoli pushed a commit to justinfargnoli/llvm-project that referenced this issue Jan 28, 2024
…cmp pred X, Y`" (llvm#78023)

Reverts llvm#77832

To fix https://lab.llvm.org/buildbot/#/builders/236/builds/8673

Also truncation to shorter type looks incorrect.

Issue for tracking llvm#78024 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants