Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/WebAssembly/fast-isel-no-offset.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

107 lines
3.1 KiB
LLVM

; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 -verify-machineinstrs | FileCheck %s
target triple = "wasm32-unknown-unknown"
; FastISel should not fold one of the add/sub operands into a load/store's
; offset when 'nuw' (no unsigned wrap) is not present, because the address
; calculation does not wrap. When there is an add/sub and nuw is not present, we
; bail out of FastISel.
@mylabel = external global ptr
; CHECK-LABEL: dont_fold_non_nuw_add_load:
; CHECK: local.get 0
; CHECK-NEXT: i32.const 2147483644
; CHECK-NEXT: i32.add
; CHECK-NEXT: i32.load 0
define i32 @dont_fold_non_nuw_add_load(ptr %p) {
%q = ptrtoint ptr %p to i32
%r = add i32 %q, 2147483644
%s = inttoptr i32 %r to ptr
%t = load i32, ptr %s
ret i32 %t
}
; CHECK-LABEL: dont_fold_non_nuw_add_store:
; CHECK: local.get 0
; CHECK-NEXT: i32.const 2147483644
; CHECK-NEXT: i32.add
; CHECK-NEXT: i32.const 5
; CHECK-NEXT: i32.store 0
define void @dont_fold_non_nuw_add_store(ptr %p) {
%q = ptrtoint ptr %p to i32
%r = add i32 %q, 2147483644
%s = inttoptr i32 %r to ptr
store i32 5, ptr %s
ret void
}
; CHECK-LABEL: dont_fold_non_nuw_add_load_2:
; CHECK: i32.const mylabel
; CHECK-NEXT: i32.const -4
; CHECK-NEXT: i32.add
; CHECK-NEXT: i32.load 0
define i32 @dont_fold_non_nuw_add_load_2() {
%t = load i32, ptr inttoptr (i32 add (i32 ptrtoint (ptr @mylabel to i32), i32 -4) to ptr), align 4
ret i32 %t
}
; CHECK-LABEL: dont_fold_non_nuw_add_store_2:
; CHECK: i32.const mylabel
; CHECK-NEXT: i32.const -4
; CHECK-NEXT: i32.add
; CHECK-NEXT: i32.const 5
; CHECK-NEXT: i32.store 0
define void @dont_fold_non_nuw_add_store_2() {
store i32 5, ptr inttoptr (i32 add (i32 ptrtoint (ptr @mylabel to i32), i32 -4) to ptr), align 4
ret void
}
; CHECK-LABEL: dont_fold_non_nuw_sub_load:
; CHECK: local.get 0
; CHECK-NEXT: i32.const -2147483644
; CHECK-NEXT: i32.sub
; CHECK-NEXT: i32.load 0
define i32 @dont_fold_non_nuw_sub_load(ptr %p) {
%q = ptrtoint ptr %p to i32
%r = sub i32 %q, -2147483644
%s = inttoptr i32 %r to ptr
%t = load i32, ptr %s
ret i32 %t
}
; CHECK-LABEL: dont_fold_non_nuw_sub_store:
; CHECK: local.get 0
; CHECK-NEXT: i32.const -2147483644
; CHECK-NEXT: i32.sub
; CHECK-NEXT: i32.const 5
; CHECK-NEXT: i32.store 0
define void @dont_fold_non_nuw_sub_store(ptr %p) {
%q = ptrtoint ptr %p to i32
%r = sub i32 %q, -2147483644
%s = inttoptr i32 %r to ptr
store i32 5, ptr %s
ret void
}
; CHECK-LABEL: dont_fold_non_nuw_sub_load_2:
; CHECK: i32.const mylabel
; CHECK-NEXT: i32.const 4
; CHECK-NEXT: i32.sub
; CHECK-NEXT: i32.load 0
define i32 @dont_fold_non_nuw_sub_load_2() {
%t = load i32, ptr inttoptr (i32 sub (i32 ptrtoint (ptr @mylabel to i32), i32 4) to ptr), align 4
ret i32 %t
}
; CHECK-LABEL: dont_fold_non_nuw_sub_store_2:
; CHECK: i32.const mylabel
; CHECK-NEXT: i32.const 4
; CHECK-NEXT: i32.sub
; CHECK-NEXT: i32.const 5
; CHECK-NEXT: i32.store 0
define void @dont_fold_non_nuw_sub_store_2() {
store i32 5, ptr inttoptr (i32 sub (i32 ptrtoint (ptr @mylabel to i32), i32 4) to ptr), align 4
ret void
}