#65 Apply upstream patch for rhbz#1862012
Merged 3 years ago by sergesanspaille. Opened 3 years ago by sergesanspaille.
rpms/ sergesanspaille/llvm f32  into  f32

@@ -0,0 +1,26 @@ 

+ From bab5908df544680ada0a3cf431f55aeccfbdb321 Mon Sep 17 00:00:00 2001

+ From: serge-sans-paille <sguelton@redhat.com>

+ Date: Mon, 13 Apr 2020 13:44:15 +0200

+ Subject: [PATCH] Normalize working directory when running llvm-mc in test

+ 

+ Otherwise, depending on the lit location used to run the test, llvm-mc adds an

+ include_directories entry in the dwarf output, which breaks tests in some setup.

+ 

+ Differential Revision: https://reviews.llvm.org/D77876

+ ---

+  llvm/test/MC/MachO/gen-dwarf.s | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/llvm/test/MC/MachO/gen-dwarf.s b/llvm/test/MC/MachO/gen-dwarf.s

+ index 0813856d625..6d39d278e81 100644

+ --- a/llvm/test/MC/MachO/gen-dwarf.s

+ +++ b/llvm/test/MC/MachO/gen-dwarf.s

+ @@ -1,4 +1,4 @@

+ -// RUN: llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t

+ +// RUN: mkdir -p %t0 && cd %t0 && llvm-mc -g -triple i386-apple-darwin10 %s -filetype=obj -o %t

+  // RUN: llvm-dwarfdump -all %t | FileCheck %s

+  

+  .globl _bar

+ -- 

+ 2.25.2

+ 

0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch 0001-PowerPC-PPCBoolRetToInt-Skip-translation-if-there-is.patch
file renamed
+41 -28
@@ -1,10 +1,11 @@ 

- From cf54ca458afff1f7827bfbbc939429a00496c4f7 Mon Sep 17 00:00:00 2001

- From: Tom Stellard <tstellar@redhat.com>

- Date: Tue, 18 Aug 2020 10:54:49 -0700

- Subject: [PATCH] [PowerPC] PPCBoolRetToInt: Skip translation if there is

-  ConstantExpr

+ From cbea17568f4301582c1d5d43990f089ca6cff522 Mon Sep 17 00:00:00 2001

+ From: Kai Luo <lkail@cn.ibm.com>

+ Date: Fri, 28 Aug 2020 01:56:12 +0000

+ Subject: [PATCH] [PowerPC] PPCBoolRetToInt: Don't translate Constant's

+  operands

  

- PPCBoolRetToInt collects PHI, Argument, Call and Constant defs related to an `i1` value which later is translated to an `i32`/`i64` value. The `translate` method expects an `i1` value. However, if the `Constant` is a `ConstantExpr`, the type of the `ConstantExpr` might not be `i1`.

+ When collecting `i1` values via `findAllDefs`, ignore Constant's

