1. Nov 05, 2023
  2. Nov 04, 2023
    • Simon Pilgrim's avatar
      [DAG] Don't fold (zext (bitop (load x), cst)) -> (bitop (zextload x), (zext... · 1085b70a
      Simon Pilgrim authored
      [DAG] Don't fold (zext (bitop (load x), cst)) -> (bitop (zextload x), (zext cst)) if the zext is free
      
      Prevents an infinite loop if we've been trying to narrow the bitop to a more preferable type
      1085b70a
    • Balazs Benics's avatar
      [analyzer][NFC] Rework SVal kind representation (#71039) · bde5717d
      Balazs Benics authored
      The goal of this patch is to refine how the `SVal` base and sub-kinds
      are represented by forming one unified enum describing the possible
      SVals. This means that the `unsigned SVal::Kind` and the attached
      bit-packing semantics would be replaced by a single unified enum. This
      is more conventional and leads to a better debugging experience by
      default. This eases the need of using debug pretty-printers, or the use
      of runtime functions doing the printing for us like we do today by
      calling `Val.dump()` whenever we inspect the values.
      
      Previously, the first 2 bits of the `unsigned SVal::Kind` discriminated
      the following quartet: `UndefinedVal`, `UnknownVal`, `Loc`, or `NonLoc`.
      The rest of the upper bits represented the sub-kind, where the value
      represented the index among only the `Loc`s or `NonLoc`s, effectively
      attaching 2 meanings of the upper bits depending on the base-kind. We
      don't need to pack these bits, as we have plenty even if we would use
      just a plan-old `unsigned char`.
      
      Consequently, in this patch, I propose to lay out all the (non-abstract)
      `SVal` kinds into a single enum, along with some metadata (`BEGIN_Loc`,
      `END_Loc`, `BEGIN_NonLoc`, `END_NonLoc`) artificial enum values, similar
      how we do with the `MemRegions`.
      
      Note that in the unified `SVal::Kind` enum, to differentiate
      `nonloc::ConcreteInt` from `loc::ConcreteInt`, I had to prefix them with
      `Loc` and `NonLoc` to resolve this ambiguity.
      This should not surface in general, because I'm replacing the
      `nonloc::Kind` enum items with `inline constexpr` global constants to
      mimic the original behavior - and offer nicer spelling to these enum
      values.
      
      Some `SVal` constructors were not marked explicit, which I now mark as
      such to follow best practices, and marked others as `/*implicit*/` to
      clarify the intent.
      During refactoring, I also found at least one function not marked
      `LLVM_ATTRIBUTE_RETURNS_NONNULL`, so I did that.
      
      The `TypeRetrievingVisitor` visitor had some accidental dead code,
      namely: `VisitNonLocConcreteInt` and `VisitLocConcreteInt`.
      
      Previously, the `SValVisitor` expected visit handlers of
      `VisitNonLocXXXXX(nonloc::XXXXX)` and `VisitLocXXXXX(loc::XXXXX)`, where
      I felt that envoding `NonLoc` and `Loc` in the name is not necessary as
      the type of the parameter would select the right overload anyways, so I
      simplified the naming of those visit functions.
      
      The rest of the diff is a lot of times just formatting, because
      `getKind()` by nature, frequently appears in switches, which means that
      the whole switch gets automatically reformatted. I could probably undo
      the formatting, but I didn't want to deviate from the rule unless
      explicitly requested.
      bde5717d
    • Christian Ulmann's avatar
      [MLIR][Doc] Remove LLVM dialect typed pointer documentation (#71246) · b3eac1ac
      Christian Ulmann authored
      This commit removes all references to typed pointers. Typed pointers
      have been deprecated for a while now and they will be removed in a
      followup.
      
      Related PSA:
      https://discourse.llvm.org/t/psa-removal-of-typed-pointers-from-the-llvm-dialect/74502
      b3eac1ac
    • David Green's avatar
      [AArch64] Add fopcysign testing. NFC · 3d870434
      David Green authored
      3d870434
    • Christian Ulmann's avatar
      [MLIR][LLVM] Remove last typed pointer remnants from tests (#71232) · 7ed96b1c
      Christian Ulmann authored
      This commit removes all LLVM dialect typed pointers from the lit tests.
      Typed pointers have been deprecated for a while now and it's planned to
      soon remove them from the LLVM dialect.
      
      Related PSA:
      https://discourse.llvm.org/t/psa-removal-of-typed-pointers-from-the-llvm-dialect/74502
      7ed96b1c
    • David Green's avatar
      [AArch64][GlobalISel] Expand handling for fptosi and fptoui (#70635) · 54574d32
      David Green authored
      Now that we have more types handled for zext/sext and trunc, it is
      possible to get more types working for the vector float to integer
      conversions. This patch adds fp16, widening and narrowing vector support
      to handle more types. The smaller types wil be expanded to the size of
      the larger element type. A couple of case require more awkward truncates
      to get working as they go from illegal to illegal types.
      54574d32
    • Vlad Serebrennikov's avatar
      [clang][NFC] Refactor `ConstantExpr::ResultStorageKind` · cd602291
      Vlad Serebrennikov authored
      This patch converts `ConstantExpr::ResultStorageKind` to a scoped enum in namespace scoped `ConstantResultStorageKind`. This patch makes it possible to forward-declare this enum where it's necessery, e.g. for `preferred_type` annotation for bit-fields.
      cd602291
    • Balazs Benics's avatar
      [analyzer] Fix assertion failure in `CXXInstanceCall::getCXXThisVal` (#70837) · 51d15d13
      Balazs Benics authored
      Workaround the case when the `this` pointer is actually a `NonLoc`, by
      returning `Unknown` instead.
      The solution isn't ideal, as `this` should be really a `Loc`, but due to
      how casts work, I feel this is our easiest and best option.
      
      As this patch presents, I'm evaluating a cast to transform the `NonLoc`.
      However, given that `evalCast()` can't be cast from `NonLoc` to a
      pointer type thingy (`Loc`), we end up with `Unknown`.
      It is because `EvalCastVisitor::VisitNonLocSymbolVal()` only evaluates
      casts that happen from NonLoc to NonLocs.
      
      When I tried to actually implement that case, I figured:
      1) Create a `SymbolicRegion` from that `nonloc::SymbolVal`; but
      `SymbolRegion` ctor expects a pointer type for the symbol.
      2) Okay, just have a `SymbolCast`, getting us the pointer type; but
      `SymbolRegion` expects `SymbolData` symbols, not generic `SymExpr`s, as
      stated:
      
      > // Because pointer arithmetic is represented by ElementRegion layers,
      > // the base symbol here should not contain any arithmetic.
      
      3) We can't use `ElementRegion`s to perform this cast because to have an
      `ElementRegion`, you already have to have a `SubRegion` that you want to
      cast, but the point is that we don't have that.
      
      At this point, I gave up, and just left a FIXME instead, while still
      returning `Unknown` on that path.
      IMO this is still better than having a crash.
      
      Fixes #69922
      51d15d13
    • Vlad Serebrennikov's avatar
      [clang][NFC] Refactor `SourceLocExpr::IdentKind` · 99e7e7a5
      Vlad Serebrennikov authored
      This patch converts `SourceLocExpr::IdentKind` into a scoped enum at namespace scope, making it eligible to be forward-declared. This is needed by `preferred_type` annotations on bit-fields.
      99e7e7a5
    • Aiden Grossman's avatar
      [Github] Only run github actions on main monorepo (#69774) · 83888a54
      Aiden Grossman authored
      There are currently a couple jobs that run on all forks of LLVM too (if
      there is a PR opened, or in the case of the documentation builds, upon
      pushing to main). This isn't desired behavior. This commit disables that
      behavior, forcing the jobs to not run if they aren't running against
      llvm/llvm-project or a PR against that repo.
      83888a54
    • Aiden Grossman's avatar
      [Github] Add flang docs to Github actions (#70530) · 9189cd64
      Aiden Grossman authored
      This patch enables building the flang docs in Github actions to enable
      rapid iteration in PRs and to catch docs build failures more easily
      before merge/after merge. This patch currently doesn't fail for Sphinx
      warnings, but the intention is to enable this functionality once the
      flang docs are fixed to build without warnings after the transition to
      Myst.
      9189cd64
    • Vlad Serebrennikov's avatar
      [clang][NFC] Annotate Expr-related headers with `preferred_type` · 5b9d7932
      Vlad Serebrennikov authored
      Namely `Expr.h`, `ExprConcept.h`, `ExprCXX.h`, `ExprObjC.h`.
      5b9d7932
    • Vlad Serebrennikov's avatar
    • Vlad Serebrennikov's avatar
      [clang][NFC] Annotate DeclBase.h with `preferred_type` · 0fea0d2f
      Vlad Serebrennikov authored
      This patch adds `preferred_type` annotations to `Decl` and `DeclContext` bit-fields. Those annotations help debuggers reason about the type of the value stored in bit-field.
      0fea0d2f
    • Mehdi Amini's avatar
      [mlir] Guard NVPTX backend initialization on it being configured (NFC) · 68833438
      Mehdi Amini authored
      This is just helping with some build failure in some new configurations.
      68833438
    • Chengji Yao's avatar
      [MLIR][Mesh] Add sharding propagation pass (#71261) · b0d5b4d2
      Chengji Yao authored
      Add a pass that propagates sharding information throughout the graph.
      After this pass, each of the operations' operands and results is
      annotated with a mesh.shard operation.
      
      The pass is driven by a newly added ShardingInterface, and an implementation
      for element-wise and matmul ops in the TOSA dialect is provided.
      b0d5b4d2
    • Teresa Johnson's avatar
      [MemProf] Tolerate missing leaf debug frames (#71233) · 87f5e229
      Teresa Johnson authored
      Loosen up the matching so that a missing leaf debug frame in the profile
      does not prevent matching an allocation context if we can match further
      up the inlined call context. This relies on the pre-inliner, which was
      already the default when performing normal PGO feedback along with the
      MemProf feedback, but to ensure matching is not affected by the presence
      of PGO, enable the pre-inliner for MemProf feedback as well.
      87f5e229
    • Fangrui Song's avatar
      [ELF] Refactor --version-script tests · 5548bcda
      Fangrui Song authored
      5548bcda
    • long.chen's avatar
      00165653
    • Jonas Devlieghere's avatar
      [lldb] Move LocateExecutableSymbolFile to SymbolLocator plugin (#71266) · 19df9aa3
      Jonas Devlieghere authored
      This builds on top of the work started in c3a302d3 to convert
      LocateSymbolFile to a SymbolLocator plugin. This commit moves
      LocateExecutableSymbolFile.
      19df9aa3
    • Lu Weining's avatar
      [LoongArch] Fix ABI mismatch with g++ when handling empty unions (#71025) · 4253fdc2
      Lu Weining authored
      In g++, empty unions are not ignored like empty structs when flattening
      structs to examine whether the structs can be passed via FARs in C++.
      This patch aligns clang++ with g++.
      
      Fix https://github.com/llvm/llvm-project/issues/70890.
      4253fdc2
    • Adrian Prantl's avatar
      Attempt to fix test on Windows. · 2d460f25
      Adrian Prantl authored
      I'm assuming that because sys::path::append defaults to native path
      this fails. Since dsymutil is a Darwin tool, we can just hardcode the
      UNIX path separator.
      2d460f25
    • Jonas Devlieghere's avatar
      [lldb] Move FindSymbolFileInBundle to SymbolLocator plugin (#71247) · 9b2246d9
      Jonas Devlieghere authored
      This builds on top of the work started in c3a302d3 to convert
      LocateSymbolFile to a SymbolLocator plugin. This commit moves
      FindSymbolFileInBundle.
      9b2246d9
    • Mehdi Amini's avatar
      Revert "[MLIR][Mesh] Add sharding propagation pass (#69665)" · 466abaf1
      Mehdi Amini authored
      This reverts commit 9d9400d7.
      This reverts commit bda763ae.
      
      The buildbot is broken and tests are failing.
      466abaf1
    • Jie Fu's avatar
      [mlir] Fix -Wreturn-type in MeshOps.cpp (NFC) · bda763ae
      Jie Fu authored
      /llvm-project/mlir/lib/Dialect/Mesh/IR/MeshOps.cpp:73:1: error: non-void function does not return a value in all control paths [-Werror,-Wreturn-type]
      }
      ^
      1 error generated.
      bda763ae
    • Yeting Kuo's avatar
      [RISCV] Remove experimental- prefix for smaia and ssaia. (#71172) · af4abc4f
      Yeting Kuo authored
      Since smaia and ssaia are ratified now, we could remove their
      experimental- prefix.
      af4abc4f
    • Jie Fu's avatar
      [mlir] Fix -Wunused-variable in ROCDL/Target.cpp (NFC) · ac798eaa
      Jie Fu authored
      /llvm-project/mlir/lib/Target/LLVM/ROCDL/Target.cpp:181:40: error: unused variable 'targetMachine' [-Werror,-Wunused-variable]
        std::optional<llvm::TargetMachine *> targetMachine =
                                             ^
      1 error generated.
      ac798eaa
    • Chengji Yao's avatar
      [MLIR][Mesh] Add sharding propagation pass (#69665) · 9d9400d7
      Chengji Yao authored
      Add a pass that propagates sharding information throughout the graph.
      After this pass, each of the operations' operands and results is
      annotated with a `mesh.shard` operation, and the operations themselves
      are added with sharding option attributes.
      
      The pass is driven by  a newly added `ShardingInterface`, and an implementation
      for element-wise and matmul ops in the TOSA dialect is provided.
      9d9400d7