-
Notifications
You must be signed in to change notification settings - Fork 16
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
Basic support for gtest infra #89
Conversation
merges it onto a working branch.
- This requires analysis of local symbols. - To do that requires getting the symbol table (scope), which required threading the SemanticsContext for the main program. - Added sorting and sorrted symbol tables to the PFT. - Refactored temporaries. - Misc. refactoring to follow LLVM coding standard, etc.
With these changes, I can compile code like srot.f.
Also tightens and repairs two tests, resp.
The internal symbol map had served its purpose and needs to be replaced with a mapping structure that is more appropriate for Fortran variables, which can be composed of a number of runtime values. This new map will allow us to lower more complicated entities correctly by tracking their component values.
* Generate FIR for a group of multi-way branches - arithmetic if - assigned goto (needs assign statement, which is also implemented) - computed goto - select case * Review comment update.
fix compilation issue post merge
…ap for lowering. This piece primarily gets started in the direction of being able to lower dynamic arrays and character types correctly. There is still more work in fully leveraging this in the bridge, but all the existing tests pass with this rewrite.
This patch changes the FIR region operations to be more like those found in the loop dialect. The changes are driven by the desire to be able to convert FIR into a register ssa form. The changes are specifically: - fir.loop has been replaced by fir.do_loop. The new form has the same semantics (inclusive bounds, unordered), but can now carry ssa-values around the loop and return them as results to the parent. - fir.where has been replaced by fir.if. This new form is identical to the current loop.if operation. - fir.iterate_while has been added. This operation is very similar to fir.loop with the addition that it requires a single loop-carried bool value that signals an early-exit condition to the operation. While that value is true, iterate_while will continue to iterate. When it becomes false, the loop is exited. - fir.result is the new terminator for the above ops to facilitate the carrying of ssa-values through block arguments (phi nodes). Change the syntax for fir.iterate_while to make it clear that the iterate condition is required. Fixes bugs with lowering of fir.iterate_while to CFG. The lowered code produced is now as follows. %0 = llvm.mlir.constant(1 : index) : !llvm.i64 %1 = llvm.mlir.constant(100 : index) : !llvm.i64 llvm.br ^bb1(%0, %arg0, %arg1 : !llvm.i64, !llvm.i1, !llvm.i32) ^bb1(%2: !llvm.i64, %3: !llvm.i1, %4: !llvm.i32): // 2 preds: ^bb0, ^bb2 %5 = llvm.icmp "slt" %2, %1 : !llvm.i64 %6 = llvm.and %5, %3 : !llvm.i1 llvm.cond_br %6, ^bb2, ^bb3 ^bb2: // pred: ^bb1 %7 = ... : !llvm.i1 %8 = llvm.add %2, %0 : !llvm.i64 llvm.br ^bb1(%8, %7, %4 : !llvm.i64, !llvm.i1, !llvm.i32) ^bb3: // pred: ^bb1 [review comment] improve description text to make it more clear [review] minor cleanups per review comments
1. Initialize scalar intrinsic types 2. Add test global inits. 3. Add TODO place holders for things that need to be implemented
speculatively. This eliminates creation of some empty fir.if blocks.
…ence, we don't need or want to create a reference to the reference to pass the original reference. Instead just pass the reference itself. add FIXME for POINTER and ALLOCATABLE
this change exposes a problem in PFT.
We're near the end of bugs and missing features to support the F77 version of LAPACK. Removing this file in favor of opening Issues on github to track any new problems.
remove the LAPACK-bugs.txt file.
fixes issue #74
These operations used to have different complexity, but it looks like they are both constant as of C++11. Making this change just to be consistent with other tests.
A small typo in '--fdebug-dump-pre-fir'.
Another crash apparently related to issue #74. Add check for empty list.
Add name mangling support for constants in procedures.
Perhaps missing Btw, the target that you've defined here is |
The flang/CMakeLists.txt file probably needs some more work. For example, clang has the following to set up its testing. https://github.com/flang-compiler/f18-llvm-project/blob/fir-dev/clang/CMakeLists.txt#L561-L590 |
It seems like there are some unittests written without using gtest and they tend to use
Can we add only a single directory from unittests/ folder?
I grepped for similar targets in llvm( |
Similar approach lldb and lld, follow also we have
I might be wrong here but how does mlir work by just adding the directory without checks? f18-llvm-project/mlir/CMakeLists.txt Line 47 in 72b6b1d
I think clang is mixing regression tests and unittests, where as we have a LIT based regression tests merged in. I think the issue might be raise from the older gtest setup already in place and there is a ticket for porting them to gtest |
Can this be added to llvm-project/flang? |
@kiranchandramohan Thanks. I will push the part except the fir test into |
I didn't notice that, my bad! So yes, you need Otherwise everything should be in place. Include paths for GTest are set in add_unittests (which you call here).
IIUC, there are currently only CTest tests in Flang (enabled here). I'm not aware of anything that would prevent CTest and GTest tests to co-exists.
Edit:
I might be missing something obvious though! |
@Sameeranjoshi That sounds OK to me. But consider the following if it is not too much work. I was thinking that with unit tests, functions can be individually tested. If so it might be possible to test the name-mangling functions with what is already there in llvm-project/flang + Mangler.cpp, Mangler.h. And this does not require fir. |
Merged after rebase. |
This PR adds support for thread names in lldb on Windows. ``` (lldb) thr list Process 2960 stopped thread flang-compiler#53: tid = 0x03a0, 0x00007ff84582db34 ntdll.dll`NtWaitForMultipleObjects + 20 thread flang-compiler#29: tid = 0x04ec, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'SPUW.6' thread flang-compiler#89: tid = 0x057c, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x1000019] physics[main]' thread flang-compiler#3: tid = 0x0648, 0x00007ff843c2cafe combase.dll`InternalDoATClassCreate + 39518 thread flang-compiler#93: tid = 0x0688, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x100501d] uMovie::StreamingThread' thread flang-compiler#1: tid = 0x087c, 0x00007ff842e7a104 win32u.dll`NtUserMsgWaitForMultipleObjectsEx + 20 thread flang-compiler#96: tid = 0x0890, 0x00007ff845830a14 ntdll.dll`NtWaitForAlertByThreadId + 20, name = 'PPU[0x1002020] HLE Video Decoder' <...> ```
…ang-compiler#89) * [flang][OpenMP] Add support for multi-range `do concurrent` loops Extends `do concurrent` to OpenMP mapping by adding support for multi-range loops. The current implementation only works for perfectly nested loops. So taking this input: ```fortran do concurrent(i=1:n, j=1:m) a(i,j,k) = i * j end do ``` will behave in exactly the same way as this input: ``` do concurrent(i=1:n) do concurrent(j=1:m) a(i,j,k) = i * j end do end do ```
I tried building using
-DLLVM_BUILD_TESTS=ON
I couldn't find any
check-flang-optimizer
target norcheck-flang-unit target
The test is a dummy test, would work on that aggressively once the setup in done.
Can anyone from here guide on what information I might be missing?