llvm-project/llvm/test
Sanjay Patel b8ebc11f03 [EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083)
As discussed in PR41083:
https://bugs.llvm.org/show_bug.cgi?id=41083
...we can assert/crash in EarlyCSE using the current hashing scheme and
instructions with flags.

ValueTracking's matchSelectPattern() may rely on overflow (nsw, etc) or
other flags when detecting patterns such as min/max/abs composed of
compare+select. But the value numbering / hashing mechanism used by
EarlyCSE intersects those flags to allow more CSE.

Several alternatives to solve this are discussed in the bug report.
This patch avoids the issue by doing simple matching of min/max/abs
patterns that never requires instruction flags. We give up some CSE
power because of that, but that is not expected to result in much
actual performance difference because InstCombine will canonicalize
these patterns when possible. It even has this comment for abs/nabs:

  /// Canonicalize all these variants to 1 pattern.
  /// This makes CSE more likely.

(And this patch adds PhaseOrdering tests to verify that the expected
transforms are still happening in the standard optimization pipelines.

I left this code to use ValueTracking's "flavor" enum values, so we
don't have to change the callers' code. If we decide to go back to
using the ValueTracking call (by changing the hashing algorithm
instead), it should be obvious how to replace this chunk.

Differential Revision: https://reviews.llvm.org/D74285
2020-02-10 17:25:34 -05:00
..
Analysis [LoopCacheAnalysis]: Add support for negative stride 2020-02-10 13:22:35 -05:00
Assembler Add a test extracted from D69557 "AsmParser: Allow FMF on varargs call" 2020-01-29 16:46:45 +00:00
Bindings Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
Bitcode Revert "[WPD/LowerTypeTests] Delay lowering/removal of type tests until after ICP" 2020-02-05 19:27:32 -08:00
BugPoint
CodeGen Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
DebugInfo Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
Demangle
Examples
ExecutionEngine [ORC] Add support for emulated TLS to ORCv2. 2020-01-21 19:55:33 -08:00
Feature [LoopExtractor] Convert LoopExtractor from LoopPass to ModulePass 2020-02-09 12:25:21 +02:00
FileCheck Improve error message of FileCheck when stdin is empty 2020-02-04 11:14:55 +00:00
Instrumentation [Instrumentation] Set hidden visibility for the bias variable 2020-01-28 12:07:03 -08:00
Integer
JitListener
LTO [LTO] Add optimization remarks for removed functions 2020-01-29 15:53:51 -08:00
Linker Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
MC [AArch64] Make Read Write System Registers Read Only 2020-02-10 14:34:24 +00:00
MachineVerifier
Object [llvm-readobj] - Change the error to warning when a section name is unknown. 2020-02-10 16:01:30 +03:00
ObjectYAML [DWARF] Return Error from DWARFDebugArangeSet::extract(). 2020-01-23 12:41:05 +07:00
Other [VectorCombine] new IR transform pass for partial vector ops 2020-02-09 10:04:41 -05:00
Reduce Revert "[llvm-reduce] add ReduceAttribute delta pass" 2020-02-05 14:15:11 -05:00
SafepointIRVerifier
Support
SymbolRewriter
TableGen [TableGen] Fix spurious type error in bit assignment. 2020-02-07 15:11:42 +00:00
ThinLTO/X86 [ThinLTO] Disable "Always import constants" due to compile time issues 2020-01-30 10:12:48 -08:00
Transforms [EarlyCSE] avoid crashing when detecting min/max/abs patterns (PR41083) 2020-02-10 17:25:34 -05:00
Unit
Verifier Implement -fsemantic-interposition 2020-01-31 14:02:33 +01:00
YAMLParser
tools Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
.clang-format
CMakeLists.txt [CMake] Fix accidentally inverted condition 2020-02-07 15:17:25 -08:00
TestRunner.sh
lit.cfg.py Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
lit.site.cfg.py.in