Skip to content

Commit 8db61be

Browse files
committed
Handle things in FastISel
1 parent 17654a6 commit 8db61be

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ bool WebAssemblyFastISel::computeAddress(const Value *Obj, Address &Addr) {
341341
// is not present, because the address calculation does not wrap.
342342
if (auto *OFBinOp = dyn_cast<OverflowingBinaryOperator>(U))
343343
if (!OFBinOp->hasNoUnsignedWrap())
344-
return false;
344+
break;
345345

346346
// Adds of constants are common and easy enough.
347347
const Value *LHS = U->getOperand(0);
@@ -370,7 +370,7 @@ bool WebAssemblyFastISel::computeAddress(const Value *Obj, Address &Addr) {
370370
// is not present, because the address calculation does not wrap.
371371
if (auto *OFBinOp = dyn_cast<OverflowingBinaryOperator>(U))
372372
if (!OFBinOp->hasNoUnsignedWrap())
373-
return false;
373+
break;
374374

375375
// Subs of constants are common and easy enough.
376376
const Value *LHS = U->getOperand(0);

llvm/test/CodeGen/WebAssembly/fast-isel-bailout.ll renamed to llvm/test/CodeGen/WebAssembly/fast-isel-no-offset.ll

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -asm-verbose=false -fast-isel -verify-machineinstrs | FileCheck %s
1+
; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 -verify-machineinstrs | FileCheck %s
22

33
target triple = "wasm32-unknown-unknown"
44

@@ -59,8 +59,8 @@ define void @dont_fold_non_nuw_add_store_2() {
5959

6060
; CHECK-LABEL: dont_fold_non_nuw_sub_load:
6161
; CHECK: local.get 0
62-
; CHECK-NEXT: i32.const 2147483644
63-
; CHECK-NEXT: i32.add
62+
; CHECK-NEXT: i32.const -2147483644
63+
; CHECK-NEXT: i32.sub
6464
; CHECK-NEXT: i32.load 0
6565
define i32 @dont_fold_non_nuw_sub_load(ptr %p) {
6666
%q = ptrtoint ptr %p to i32
@@ -72,8 +72,8 @@ define i32 @dont_fold_non_nuw_sub_load(ptr %p) {
7272

7373
; CHECK-LABEL: dont_fold_non_nuw_sub_store:
7474
; CHECK: local.get 0
75-
; CHECK-NEXT: i32.const 2147483644
76-
; CHECK-NEXT: i32.add
75+
; CHECK-NEXT: i32.const -2147483644
76+
; CHECK-NEXT: i32.sub
7777
; CHECK-NEXT: i32.const 5
7878
; CHECK-NEXT: i32.store 0
7979
define void @dont_fold_non_nuw_sub_store(ptr %p) {
@@ -86,8 +86,8 @@ define void @dont_fold_non_nuw_sub_store(ptr %p) {
8686

8787
; CHECK-LABEL: dont_fold_non_nuw_sub_load_2:
8888
; CHECK: i32.const mylabel
89-
; CHECK-NEXT: i32.const -4
90-
; CHECK-NEXT: i32.add
89+
; CHECK-NEXT: i32.const 4
90+
; CHECK-NEXT: i32.sub
9191
; CHECK-NEXT: i32.load 0
9292
define i32 @dont_fold_non_nuw_sub_load_2() {
9393
%t = load i32, ptr inttoptr (i32 sub (i32 ptrtoint (ptr @mylabel to i32), i32 4) to ptr), align 4
@@ -96,8 +96,8 @@ define i32 @dont_fold_non_nuw_sub_load_2() {
9696

9797
; CHECK-LABEL: dont_fold_non_nuw_sub_store_2:
9898
; CHECK: i32.const mylabel
99-
; CHECK-NEXT: i32.const -4
100-
; CHECK-NEXT: i32.add
99+
; CHECK-NEXT: i32.const 4
100+
; CHECK-NEXT: i32.sub
101101
; CHECK-NEXT: i32.const 5
102102
; CHECK-NEXT: i32.store 0
103103
define void @dont_fold_non_nuw_sub_store_2() {

0 commit comments

Comments
 (0)