[all-commits] [llvm/llvm-project] 71eb80: [WebAssembly] Add avgr_u intrinsics and require nu...

Thomas Lively via All-commits all-commits at lists.llvm.org
Wed Dec 18 15:36:43 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 71eb8023d85e5201d32ea24194ec5bc07db23527
      https://github.com/llvm/llvm-project/commit/71eb8023d85e5201d32ea24194ec5bc07db23527
  Author: Thomas Lively <tlively at google.com>
  Date:   2019-12-18 (Wed, 18 Dec 2019)

  Changed paths:
    M clang/include/clang/Basic/BuiltinsWebAssembly.def
    M clang/lib/CodeGen/CGBuiltin.cpp
    M clang/test/CodeGen/builtins-wasm.c
    M llvm/include/llvm/IR/IntrinsicsWebAssembly.td
    M llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
    M llvm/test/CodeGen/WebAssembly/simd-arith.ll
    M llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll

  Log Message:
  -----------
  [WebAssembly] Add avgr_u intrinsics and require nuw in patterns

Summary:
The vector pattern `(a + b + 1) / 2` was previously selected to an
avgr_u instruction regardless of nuw flags, but this is incorrect in
the case where either addition may have an unsigned wrap. This CL
changes the existing pattern to require both adds to have nuw flags
and adds builtin functions and intrinsics for the avgr_u instructions
because the corrected pattern is not representable in C.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71648




More information about the All-commits mailing list