Skip to content

[WebAssembly] Fold TargetGlobalAddress with added offset #145829

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

Merged
merged 8 commits into from
Jul 3, 2025

Conversation

badumbatish
Copy link
Contributor

@badumbatish badumbatish commented Jun 26, 2025

Previously we only folded TargetGlobalAddresses into the memarg if they were on their own, so this patch supports folding TargetGlobalAddresses that are added to some other offset.

Previously we weren't able to do this because we didn't have nuw on the add, but we can now that getelementptr has nuw and is plumbed through to the add in 0564d06.

Fixes #61930

Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@badumbatish badumbatish changed the title Fold unsigned offset [WebAssembly] Fold unsigned offset Jun 26, 2025
@badumbatish badumbatish force-pushed the fold_unsigned_offset branch 2 times, most recently from 9db18a1 to 0b17309 Compare June 30, 2025 21:22
Fold nuw global add to a load.

Fix extra tests that involves loads in exception-legacy, eh-lsda, and address-offsets.
@badumbatish badumbatish force-pushed the fold_unsigned_offset branch from 0b17309 to 3dfe71a Compare July 1, 2025 17:51
@badumbatish badumbatish marked this pull request as ready for review July 1, 2025 17:57
@llvmbot
Copy link
Member

llvmbot commented Jul 1, 2025

@llvm/pr-subscribers-backend-webassembly

Author: jjasmine (badumbatish)

Changes

Fixes #61930 now that we've gotten the nuw flags in get element ptr.


Full diff: https://github.com/llvm/llvm-project/pull/145829.diff

5 Files Affected:

  • (modified) llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp (+10)
  • (modified) llvm/test/CodeGen/WebAssembly/address-offsets.ll (+4-4)
  • (modified) llvm/test/CodeGen/WebAssembly/eh-lsda.ll (+9-10)
  • (modified) llvm/test/CodeGen/WebAssembly/exception-legacy.ll (+1-1)
  • (modified) llvm/test/CodeGen/WebAssembly/offset.ll (+25)
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
index 48c0b7e50f080..38ce956bf9030 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyISelDAGToDAG.cpp
@@ -354,6 +354,16 @@ bool WebAssemblyDAGToDAGISel::SelectAddrAddOperands(MVT OffsetType, SDValue N,
       Addr = OtherOp;
       return true;
     }
+
+    // Fold Add of Global Address straight into load
+    if (Op.getOpcode() == WebAssemblyISD::Wrapper)
+      Op = Op.getOperand(0);
+
+    if (Op.getOpcode() == ISD::TargetGlobalAddress) {
+      Addr = OtherOp;
+      Offset = Op;
+      return true;
+    }
   }
   return false;
 }
