Commit Graph

441202 Commits

Author SHA1 Message Date
River Riddle ce57789d8e [mlir:PDL] Add support for creating ranges in rewrites
This commit adds support for building a concatenated range from
a given set of elements, either single element or other ranges, within a
rewrite. We could conceptually extend this to support constraining
input ranges, but the logic there is quite a bit more complex so it is
left for later work when a need arises.

Differential Revision: https://reviews.llvm.org/D133719
2022-11-08 01:57:57 -08:00
River Riddle 8c66344ee9 [mlir:PDL] Add support for DialectConversion with pattern configurations
Up until now PDL(L) has not supported dialect conversion because we had no
way of remapping values or integrating with type conversions. This commit
rectifies that by adding a new "pattern configuration" concept to PDL. This
essentially allows for attaching external configurations to patterns, which
can hook into pattern events (for now just the scope of a rewrite, but we
could also pass configs to native rewrites as well). This allows for injecting
the type converter into the conversion pattern rewriter.

Differential Revision: https://reviews.llvm.org/D133142
2022-11-08 01:57:57 -08:00
Thomas Preud'homme f3a86a23c1 [Test] Fix driverkit-path.c with lib64 dir
Reviewed By: yln

Differential Revision: https://reviews.llvm.org/D137484
2022-11-08 09:54:47 +00:00
Caroline Concatto 1a917568e7 [AArch64]SME2 MOV Instructions
This patch adds the assembly/disassembly for the following instructions:

MOVA (array to vector, four registers): Move four ZA single-vector groups to four vector registers.
     (array to vector, two registers): Move two ZA single-vector groups to two vector registers.
     (tile to vector, four registers): Move four ZA tile slices to four vector registers.
     (tile to vector, single): Move ZA tile slice to vector register.
     (tile to vector, two registers): Move two ZA tile slices to two vector registers.
     (vector to array, four registers): Move four vector registers to four ZA single-vector groups.
     (vector to array, two registers): Move two vector registers to two ZA single-vector groups.
     (vector to tile, four registers): Move four vector registers to four ZA tile slices.
     (vector to tile, single): Move vector register to ZA tile slice.
     (vector to tile, two registers): Move two vector registers to two ZA tile slices.

The reference can be found here:

https://developer.arm.com/documentation/ddi0602/2022-09

It add more sizes for Matrix Operand:
MatrixOp8 and MatrixOp16
two implicit operands uimm0s2range and uimm0s4range.
and  uimm1s2range that are immediates

Differential Revision: https://reviews.llvm.org/D136142
2022-11-08 09:51:56 +00:00
David Sherwood 17813095de [AArch64][SVE2] Add the SVE2.1 FP quadword reduction instructions
This patch adds the assembly/disassembly for the following instructions:

faddqv   : Floating-point add recursive reduction of quadword vector segments
fmaxqv   : Floating-point maximum reduction of quadword vector segments
fmaxnmqv : Floating-point maximum number recursive reduction of quadword vector segments
fminqv   : Floating-point minimum recursive reduction of quadword vector segments
fminnmqv : Floating-point minimum number recursive reduction of quadword vector segments

The reference can be found here:
https://developer.arm.com/documentation/ddi0602/2022-09

Differential Revision: https://reviews.llvm.org/D137419
2022-11-08 09:49:19 +00:00
Tobias Hieta aa99b607b5
[clang][pdb] Don't include -fmessage-length in PDB buildinfo
As discussed in https://reviews.llvm.org/D136474 -fmessage-length
creates problems with reproduciability in the PDB files.

This patch just drops that argument when writing the PDB file.

Reviewed By: hans

Differential Revision: https://reviews.llvm.org/D137322
2022-11-08 10:05:59 +01:00
Javier Setoain aa9647e2d0 [mlir][vector] Add vector.scalable.insert/extract ops
These new operations match the semantics of
llvm.experimental.vector.insert and llvm.experimental.vector.extract.

`vector.scalable.insert` and `vector.scalable.extract` allow,
respectively, insert vectors into scalable vectors, and extract vectors
from scalable vectors.

The discussion about the inclusion of these operations is here:
https://discourse.llvm.org/t/rfc-interfacing-between-fixed-length-and-scalable-vectors-for-vls-vector-code-on-scalable-vector-architectures

Differential Revision: https://reviews.llvm.org/D127875
2022-11-08 08:51:15 +00:00
Tobias Gysi 54fb17347b [mlir][llvm] Test LLVM IR constant import separately.
The revision moves tests related to LLVM IR constant import
into a separate constant.ll file and adds tests for integer,
null and undef immediates.

