SuccessChanges

Summary

  1. [MLIR][OpenMP] Removed the ambiguity in flush op assembly syntax (details)
  2. [OpenMP][FIX] Verify compatible types for declare variant calls (details)
  3. [IndVars] Remove exiting conditions that are trivially true/false (details)
  4. [NFC] Use assert instead of checking the guaranteed condition (details)
  5. [Docs][NewPM] Add note about required passes (details)
  6. Revert "[OpenMP][FIX] Verify compatible types for declare variant calls" (details)
  7. [X86] Add known bits test for PEXT. NFC (details)
  8. [X86] Add computeKnownBits support for PEXT. (details)
  9. [Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists (details)
  10. This reduces code duplication between CGObjCMac.cpp and Mangle.cpp (details)
Commit f3ead88e9c6c352edb10cba43e62696fc852c7d6 by kirankumar.tp
[MLIR][OpenMP] Removed the ambiguity in flush op assembly syntax

Summary:
========
Bugzilla Ticket No: Bug 46884 [https://bugs.llvm.org/show_bug.cgi?id=46884]

Flush op assembly syntax was ambiguous:

Consider the below test case:
flush operation is not having any arguments.
But the next statement token i.e "%2" is read as the argument for flush operation and then translator issues an error.
***************************************************************
$ cat -n flush.mlir
     1  llvm.func @_QQmain(%arg0: !llvm.i32) {
     2    %0 = llvm.mlir.constant(1 : i64) : !llvm.i64
     3    %1 = llvm.alloca %0 x !llvm.i32 {in_type = i32, name = "a"} : (!llvm.i64) -> !llvm.ptr<i32>
     4    omp.flush
     5    %2 = llvm.load %1 : !llvm.ptr<i32>
     6    llvm.return
     7  }

$ mlir-translate -mlir-to-llvmir flush.mlir
flush.mlir:5:6: error: expected ':'
  %2 = llvm.load %1 : !llvm.ptr<i32>
     ^
***************************************************************

Solution:
=========
Introduced begin ( `(` ) and end token ( `)` ) to determince the begin and end of variadic arguments.

The patch includes code changes and testcase modifications.

Reviewed By: Valentin Clement, Mehdi AMINI

Differential Revision: https://reviews.llvm.org/D88376
The file was modifiedmlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
The file was modifiedmlir/test/Dialect/OpenMP/ops.mlir
The file was modifiedmlir/test/Target/openmp-llvm.mlir
Commit c942095790decf525a445f3bd68fb9bcc9aa43c6 by johannes
[OpenMP][FIX] Verify compatible types for declare variant calls

Especially for templates we need to check at some point if the base
function matches the specialization we might call instead. Before this
lead to the replacement of `std::sqrt(int(2))` calls with one that
converts the argument to a `std::complex<int>`, clearly not the desired
behavior.

Reported as PR47655

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D88384
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was addedclang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
Commit d266fd960e73e2ebdcc194564fc2554ff629d12a by mkazantsev
[IndVars] Remove exiting conditions that are trivially true/false

When removing exiting loop conditions, we only consider checks for
which we know the exact exit count. We could also eliminate checks for
which the condition is always true/false.

Differential Revision: https://reviews.llvm.org/D87344
Reviewed By: lebedev.ri, reames
The file was modifiedllvm/test/Transforms/IndVarSimplify/eliminate-comparison.ll
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit e862e78b63f918c000ce65f9c475730e673a4966 by mkazantsev
[NFC] Use assert instead of checking the guaranteed condition

From preconditions it is known that either A dominates B or
B dominates A. If A does not dominate B, we do not really need
to check it. Assert should be enough. Should save some compile
time.
The file was modifiedllvm/lib/Transforms/Scalar/IndVarSimplify.cpp
Commit da036b4514702f3a7c1d2981ff11b3067bad4329 by aeubanks
[Docs][NewPM] Add note about required passes

Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D88342
The file was modifiedllvm/docs/WritingAnLLVMNewPMPass.rst
Commit 4fc69ab002382675d84f611f22599cb3cb4a0787 by johannes
Revert "[OpenMP][FIX] Verify compatible types for declare variant calls"

This reverts commit c942095790decf525a445f3bd68fb9bcc9aa43c6.

One of the tests broke, revert to investigate.
The file was modifiedclang/lib/Sema/SemaTemplateInstantiateDecl.cpp
The file was modifiedclang/lib/Sema/SemaOpenMP.cpp
The file was removedclang/test/AST/ast-dump-openmp-begin-declare-variant_template_3.cpp
Commit a4b1fdec9172cdb40b583884efb2971ee3b7e991 by craig.topper
[X86] Add known bits test for PEXT. NFC
The file was modifiedllvm/test/CodeGen/X86/bmi2-x86_64.ll
The file was modifiedllvm/test/CodeGen/X86/bmi2.ll
Commit 82da0cabb918a13c1e5ae283d8bc9556131f922e by craig.topper
[X86] Add computeKnownBits support for PEXT.

The number of zeros in the mask provides a lower bound on the number
of leading zeros in the result.
The file was modifiedllvm/test/CodeGen/X86/bmi2-x86_64.ll
The file was modifiedllvm/test/CodeGen/X86/bmi2.ll
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
Commit bc868da0e77a4f03b41654e0e9bbac28d95a5501 by dmantipov
[Driver] Filter out <libdir>/gcc and <libdir>/gcc-cross if they do not exists

Differential Revision: https://reviews.llvm.org/D87901
The file was modifiedclang/lib/Driver/ToolChains/Gnu.cpp
The file was modifiedclang/lib/Driver/ToolChains/Gnu.h
Commit 98ef7e29b0fe03da77fa6ef5c86bea9e31c178d0 by rjmccall
This reduces code duplication between CGObjCMac.cpp and Mangle.cpp
for generating the mangled name of an Objective-C method.

This has no intended functionality change.

https://reviews.llvm.org/D88329
The file was modifiedclang/lib/AST/Mangle.cpp
The file was modifiedclang/include/clang/AST/Mangle.h
The file was modifiedclang/lib/CodeGen/CGObjCMac.cpp
The file was modifiedclang/lib/AST/MicrosoftMangle.cpp
The file was modifiedclang/lib/AST/ItaniumMangle.cpp