diff --git a/llvm/test/CodeGen/WebAssembly/address-offsets.ll b/llvm/test/CodeGen/WebAssembly/address-offsets.ll
index 3f1ee592c8c61..d4adc75a7b4fc 100644
--- a/llvm/test/CodeGen/WebAssembly/address-offsets.ll
+++ b/llvm/test/CodeGen/WebAssembly/address-offsets.ll
@@ -12,8 +12,8 @@ define i32 @load_test0() {
 ; CHECK-LABEL: load_test0:
 ; CHECK:         .functype load_test0 () -> (i32)
 ; CHECK-NEXT:  # %bb.0:
-; CHECK-NEXT:    global.get $push0=, g@GOT
-; CHECK-NEXT:    i32.load $push1=, 40($pop0)
+; CHECK-NEXT:    i32.const $push0=, 40
+; CHECK-NEXT:    i32.load $push1=, g@GOT($pop0)
 ; CHECK-NEXT:    return $pop1
   %t = load i32, ptr getelementptr inbounds ([0 x i32], ptr @g, i32 0, i32 10), align 4
   ret i32 %t
@@ -395,8 +395,8 @@ define void @store_test0(i32 %i) {
 ; CHECK-LABEL: store_test0:
 ; CHECK:         .functype store_test0 (i32) -> ()
 ; CHECK-NEXT:  # %bb.0:
-; CHECK-NEXT:    global.get $push0=, g@GOT
-; CHECK-NEXT:    i32.store 40($pop0), $0
+; CHECK-NEXT:    i32.const $push0=, 40
+; CHECK-NEXT:    i32.store g@GOT($pop0), $0
 ; CHECK-NEXT:    return
   store i32 %i, ptr getelementptr inbounds ([0 x i32], ptr @g, i32 0, i32 10), align 4
   ret void
diff --git a/llvm/test/CodeGen/WebAssembly/eh-lsda.ll b/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
index ce55f7620e14a..edebbd991f147 100644
--- a/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
+++ b/llvm/test/CodeGen/WebAssembly/eh-lsda.ll
@@ -1,9 +1,9 @@
-; RUN: llc < %s --mtriple=wasm32-unknown-unknown -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-unknown -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64
-; RUN: llc < %s --mtriple=wasm32-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64
-; RUN: llc < %s --mtriple=wasm32-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -relocation-model=pic | FileCheck %s -check-prefixes=CHECK,PIC -DPTR=32
-; RUN: llc < %s --mtriple=wasm64-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -relocation-model=pic | FileCheck %s -check-prefixes=CHECK,PIC -DPTR=64
+; RUN: llc < %s --mtriple=wasm32-unknown-unknown -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32 -DALIGNMENT=4
+; RUN: llc < %s --mtriple=wasm64-unknown-unknown -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64 -DALIGNMENT=8
+; RUN: llc < %s --mtriple=wasm32-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=32 -DALIGNMENT=4
+; RUN: llc < %s --mtriple=wasm64-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling | FileCheck %s -check-prefixes=CHECK,NOPIC -DPTR=64 -DALIGNMENT=8
+; RUN: llc < %s --mtriple=wasm32-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -relocation-model=pic | FileCheck %s -check-prefixes=CHECK,PIC -DPTR=32 -DALIGNMENT=4
+; RUN: llc < %s --mtriple=wasm64-unknown-emscripten -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-eh -exception-model=wasm -mattr=+exception-handling -relocation-model=pic | FileCheck %s -check-prefixes=CHECK,PIC -DPTR=64  -DALIGNMENT=8
 
 @_ZTIi = external constant ptr
 @_ZTIf = external constant ptr
@@ -66,18 +66,17 @@ try.cont:                                         ; preds = %entry, %catch.start
 
 ; CHECK-LABEL: test1:
 ; In static linking, we load GCC_except_table as a constant directly.
-; NOPIC:      i[[PTR]].const  $push[[CONTEXT:.*]]=, __wasm_lpad_context
+; NOPIC:      i[[PTR]].const  $push[[CONTEXT:.*]]=, [[ALIGNMENT]]
 ; NOPIC-NEXT: i[[PTR]].const  $push[[EXCEPT_TABLE:.*]]=, GCC_except_table1
-; NOPIC-NEXT: i[[PTR]].store  {{[48]}}($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
+; NOPIC-NEXT: i[[PTR]].store  __wasm_lpad_context($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
 
 ; In case of PIC, we make GCC_except_table symbols a relative on based on
 ; __memory_base.
 ; PIC:        global.get  $push[[CONTEXT:.*]]=, __wasm_lpad_context@GOT
-; PIC-NEXT:   local.tee  $push{{.*}}=, $[[CONTEXT_LOCAL:.*]]=, $pop[[CONTEXT]]
 ; PIC:        global.get  $push[[MEMORY_BASE:.*]]=, __memory_base
 ; PIC-NEXT:   i[[PTR]].const  $push[[EXCEPT_TABLE_REL:.*]]=, GCC_except_table1@MBREL
 ; PIC-NEXT:   i[[PTR]].add   $push[[EXCEPT_TABLE:.*]]=, $pop[[MEMORY_BASE]], $pop[[EXCEPT_TABLE_REL]]
-; PIC-NEXT:   i[[PTR]].store  {{[48]}}($[[CONTEXT_LOCAL]]), $pop[[EXCEPT_TABLE]]
+; PIC-NEXT:   i[[PTR]].store  __wasm_lpad_context@GOT(${{.*}}), $pop[[EXCEPT_TABLE]]
 
 ; CHECK: .section  .rodata.gcc_except_table,"",@
 ; CHECK-NEXT:   .p2align  2
diff --git a/llvm/test/CodeGen/WebAssembly/exception-legacy.ll b/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
index b4ffd185e3ca8..870ed3971672a 100644
--- a/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
+++ b/llvm/test/CodeGen/WebAssembly/exception-legacy.ll
@@ -34,7 +34,7 @@ define void @throw(ptr %p) {
 ; CHECK:       call      foo
 ; CHECK:     catch     $[[EXN:[0-9]+]]=, __cpp_exception
 ; CHECK:       global.set  __stack_pointer
-; CHECK:       i32.{{store|const}} {{.*}} __wasm_lpad_context
+; CHECK:       i32.{{store|const}} {{.*}} 4
 ; CHECK:       call       $drop=, _Unwind_CallPersonality, $[[EXN]]
 ; CHECK:       block
 ; CHECK:         br_if     0
diff --git a/llvm/test/CodeGen/WebAssembly/offset.ll b/llvm/test/CodeGen/WebAssembly/offset.ll
index 130508424f630..293fa6396f4ce 100644
--- a/llvm/test/CodeGen/WebAssembly/offset.ll
+++ b/llvm/test/CodeGen/WebAssembly/offset.ll
@@ -60,6 +60,31 @@ define i32 @load_i32_with_folded_gep_offset_nuw(ptr %p) {
   ret i32 %t
 }
 
+@global_data = hidden local_unnamed_addr global [12 x i8] c"Hello world\00", align 1
+
+define hidden signext i8 @global_load_i32_with_folded_gep_offset_nonconst_nuw(i32 noundef %idx) local_unnamed_addr {
+; CHECK-LABEL: global_load_i32_with_folded_gep_offset_nonconst_nuw:
+; CHECK:         .functype global_load_i32_with_folded_gep_offset_nonconst_nuw (i32) -> (i32)
+; CHECK:    i32.load8_s $push0=, global_data($0)
+; CHECK:    return $pop0
+entry:
+  %arrayidx = getelementptr inbounds nuw [12 x i8], ptr @global_data, i32 0, i32 %idx
+  %0 = load i8, ptr %arrayidx, align 1
+  ret i8 %0
+}
+
+define hidden signext i8 @global_load_i32_with_folded_gep_offset_const_nuw() local_unnamed_addr {
+; CHECK-LABEL: global_load_i32_with_folded_gep_offset_const_nuw:
+; CHECK:         .functype global_load_i32_with_folded_gep_offset_const_nuw () -> (i32)
+; CHECK:    i32.const $push0=, 0
+; CHECK:    i32.load8_s $push1=, global_data+2($pop0)
+; CHECK:    return $pop1
+entry:
+  %0 = load i8, ptr getelementptr inbounds nuw (i8, ptr @global_data, i32 2), align 1
+  ret i8 %0
+}
+
+
 ; We can't fold a negative offset though, even with an inbounds gep.
 
 ; CHECK-LABEL: load_i32_with_unfolded_gep_negative_offset:

@badumbatish
Copy link
Contributor Author

waiting for CI to pass before tagging

Copy link
Contributor

@lukel97 lukel97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just some nits on the tests

; NOPIC-NEXT: i[[PTR]].const $push[[EXCEPT_TABLE:.*]]=, GCC_except_table1
; NOPIC-NEXT: i[[PTR]].store {{[48]}}($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
; NOPIC-NEXT: i[[PTR]].store __wasm_lpad_context($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that this transformation eagerly swaps these 2 constants, even though it's not actually an optimization. I'm a little bit ambivalent about this because the original actually looks more natural to me (i.e. the operand contains the actual address, and the offset field is actually an offset). OTOH adding more complexity to the transform to prevent this doesn't seem great either, considering that it's not really any worse.

It does suggest though that we might be able to do a further optimization of actually combining these constants in the compiler? In an isolated case like this we couldn't actually remove the i32.const entirely (since there still needs to be an operand), and the constant offset field is always there, so it would potentially be of no benefit. But if we combine them into the offset and leave behind an i32.const 0, it's plausible that some subsequent optimization could remove it where appropriate. And this is a point where we have the information that the add is nuw so it's legal to do, whereas some subsequent pass (or post-link optimizer like Binaryen) might not have it. So it still seems worthwhile.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose if we want to be really galaxy-brained, it's possible to have a situation where splitting an LEB-encoded value into 2 can actually reduce the overall size because of the way the encoding works; e.g. if one value is 128 and the other is 0, it takes 3 bytes to encode the first and one for the second, but if we split them into 2 64s, they would encode in 1 byte each!

... still, that seems like a bit of a stretch and maybe not as good as just leaving the 0 in the const field.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh wait... actually we can't do this when one of the operands is relocatable anyway. So it doesn't really apply for this PR. And for cases where they are just regular constants, it seems likely they'd have already been combined earlier in the compiler pipeline anyway. So, yeah there's probably nothing there, other than my original observation about eagerly swapping the operands when there's no actual add instruction to eliminate.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that this transformation eagerly swaps these 2 constants, even though it's not actually an optimization. I'm a little bit ambivalent about this because the original actually looks more natural to me

FWIW I had the same thought too. I guess we could just swap around the offset and addrs and see if that maintains the original order in this test? But it's probably dependent on the order of the operands in the add node.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i tried swapping Addr and Offset in WebAssemblyISelDAGToDAG and it seems it generates bad machine code on several test case, for example: cfg-stackify-eh.ll

*** Bad machine code: Expected a register operand. ***
- function:    two_catches
- basic block: %bb.1 catch.start (0x149811920)
- instruction: STORE_I32_A32 2, killed %3:i32, @__wasm_lpad_context, killed %2:i32, implicit-def dead $arguments :: (store (s32) into `ptr getelementptr inbounds ({ i32, ptr, i32 }, ptr @__wasm_lpad_context, i32 0, i32 1)`)
- operand 2:   @__wasm_lpad_context

*** Bad machine code: Expected a register operand. ***
- function:    two_catches
- basic block: %bb.1 catch.start (0x149811920)
- instruction: %1:i32 = LOAD_I32_A32 2, killed %6:i32, @__wasm_lpad_context, implicit-def dead $arguments :: (dereferenceable load (s32) from `ptr getelementptr inbounds ({ i32, ptr, i32 }, ptr @__wasm_lpad_context, i32 0, i32 2)`)
- operand 3:   @__wasm_lpad_context
LLVM ERROR: Found 2 machine code errors.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll push the changes to current nits (excluding swapping) but lmk if we'd like to pursue this avenue

; NOPIC-NEXT: i[[PTR]].const $push[[EXCEPT_TABLE:.*]]=, GCC_except_table1
; NOPIC-NEXT: i[[PTR]].store {{[48]}}($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
; NOPIC-NEXT: i[[PTR]].store __wasm_lpad_context($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting that this transformation eagerly swaps these 2 constants, even though it's not actually an optimization. I'm a little bit ambivalent about this because the original actually looks more natural to me

FWIW I had the same thought too. I guess we could just swap around the offset and addrs and see if that maintains the original order in this test? But it's probably dependent on the order of the operands in the add node.

Addresses reusing same global data, and realignment of test
case.
@dschuff
Copy link
Member

dschuff commented Jul 2, 2025

I guess this is fine, I can't currently think of a reason why having the symbol address in the offset field should make any real performance difference.

badumbatish and others added 2 commits July 2, 2025 17:02
Co-authored-by: Luke Lau <luke_lau@icloud.com>
@badumbatish
Copy link
Contributor Author

failing unrelated test in flang:

2025-07-03T04:43:40.4429321Z FAIL: Flang :: Semantics/windows.f90 (3488 of 3566)
2025-07-03T04:43:40.4430217Z ******************** TEST 'Flang :: Semantics/windows.f90' FAILED ********************
2025-07-03T04:43:40.4430930Z Exit Code: 1
2025-07-03T04:43:40.4431147Z 
2025-07-03T04:43:40.4431330Z Command Output (stdout):
2025-07-03T04:43:40.4431769Z --
2025-07-03T04:43:40.4432093Z --- 
2025-07-03T04:43:40.4432439Z +++ 
2025-07-03T04:43:40.4432791Z @@ -0,0 +1,2 @@
2025-07-03T04:43:40.4433028Z 
2025-07-03T04:43:40.4433445Z expect at 6: User IDs do not exist on Windows. This function will always return 1
2025-07-03T04:43:40.4434404Z expect at 11: Group IDs do not exist on Windows. This function will always return 1
2025-07-03T04:43:40.4435041Z 
2025-07-03T04:43:40.4435176Z FAIL
2025-07-03T04:43:40.4435380Z 
2025-07-03T04:43:40.4435513Z --
2025-07-03T04:43:40.4435878Z Command Output (stderr):
2025-07-03T04:43:40.4436983Z --
2025-07-03T04:43:40.4437401Z RUN: at line 1 has no command after substitutions
2025-07-03T04:43:40.4440415Z "/usr/bin/python3" /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Semantics/test_errors.py /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Semantics/windows.f90 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang --target=aarch64-pc-windows-msvc -Werror # RUN: at line 2
2025-07-03T04:43:40.4444459Z + /usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Semantics/test_errors.py /home/gha/actions-runner/_work/llvm-project/llvm-project/flang/test/Semantics/windows.f90 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/bin/flang --target=aarch64-pc-windows-msvc -Werror
2025-07-03T04:43:40.4446518Z 
2025-07-03T04:43:40.4446644Z --
2025-07-03T04:43:40.4446827Z 
2025-07-03T04:43:40.4446948Z ********************

@lukel97 lukel97 changed the title [WebAssembly] Fold unsigned offset [WebAssembly] Fold TargetGlobalAddress with added offset Jul 3, 2025
@lukel97 lukel97 merged commit cbc2ac5 into llvm:main Jul 3, 2025
7 of 9 checks passed
Copy link

github-actions bot commented Jul 3, 2025

@badumbatish Congratulations on having your first Pull Request (PR) merged into the LLVM Project!

Your changes will be combined with recent changes from other authors, then tested by our build bots. If there is a problem with a build, you may receive a report in an email or a comment on this PR.

Please check whether problems have been caused by your change specifically, as the builds can include changes from many authors. It is not uncommon for your change to be included in a build that fails due to someone else's changes, or infrastructure issues.

How to do this, and the rest of the post-merge process, is covered in detail here.

If your change does cause a problem, it may be reverted, or you can revert it yourself. This is a normal part of LLVM development. You can fix your changes and open a new PR to merge them again.

If you don't get any reports, no action is required from you. Your changes are working as expected, well done!

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jul 3, 2025

LLVM Buildbot has detected a new failure on builder flang-arm64-windows-msvc running on linaro-armv8-windows-msvc-01 while building llvm at step 7 "test-build-unified-tree-check-flang".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/207/builds/3310

Here is the relevant piece of the build log for the reference
Step 7 (test-build-unified-tree-check-flang) failure: test (failure)
******************** TEST 'Flang :: Parser/OpenMP/declare-reduction-operator.f90' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 1
c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe -fc1 -fdebug-unparse -fopenmp C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90 | c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe --ignore-case C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90
# executed command: 'c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe' -fc1 -fdebug-unparse -fopenmp 'C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90'
# .---command stderr------------
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
# | Stack dump:
# | 0.	Program arguments: c:\\users\\tcwg\\llvm-worker\\flang-arm64-windows-msvc\\build\\bin\\flang.exe -fc1 -fdebug-unparse -fopenmp C:\\Users\\tcwg\\llvm-worker\\flang-arm64-windows-msvc\\llvm-project\\flang\\test\\Parser\\OpenMP\\declare-reduction-operator.f90
# | Exception Code: 0xC0000005
# |  #0 0x00007ff61f612d80 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a92d80)
# |  #1 0x00007ff61f610a68 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a90a68)
# |  #2 0x00007ff61f60e8fc (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a8e8fc)
# |  #3 0x00007ff61f614610 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a94610)
# |  #4 0x00007ff61f60e464 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x1a8e464)
# |  #5 0x00007ff61e42cba0 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8acba0)
# |  #6 0x00007ff61e476000 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8f6000)
# |  #7 0x00007ff61e51eebc (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x99eebc)
# |  #8 0x00007ff61e47543c (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x8f543c)
# |  #9 0x00007ff61dc18ac0 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x98ac0)
# | #10 0x00007ff61dc2ea88 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0xaea88)
# | #11 0x00007ff61db834e8 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x34e8)
# | #12 0x00007ff61db820a4 (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x20a4)
# | #13 0x00007ff62283eff8 mlir::detail::FallbackTypeIDResolver::registerImplicitTypeID(class llvm::StringRef) (c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\flang.exe+0x4cbeff8)
# | #14 0x26747ff62283f094
# `-----------------------------
# error: command failed with exit status: 0xc0000005
# executed command: 'c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe' --ignore-case 'C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90'
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  c:\users\tcwg\llvm-worker\flang-arm64-windows-msvc\build\bin\filecheck.exe --ignore-case C:\Users\tcwg\llvm-worker\flang-arm64-windows-msvc\llvm-project\flang\test\Parser\OpenMP\declare-reduction-operator.f90
# `-----------------------------
# error: command failed with exit status: 2

--

********************


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

Successfully merging this pull request may close these issues.

Fold adds with global addresses into load offset
5 participants