forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NVPTX] Support address offsets added with disjoint or (llvm#122042)
Sometime DAGCombiner gets a little too clever and converts an add of a small constant offset to a highly aligned pointer into a 'disjoint or'. When looking for address operands handle this case as well.
- Loading branch information
1 parent
8948340
commit 560b72c
Showing
4 changed files
with
62 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 | ||
; RUN: llc < %s -mtriple=nvptx64 -mcpu=sm_35 -verify-machineinstrs | FileCheck %s | ||
; RUN: %if ptxas %{ llc < %s -mtriple=nvptx64 -mcpu=sm_35 | %ptxas-verify %} | ||
target triple = "nvptx64-nvidia-cuda" | ||
|
||
@a = external global ptr align 16 | ||
|
||
define i32 @test_disjoint_or_addr(i16 %a) { | ||
; CHECK-LABEL: test_disjoint_or_addr( | ||
; CHECK: { | ||
; CHECK-NEXT: .reg .b32 %r<2>; | ||
; CHECK-NEXT: .reg .b64 %rd<3>; | ||
; CHECK-EMPTY: | ||
; CHECK-NEXT: // %bb.0: | ||
; CHECK-NEXT: mov.u64 %rd1, a; | ||
; CHECK-NEXT: cvta.global.u64 %rd2, %rd1; | ||
; CHECK-NEXT: ld.u32 %r1, [%rd2+8]; | ||
; CHECK-NEXT: st.param.b32 [func_retval0], %r1; | ||
; CHECK-NEXT: ret; | ||
%a1 = ptrtoint ptr @a to i64 | ||
%a2 = or disjoint i64 %a1, 8 | ||
%a3 = inttoptr i64 %a2 to ptr | ||
%v = load i32, ptr %a3 | ||
ret i32 %v | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters