Skip to content

Commit

Permalink
[SOL] Revert 'Emit table lookup from TargetLowering::expandCTTZ()'
Browse files Browse the repository at this point in the history
This change rust-lang@ab4fc87
breaks compilation of compiler-rt library for BPF and SBF targets.
For now disabling it.
  • Loading branch information
dmakarov committed Oct 18, 2023
1 parent a53bae0 commit 038d472
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 6 deletions.
6 changes: 0 additions & 6 deletions llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8512,12 +8512,6 @@ SDValue TargetLowering::expandCTTZ(SDNode *Node, SelectionDAG &DAG) const {
!isOperationLegalOrCustomOrPromote(ISD::XOR, VT)))
return SDValue();

// Emit Table Lookup if ISD::CTLZ and ISD::CTPOP are not legal.
if (!VT.isVector() && isOperationExpand(ISD::CTPOP, VT) &&
!isOperationLegal(ISD::CTLZ, VT))
if (SDValue V = CTTZTableLookup(Node, DAG, dl, VT, Op, NumBitsPerElt))
return V;

// for now, we use: { return popcount(~x & (x - 1)); }
// unless the target has ctlz but not ctpop, in which case we use:
// { return 32 - nlz(~x & (x-1)); }
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/ARM/cttz.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -mtriple arm-eabi -mattr=+v6t2 | FileCheck %s
; RUN: llc < %s -mtriple arm-eabi -mattr=+v6t2 -mattr=+neon | FileCheck %s
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/RISCV/ctlz-cttz-ctpop.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=RV32_NOZBB,RV32I
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/RISCV/rv32zbb.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefixes=CHECK,RV32I
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/RISCV/rv64zbb.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=RV64I
Expand Down
1 change: 1 addition & 0 deletions llvm/test/CodeGen/SPARC/cttz.ll
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
; XFAIL: *
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
; RUN: llc < %s -march=sparc -mcpu=v9 | FileCheck %s

Expand Down

0 comments on commit 038d472

Please sign in to comment.