llvm-project/llvm/lib
Sanjay Patel f740129198 [MIPS] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz()
MIPS32 has instructions for efficient count-leading/trailing-zeros, so this should be
considered a cheap operation (and therefore fair game for speculation) for any MIPS32
implementation.

The net result of allowing this speculation for the regression tests in this patch is
that we get this code:

ctlz:
  jr  $ra
  clz  $2, $4

cttz:
  addiu  $1, $4, -1
  not  $2, $4
  and  $1, $2, $1
  clz  $1, $1
  addiu  $2, $zero, 32
  jr  $ra
  subu  $2, $2, $1

Instead of:

ctlz:
  beqz  $4, $BB0_2
  addiu  $2, $zero, 32
  clz  $2, $4
$BB0_2:
  jr  $ra
  nop

cttz:
  beqz  $4, $BB1_2
  addiu  $2, $zero, 32
  addiu  $1, $4, -1
  not  $2, $4
  and  $1, $2, $1
  clz  $1, $1
  addiu  $2, $zero, 32
  subu  $2, $2, $1
$BB1_2:
  jr  $ra
  nop

See D14469 for the larger motivation.

Differential Revision: http://reviews.llvm.org/D14500

llvm-svn: 252755
2015-11-11 17:24:56 +00:00
..
Analysis [ValueTracking] Remove untested / unreachable code, NFC 2015-11-11 00:16:41 +00:00
AsmParser Add 'notail' marker for call instructions. 2015-11-06 23:55:38 +00:00
Bitcode [OperandBundles] Identify operand bundles with both their names and IDs 2015-11-10 20:13:15 +00:00
CodeGen MachineInstr: addRegisterDefReadUndef() => setRegisterDefReadUndef() 2015-11-11 00:41:58 +00:00
DebugInfo [LLVMSymbolize] Reduce indentation by using helper function. NFC. 2015-11-04 00:30:26 +00:00
ExecutionEngine [RuntimeDyld] Add support for R_X86_64_PC8 relocation. 2015-11-08 19:34:17 +00:00
Fuzzer [libFuzzer] add UninstrumentedTest.cpp (missing from a previous commit) 2015-11-10 22:02:56 +00:00
IR [IR] Make {Call,Invoke}::cloneImpl aware of operand bundles 2015-11-10 20:13:21 +00:00
IRReader Return a unique_ptr from getLazyBitcodeModule and parseBitcodeFile. NFC. 2015-06-16 22:27:55 +00:00
LTO Add a method to the BitcodeReader to parse only the identification block 2015-11-09 02:46:41 +00:00
LibDriver [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
LineEditor
Linker Ensure ModuleLinker materializes complete comdat groups 2015-11-10 21:09:06 +00:00
MC [MC] Use LShr for constant evaluation of ">>" on non-arm64 darwin. 2015-11-11 00:51:36 +00:00
Object Fix llvm-nm(1) printing of llvm-bitcode files for -format darwin to match darwin’s nm(1). 2015-11-10 00:31:08 +00:00
Option [Option] Use an ArrayRef to store the Option Infos in OptTable. NFC 2015-10-21 16:30:42 +00:00
Passes [PM] Port StripDeadPrototypes to the new pass manager 2015-10-30 23:28:12 +00:00
ProfileData Silencing a signed vs unsigned type mismatch warning. 2015-11-11 14:57:28 +00:00
Support Combine ifdefs around dl_iterate_phdr in Unix/Signals.inc 2015-11-09 23:10:29 +00:00
TableGen [TblGen] ArrayRefize TGParser. No functional change intended. 2015-10-24 12:46:45 +00:00
Target [MIPS] add overrides for isCheapToSpeculateCttz() and isCheapToSpeculateCtlz() 2015-11-11 17:24:56 +00:00
Transforms [SLP] Enable -slp-vectorize-hor by default. 2015-11-11 15:03:46 +00:00
CMakeLists.txt LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00
LLVMBuild.txt Wrap some long lines in LLVMBuild files. NFC 2015-06-12 18:44:57 +00:00
Makefile LibDriver, llvm-lib: introduce. 2015-06-09 21:50:22 +00:00