+ operands, since Constant's operands might not be `i1`.

  

  Fixes https://bugs.llvm.org/show_bug.cgi?id=46923 which causes ICE

  ```
@@ -13,15 +14,28 @@ 

  

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

  ---

-  llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp |  8 ++++--

-  llvm/test/CodeGen/PowerPC/pr46923.ll        | 31 +++++++++++++++++++++

-  2 files changed, 37 insertions(+), 2 deletions(-)

+  llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp | 15 ++++++-----

+  llvm/test/CodeGen/PowerPC/pr46923.ll        | 29 +++++++++++++++++++++

+  2 files changed, 38 insertions(+), 6 deletions(-)

   create mode 100644 llvm/test/CodeGen/PowerPC/pr46923.ll

  

  diff --git a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

- index 2259a29f838..cfe3b3ce2e9 100644

+ index acc8b317a22..172f1346c50 100644

  --- a/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

  +++ b/llvm/lib/Target/PowerPC/PPCBoolRetToInt.cpp

+ @@ -78,9 +78,9 @@ class PPCBoolRetToInt : public FunctionPass {

+        Value *Curr = WorkList.back();

+        WorkList.pop_back();

+        auto *CurrUser = dyn_cast<User>(Curr);

+ -      // Operands of CallInst are skipped because they may not be Bool type,

+ -      // and their positions are defined by ABI.

+ -      if (CurrUser && !isa<CallInst>(Curr))

+ +      // Operands of CallInst/Constant are skipped because they may not be Bool

+ +      // type. For CallInst, their positions are defined by ABI.

+ +      if (CurrUser && !isa<CallInst>(Curr) && !isa<Constant>(Curr))

+          for (auto &Op : CurrUser->operands())

+            if (Defs.insert(Op).second)

+              WorkList.push_back(Op);

  @@ -90,6 +90,9 @@ class PPCBoolRetToInt : public FunctionPass {

   

     // Translate a i1 value to an equivalent i32/i64 value:
@@ -32,24 +46,25 @@ 

       Type *IntTy = ST->isPPC64() ? Type::getInt64Ty(V->getContext())

                                   : Type::getInt32Ty(V->getContext());

   

- @@ -227,8 +230,9 @@ class PPCBoolRetToInt : public FunctionPass {

-      // CallInst. Potentially, bitwise operations (AND, OR, XOR, NOT) and sign

-      // extension could also be handled in the future.

-      for (Value *V : Defs)

- -      if (!isa<PHINode>(V) && !isa<Constant>(V) &&

- -          !isa<Argument>(V) && !isa<CallInst>(V))

- +      if ((!isa<PHINode>(V) && !isa<Constant>(V) && !isa<Argument>(V) &&

- +           !isa<CallInst>(V)) ||

- +          isa<ConstantExpr>(V))

-          return false;

-  

-      for (Value *V : Defs)

+ @@ -252,9 +255,9 @@ class PPCBoolRetToInt : public FunctionPass {

+        auto *First = dyn_cast<User>(Pair.first);

+        auto *Second = dyn_cast<User>(Pair.second);

+        assert((!First || Second) && "translated from user to non-user!?");

+ -      // Operands of CallInst are skipped because they may not be Bool type,

+ -      // and their positions are defined by ABI.

+ -      if (First && !isa<CallInst>(First))

+ +      // Operands of CallInst/Constant are skipped because they may not be Bool

+ +      // type. For CallInst, their positions are defined by ABI.

+ +      if (First && !isa<CallInst>(First) && !isa<Constant>(First))

+          for (unsigned i = 0; i < First->getNumOperands(); ++i)

+            Second->setOperand(i, BoolToIntMap[First->getOperand(i)]);

+      }

  diff --git a/llvm/test/CodeGen/PowerPC/pr46923.ll b/llvm/test/CodeGen/PowerPC/pr46923.ll

  new file mode 100644

- index 00000000000..d6f65508848

+ index 00000000000..3e9faa60422

  --- /dev/null

  +++ b/llvm/test/CodeGen/PowerPC/pr46923.ll

- @@ -0,0 +1,31 @@

+ @@ -0,0 +1,29 @@

  +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py

  +; RUN: llc -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \

  +; RUN:   -ppc-asm-full-reg-names < %s | FileCheck %s
@@ -59,10 +74,8 @@ 

  +define i1 @foo() {

  +; CHECK-LABEL: foo:

  +; CHECK:       # %bb.0: # %entry

- +; CHECK-NEXT:    crxor 4*cr5+lt, 4*cr5+lt, 4*cr5+lt

  +; CHECK-NEXT:    li r3, 0

- +; CHECK-NEXT:    li r4, 1

- +; CHECK-NEXT:    isel r3, r4, r3, 4*cr5+lt

+ +; CHECK-NEXT:    isel r3, 0, r3, 4*cr5+lt

  +; CHECK-NEXT:    blr

  +entry:

  +  br label %next
@@ -82,5 +95,5 @@ 

  +  ret i1 %a

  +}

  -- 

- 2.18.1

+ 2.25.2

  

file modified
+1
@@ -1,5 +1,6 @@ 

  

  config.llvm_tools_dir = '/usr/bin'

+ config.llvm_src_root = '/usr/share/llvm/src'

  config.llvm_shlib_dir = '%(llvm_shlib_dir)s' % lit_config.params

  

  if hasattr(config, 'host_triple'):

file modified
+22 -5
@@ -11,7 +11,7 @@ 

  %global llvm_libdir %{_libdir}/%{name}

  %global build_llvm_libdir %{buildroot}%{llvm_libdir}

  #%%global rc_ver 6

- %global baserelease 2

+ %global baserelease 3

  %global llvm_srcdir llvm-%{version}%{?rc_ver:rc%{rc_ver}}.src

  %global maj_ver 10

  %global min_ver 0
@@ -63,7 +63,9 @@ 

  

  # https://reviews.llvm.org/D85007

  # https://bugzilla.redhat.com/show_bug.cgi?id=1862012

- Patch2: 0001-PowerPC-PPCBoolRetToInt-Skip-translation-if-there-is.patch

+ Patch2: 0001-PowerPC-PPCBoolRetToInt-Don-t-translate-Constant-s-o.patch

+ 

+ Patch4:		0001-Normalize-working-directory-when-running-llvm-mc-in-.patch

  

  BuildRequires:	gcc

  BuildRequires:	gcc-c++
@@ -296,10 +298,21 @@ 

  install -d %{install_srcdir}/utils/

  cp -R utils/unittest %{install_srcdir}/utils/

  

- # Generate lit config files.  Strip off the last line that initiates the

+ # Clang needs these for running lit tests.

+ for f in utils/*.py; do

+ 	sed '1 s|^.*$|#!/usr/bin/env python3|' $f > %{install_srcdir}/$f

+ done

+ cp -R utils/UpdateTestChecks %{install_srcdir}/utils/

+ 

+ 

+ # One of the lit tests references this file

+ install -d %{install_srcdir}/docs/CommandGuide/

+ install -m 0644 docs/CommandGuide/dsymutil.rst %{install_srcdir}/docs/CommandGuide/

+ 

+ # Generate lit config files.  Strip off the last lines that initiates the

  # test run, so we can customize the configuration.

- head -n -1 _build/test/lit.site.cfg.py >> %{lit_cfg}

- head -n -1 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}

+ head -n -2 _build/test/lit.site.cfg.py >> %{lit_cfg}

+ head -n -2 _build/test/Unit/lit.site.cfg.py >> %{lit_unit_cfg}

  

  # Install custom fedora config file

  cp %{SOURCE2} %{buildroot}%{lit_fedora_cfg}
@@ -472,6 +485,7 @@ 

  %{_datadir}/llvm/src/unittests

  %{_datadir}/llvm/src/test.tar.gz

  %{_datadir}/llvm/lit.fedora.cfg.py

+ %{_datadir}/llvm/src/docs/CommandGuide/dsymutil.rst

  %{_bindir}/not

  %{_bindir}/count

  %{_bindir}/yaml-bench
@@ -489,6 +503,9 @@ 

  %endif

  

  %changelog

+ * Fri Sep 04 2020 sguelton@redhat.com - 10.0.1-3

+ - Apply upstream patch for rhbz#1862012

+ 

  * Tue Aug 18 2020 Tom Stellard <tstellar@redhat.com> - 10.0.1-2

  - Fix rust crash on ppc64le compiling firefox

  - rhbz#1862012

file modified
+1
@@ -48,6 +48,7 @@ 

  

  cd $(mktemp -d)

  ln -s /usr/include include

+ ln -s /usr/share/llvm/src/docs docs

  tar -xzf /usr/share/llvm/src/test.tar.gz

  ln -s $ARCH.site.cfg.py test/lit.site.cfg.py

  ln -s $ARCH.site.cfg.py test/Unit/lit.site.cfg.py

@@ -0,0 +1,5 @@ 

+ #!/bin/bash

+ 

+ set -ex

+ 

+ test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000

@@ -0,0 +1,16 @@ 

+ #!/bin/bash

+ 

+ set -ex

+ 

+ cmd='/usr/libexec/tests/llvm/run-lit-tests --threads 1'

+ if [ `id -u` -eq 0 ]; then

+   # lit tests can't be run as root, so we need to run as a different user

+   user='llvm-regression-tests'

+   if ! id -u $user; then

+     useradd $user

+   fi

+   su $user -c "$cmd"

+   cmd="su $user -c $cmd"

+ else

+   exec $cmd

+ fi

file modified
+2 -6
@@ -8,9 +8,7 @@ 

        - rust

        - cargo

      tests:

-       - regression-tests:

-           dir: ./

-           run: /usr/libexec/tests/llvm/run-lit-tests --threads 1

+       - regression-tests

        - rust-sanity:

            dir: ./

            run: cargo new hello && cd hello && cargo run
@@ -20,9 +18,7 @@ 

        # which breaks the nightly compose.  So this test checks that libLLVM.so

        # is less than 100MB to ensure it was successfully stripped.

        # https://bugzilla.redhat.com/show_bug.cgi?id=1793250

-       - libllvm-size:

-         dir: ./

-         run: test `stat -L -c %s /usr/lib64/libLLVM.so` -lt 100000000

+       - libllvm-size

        # This test ensures that the spec file still builds correctly with

        # %global compat_build 1

        # FIXME: This fails, because the CI system has a hard-coded timeout of 4

no initial comment

rebased onto ece9ab2

3 years ago

rebased onto 96b0536

3 years ago

1 new commit added

  • WIP
3 years ago

3 new commits added

  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

3 new commits added

  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

1 new commit added

  • WIP
3 years ago

1 new commit added

  • WIP
3 years ago

3 new commits added

  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

3 new commits added

  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

3 new commits added

  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

1 new commit added

  • WIP
3 years ago

1 new commit added

  • WIP
3 years ago

5 new commits added

  • WIP
  • WIP
  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

5 new commits added

  • WIP
  • WIP
  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

5 new commits added

  • WIP
  • WIP
  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

5 new commits added

  • WIP
  • WIP
  • WIP
  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

1 new commit added

  • WIP
3 years ago

1 new commit added

  • WIP
3 years ago

2 new commits added

  • Fix test setup
  • Apply upstream patch for rhbz#1862012
3 years ago

2 new commits added

  • Fix broken CI
  • Apply upstream patch for rhbz#1862012
3 years ago

2 new commits added

  • Fix broken CI
  • Apply upstream patch for rhbz#1862012
3 years ago

2 new commits added

  • Fix broken CI
  • Apply upstream patch for rhbz#1862012
3 years ago

Pull-Request has been merged by sergesanspaille

3 years ago