Depends on D136679

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D137416
2022-11-08 10:35:20 +02:00
Nikita Popov 3ddf56fd37 [Statepoint] Use default attributes for some GC intrinsics
This adds the default intrinsic attributes (nosync, nofree, nocallback,
willreturn) to the gc.result, gc.relocate, gc.pointer.base and
gc.pointer.offset intrinsics. As far as I understand, all of these
are supposed to be pure. Some quotes from LangRef:

> A gc.result is modeled as a ‘readnone’ pure function. It has no
> side effects since it is just a projection of the return value of
> the previous call represented by the gc.statepoint.

> A gc.relocate is modeled as a readnone pure function. It has no
> side effects since it is just a way to extract information about
> work done during the actual call modeled by the gc.statepoint.

Having willreturn in particular will be important to avoid
optimization regressions in the future.

Differential Revision: https://reviews.llvm.org/D136929
2022-11-08 09:27:22 +01:00
Nikita Popov 3705e038e4 [X86] Use default attributes for even more intrinsics
Another followup to D136939: This switches readonly X86 intrinsics
to use default attributes (nosync, nofree, nocallback and willreturn).

With this, all readnone/readonly intrinsics should be covered,
only memory writing intrinsics are left.

Differential Revision: https://reviews.llvm.org/D137552
2022-11-08 09:26:53 +01:00
Tobias Gysi 9aae3dd94c [mlir][llvm] Update insertion point handling in LLVM import.
Insert constants and globals in order by maintaining the position
of the constant and global inserted last. Update the tests
to reflect the updated insertion order. Also make sure functions
are always inserted at the end of the module instead of at
the second last position and delete a spurious function in
the intrinsic.ll that seems to exist to avoid the first
function under test ends up at the end of the module.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D136679
2022-11-08 10:07:52 +02:00
Pierre van Houtryve 767999fca8 [AMDGPU][GlobalISel] Support mad/fma_mix selection
Adds support for selecting the following instructions using GlobalISel:
- v_mad_mix/v_fma_mix
- v_mad_mixhi/v_fma_mixhi
- v_mad_mixlo/v_fma_mixlo

To select those instructions properly, some additional changes were
needed which impacted other tests as well.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D134354
2022-11-08 08:02:34 +00:00
Chuanqi Xu d1f90b6129 [NFC] [C++20] [Modules] Rename ASTWriter::isWritingStdCXXNamedModules
According to the discussion in
https://discourse.llvm.org/t/rfc-unifying-the-terminology-about-modules-in-clang/66054,
this patch rename ASTWriter::isWritingNamedModules to ASTWriter::isWrittingStdCXXNamedModules
to make the name more clear.
2022-11-08 15:58:46 +08:00
Pierre van Houtryve 7425077e31 [AMDGPU] Add & use `hasNamedOperand`, NFC
In a lot of places, we were just calling `getNamedOperandIdx` to check if the result was != or == to -1.
This is fine in itself, but it's verbose and doesn't make the intention clear, IMHO. I added a `hasNamedOperand` and replaced all cases I could find with regexes and manually.

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D137540
2022-11-08 07:57:21 +00:00
Pierre van Houtryve b5f9972345 [SIFoldOperands] Small code cleanups, NFC.
I've been trying to understand the backend better and decided to read the code of this pass.
While doing so, I noticed parts that could be refactored to be a tiny bit clearer.
I tried to keep the changes minimal, a non-exhaustive list of changes is:
- Stylistic changes to better fit LLVM's coding style
- Removing dead/useless functions (e.g. FoldCandidate had getters, but it's a public struct!)
 - Saving regs/opcodes in variables if they're going to be used multiple times in the same condition

Reviewed By: arsenm, foad

Differential Revision: https://reviews.llvm.org/D137539
2022-11-08 07:51:48 +00:00
haoyuintel 13f83365cd [Driver] Add -fsample-profile-use-profi
This patch enable `-sample-profile-use-profi` in Clang frontend as user-facing
feature. By using this patch, we can use the cflag of `-fsample-profile-use-profi`
instead of `-mllvm -sample-profile-use-profi`.

Reviewed By: hans, MaskRay

Differential Revision: https://reviews.llvm.org/D136846
2022-11-08 15:51:38 +08:00
Pierre van Houtryve 70c781f4b6 [SIFoldOperands] Move `isFoldableCopy` into a separate helper, NFC.
There was quite a bit of logic there that was just in the middle of core loop. I think it makes it easier to follow when it's split off in a separate helper like the others.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D137538
2022-11-08 07:44:34 +00:00
Haohai Wen 1c355352c7 [X86] Add In64BitMode predicates for LOCK_INC64m, LOCK_DEC64m
These two instructions are only encodable in 64bit mode.

Reviewed By: pengfei

Differential Revision: https://reviews.llvm.org/D137608
2022-11-08 15:16:35 +08:00
Dmitry Makogon ebac59999f [SimpleLoopUnswitch] Skip trivial selects in guards conditions unswitch candidates
We do this for conditional branches, but not for guards for some reason.

Fixes pr58666.

Differential Revision: https://reviews.llvm.org/D137249
2022-11-08 13:29:27 +07:00
Paulo Matos b293de9880 [Docs] Add my Office Hours 2022-11-07 22:02:07 -08:00
Matt Arsenault e661185fb3 InstCombine: Fold fdiv nnan x, 0 -> copysign(inf, x)
https://alive2.llvm.org/ce/z/gLBFKB
2022-11-07 22:00:15 -08:00
Chen Zheng 6ceb607b30 [PowerPC][NFC] remove the rop-protect attribute in LIT cases.
This flag will cause LLC warning:

"'-rop-protection' is not a recognized feature for this target
(ignoring feature)"

Remove this unused feature first. We may also need to check why
llc emits this warning as we declare '-rop-protection' not
'+rop-protection'.
2022-11-08 05:51:02 +00:00
Matt Arsenault 4638ba7b45 llvm-reduce: Try to turn calls into something else
Try to turn calls that look like operators into known
intrinsics. Also try to turn calls that look like a load or
a store into a load or store.
2022-11-07 21:04:21 -08:00
skc7 9d96feb19b [SLP][NFC] Restructure areTwoInsertFromSameBuildVector
Reviewed By: ABataev

Differential Revision: https://reviews.llvm.org/D137569
2022-11-08 09:32:19 +05:30
Slava Zakharin e72fb69210 [mlir][arith] Convert fastmath to LLVM dialect for some arith ops.
This is a follow-up on D126305 and D136225.
We can now preserve fastmath for arith::MaxFOp,MinFOp,RemFOp during
ArithToLLVM conversion.

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D137456
2022-11-07 19:39:51 -08:00
Dave Lee 7bf3cb3ee8 [lldb] Fix issue with re.Pattern availability
`re.Pattern` is introduced in Python 3.7. To support Python 3.6, fallback to typechecking against `SRE_Pattern`.

Differential Revision: https://reviews.llvm.org/D137582
2022-11-07 19:33:57 -08:00
YunQiang Su 674a17e9bb MIPS/compiler_rt: use synci to flush icache on r6
syscall makes it failed to build on mips64 for mipsel:
```
compiler-rt/lib/builtins/clear_cache.c:97:3: error:
call to undeclared function 'syscall'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  syscall(__NR_cacheflush, start, (end_int - start_int), BCACHE);
```

In this patch, we use `rdhwr` to get synci_step.
If synci_step is zero, it means that the hardware will maintain the coherence. We need to do nothing.
Then for r6+, `synci` is required to keep icache global.
So we can use `synci` to flush icache.
The ISA documents ask a `sync` and a `jr.hb` after `synci`.

For pre-r6, we can use cacheflush libc function, which is same on Linux and FreeBSD.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D135565
2022-11-07 17:43:41 -08:00
Sam James 32a2af44e1 [CMake] Fix -Wstrict-prototypes
Fixes warnings (or errors, if someone injects -Werror in their build system,
which happens in fact with some folks vendoring LLVM too) with Clang 16:
```
+/var/tmp/portage.notmp/portage/sys-devel/llvm-15.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9: warning: a function declaration without a prototype
is deprecated in all versions of C [-Wstrict-prototypes]
-/var/tmp/portage.notmp/portage/sys-devel/llvm-14.0.4/work/llvm_build-abi_x86_64.amd64/CMakeFiles/CMakeTmp/src.c:3:9: error: a function declaration without a prototype is
deprecated in all versions of C [-Werror,-Wstrict-prototypes]
 int main() {return 0;}
         ^
          void
```

Differential Revision: https://reviews.llvm.org/D137503
2022-11-08 01:37:04 +00:00
Katherine Rasmussen ecedc4d710 [flang] Add atomic_xor to list of intrinsics
Add the atomic subroutine, atomic_xor, to the list of
intrinsic subroutines, add its last dummy argument to a check
for a coindexed-object, and update test.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D137196
2022-11-07 16:52:59 -08:00
Daniel Thornburgh 32a02a9c6b [Debuginfod] DEBUGINFOD_HEADERS_FILE environment variable
This change adds a DEBUGINFOD_HEADERS_FILE environment variable provides
a file containing HTTP headers to attach to outgoing HTTP requests, one
per line. This allows a file permissioned with OS access control
mechanisms to supply bearer credentials for Debuginfod requests.

This matches the mechanism recently added to elfutils' libdebuginfod.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D136303
2022-11-07 16:34:37 -08:00
Lei Zhang 7c2d3153a9 [mlir][spirv] Don't return value when cannot fold spirv.bitcast
Returing a value would make the canonicalization infrastructure
think that folding succeeded so the pattern will be tried again
when invoked via, e.g., `applyPatternsAndFoldGreedily` and
eventually fail due to not converging after 10 times by default.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D137598
2022-11-07 19:11:46 -05:00
LLVM GN Syncbot ec9aae9784 [gn build] Port 428ac8f3a0 2022-11-07 23:22:09 +00:00
Shubham Sandeep Rastogi b22d80dc6a Revert "[NFC] Move getDebugValueLoc from static in Local.cpp to DebugInfo.h"
This reverts commit 80378a4ca7.

    I am reverting this patch because I need to revert 171f7024cc and without reverting this patch, reverting 171f7024cc causes conflicts.

     Patch 171f7024cc introduced a cyclic dependancy in the module build.

        https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c

        In file included from <module-includes>:1:
        /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR
                 ^
        While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
        While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:
        In file included from <module-includes>:12:
        /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen'
         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
        While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
        In file included from <module-includes>:15:
        In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23:
        /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR'
         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
        /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC'
         ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
        4 errors generated.
2022-11-07 15:19:04 -08:00
River Riddle 604027519e [mlir:SubElementInterfaces] Remove unnecessary static check
We already constrain the template on just attributes/types.
2022-11-07 15:13:21 -08:00
Shubham Sandeep Rastogi 41f5a0004e Revert "[Assignment Tracking][5/*] Add core infrastructure for instruction reference"
This reverts commit 171f7024cc.

Reverting this patch because it causes a cyclic dependency in the module build

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c

In file included from <module-includes>:1:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR
         ^
While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:
In file included from <module-includes>:12:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
In file included from <module-includes>:15:
In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
2022-11-07 15:09:05 -08:00
Shubham Sandeep Rastogi 4c37a413e5 Revert "Fix warning: comparison of integers of different signs"
This reverts commit 028df7fab1.

I am reverting this patch because I need to revert 171f7024cc and without reverting this patch, reverting 171f7024cc causes conflicts.

 Patch 171f7024cc introduced a cyclic dependancy in the module build.

    https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c

    In file included from <module-includes>:1:
    /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR
             ^
    While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
    While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:
    In file included from <module-includes>:12:
    /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen'
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
    In file included from <module-includes>:15:
    In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23:
    /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR'
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
    /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC'
     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
    4 errors generated.
2022-11-07 15:09:05 -08:00
Shubham Sandeep Rastogi d29d5ffb63 Revert "[Assignment Tracking][5.1/*] Add deleteAssignmentMarkers function"
This reverts commit 4c44fa1c38.

This patch has to be reverted because I need to revert 171f7024cc and without reverting this patch, reverting 171f7024cc causes conflicts.

Patch 171f7024cc introduced a cyclic dependency in the module build.

https://green.lab.llvm.org/green/view/LLDB/job/lldb-cmake/48197/consoleFull#-69937453049ba4694-19c4-4d7e-bec5-911270d8a58c

In file included from <module-includes>:1:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/Argument.h:18:10: fatal error: cyclic dependency in module 'LLVM_IR': LLVM_IR -> LLVM_intrinsic_gen -> LLVM_IR
         ^
While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
While building module 'LLVM_IR' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:
In file included from <module-includes>:12:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/IR/DebugInfo.h:24:10: fatal error: could not build module 'LLVM_intrinsic_gen'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
While building module 'LLVM_MC' imported from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:
In file included from <module-includes>:15:
In file included from /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCContext.h:23:
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include/llvm/MC/MCPseudoProbe.h:57:10: fatal error: could not build module 'LLVM_IR'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/lib/MC/MCAsmInfoCOFF.cpp:14:10: fatal error: could not build module 'LLVM_MC'
 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
4 errors generated.
2022-11-07 15:09:05 -08:00
Sami Tolvanen 41ce74e6e9 [Clang][Sema] Add -Wincompatible-function-pointer-types-strict
Clang supports indirect call Control-Flow Integrity (CFI) sanitizers
(e.g. -fsanitize=cfi-icall), which enforce an exact type match
between a function pointer and the target function. Unfortunately,
Clang doesn't provide diagnostics that help developers avoid
function pointer assignments that can lead to runtime CFI
failures. -Wincompatible-function-pointer-types doesn't warn about
enum to integer mismatches if the types are otherwise compatible, for
example, which isn't sufficient with CFI.

Add -Wincompatible-function-pointer-types-strict, which checks for a
stricter function type compatibility in assignments and helps warn about
assignments that can potentially lead to CFI failures.

Reviewed By: aaron.ballman, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D136790
2022-11-07 23:05:28 +00:00
Amara Emerson f64802e8d3 [Clang][AArch64][Darwin] Enable GlobalISel by default for Darwin ARM64 platforms.
Differential Revision: https://reviews.llvm.org/D137269
2022-11-07 15:04:09 -08:00
Nathan Ridge 428ac8f3a0 [clangd] Rename QueryDriverDatabase.cpp to SystemIncludeExtractor.cpp
Differential Revision: https://reviews.llvm.org/D137401
2022-11-07 17:58:42 -05:00
Nathan Ridge 68e230aa29 [clangd] Perform system include extraction inside CommandMangler
It needs to run after edits from config files are applied to
the compile command (because the config file may specify the
compiler), and before resolveDriver() runs at the end of
CommandMangler.

As part of this change, QueryDriverDatabase is renamed to
SystemIncludeExtractor and is no longer a GlobalCompilationDatabase.

Fixes https://github.com/clangd/clangd/issues/1089
Fixes https://github.com/clangd/clangd/issues/1173
Fixes https://github.com/clangd/clangd/issues/1263

Differential Revision: https://reviews.llvm.org/D133757
2022-11-07 17:58:39 -05:00
Nathan Ridge afa22c563f [clangd] Pass the entire tooling::CompileCommand to CommandMangler
This gives CommandMangler access to other fields of
tooling::CompileCommand as well, e.g. Directory.

Differential Revision: https://reviews.llvm.org/D133756
2022-11-07 17:58:37 -05:00
Daniel Bertalan 79f9f1f8e3
[lld-macho] Ensure that chained fixups data comes first in __LINKEDIT
libstuff-based tools (e.g. `codesign` and `strip`) require
`__chainfixups` to be the first section in `__LINKEDIT`, and print a
"file not in an order that can be processed" error message if that is
not the case.

Differential Revision: https://reviews.llvm.org/D137492
2022-11-07 23:51:24 +01:00
Fangrui Song 432a7e2844 [libomp] Add -Wl,--undefined-version workaround
Issue #58858: when linking libomp.so, exports_so.txt has non-existent/undefined
symbols which cause errors to ld --no-undefined-version. Use
-Wl,--undefined-version if available (gold, ld.lld, future GNU ld 2.40).
2022-11-07 22:15:28 +00:00
Dan Albert eedbe44b87 [LLD] Enable --no-undefined-version by default.
Allowing incorrect version scripts is not a helpful default. Flip that
to help users find their bugs at build time rather than at run time.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D135402
2022-11-07 22:15:28 +00:00
Michael Jones 430ca14af8 [libc][obvious] fix tests using wrong size for string
In the code
const char *str = "abc"
if you do sizeof(str) you get the size of the pointer, not the string.
This patch fixes that mistake.

Differential Revision: https://reviews.llvm.org/D137586
2022-11-07 14:04:39 -08:00
Grace Jennings 86674f66cc [HLSL] Added HLSL this as a reference
This change makes `this` a reference instead of a pointer in
HLSL. HLSL does not have the `->` operator, and accesses through `this`
are with the `.` syntax.

Tests were added and altered to make sure
the AST accurately reflects the types.

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D135721
2022-11-07 13:50:08 -08:00
Michael Jones 1c40d5ec7d [libc] add scanf string converters
This patch adds the basic conversion facilities to scanf as well as unit
tests for them. It also adds scanf_main which will be used for the
eventual scanf entrypoints.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D137376
2022-11-07 13:49:01 -08:00
Michael Jones 0c8db885f6 [libc] add scanf reader
This is the interface that will be used to read from a file or string in
scanf. This patch also adds the string and file implementations of the
reader, although the file reader is not yet complete since ungetc has
not yet been implemented.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D137117
2022-11-07 13:48:58 -08:00
Siva Chandra Reddy 6a6101958a [libc] Add implementation of getc, getc_unlocked and fgetc_unlocked.
Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D137507
2022-11-07 21:47:29 +00:00