You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* [flang][driver] Extend support for LLVM IR/BC files
Before this change, `clangDriver` (i.e. the compiles driver library)
would always use `clang` to compile LLVM IR or LLVM BC files (even when
`flang-new` was used to invoke the driver). With this change, Flang will
finally accept LLVM IR and LLVM BC alongside e.g. Fortran input files.
This means that from now on it is up to the user to decide whether to
use Flang or Clang to compile an LLVM file (`flang-new -c file.bc` and
`clang -c file.bc`, respectively).
To complement this, support for generating LLVM BC files is added. This
requires the `BitcodeWriterPass` pass to be run on the input LLVM IR
module and is implemented as a dedicated frontend aciton.
The new functionality as seen by the user:
1. LLVM BC file generation (`flang-new -c -emit-llvm file.90` or
`flang-new -fc1 -emit-llvm-bc file.f90`)
2. Ability to consume LLVM IR and BC files and to lower them to object
files (`flang-new -c file.bc` or `flang-new -c file.ll`)
The new behaviour is consistent with `clang` and `clang -cc1`.
* [flang][driver] Add support for `-save-temps`
This patch adds support for `-save-temps` in `flang-new`, Flang's
compiler driver. The semantics of this option are inherited from Clang.
The file extension for temporary Fortran preprocessed files is set to
`i`. This is identical to what Clang uses for C (or C++) preprocessed
files. I have tried researching what other compilers do here, but I
couldn't find any definitive answers. One GFortran thread [1] suggests
that indeed it is not clear what the right approach should be.
As `-save-temps` makes the compiler run every phase separately, in Flang
one currently has to use it with `-fno-integrated-as`. Otherwise, an
invocation to the integrated assembler driver is generated (i.e.
something equivalent to `clang -cc1as` from Clang), but this is not yet
implemented in Flang.
[1] https://gcc.gnu.org/bugzilla//show_bug.cgi?id=81615
* Add missing llvm-dis dependency
clementval
added a commit
to clementval/llvm-project
that referenced
this issue
Feb 16, 2022
Extended Description
Weak, extern and linkonce symbols are currently excluded from address
operands in x86-64 with the small memory model and static linking.
With this test case:
%x = external global int
implementation
int %foo(long %i) {
%a = getelementptr int* %x, long %i
%t = load int* %a
ret int %t
}
Currently llc -march=x86-64 -code-model=small -relocation-model=static
emits this:
I believe should emit this:
Unless I'm missing something, it should be safe to let llc do this,
with the following patch.
Index: X86ISelDAGToDAG.cpp
RCS file: /var/cvs/llvm/llvm/lib/Target/X86/X86ISelDAGToDAG.cpp,v
retrieving revision 1.138
diff -u -r1.138 X86ISelDAGToDAG.cpp
--- X86ISelDAGToDAG.cpp
+++ X86ISelDAGToDAG.cpp
@@ -604,9 +604,7 @@
SDOperand N0 = N.getOperand(0);
if (GlobalAddressSDNode *G = dyn_cast(N0)) {
GlobalValue *GV = G->getGlobal();
The text was updated successfully, but these errors were encountered: