llvm-project/llvm/test
Craig Topper fb71b7d3e0 [InstCombine] Support folding a subtract with a constant LHS into a phi node
We currently only support folding a subtract into a select but not a PHI. This fixes that.

I had to fix an assumption in FoldOpIntoPhi that assumed the PHI node was always in operand 0. Now we pass it in like we do for FoldOpIntoSelect. But we still require some dancing to find the Constant when we create the BinOp or ConstantExpr. This is based code is similar to what we do for selects.

Since I touched all call sites, this also renames FoldOpIntoPhi to foldOpIntoPhi to match coding standards.

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

llvm-svn: 300363
2017-04-14 19:20:12 +00:00
..
Analysis [Analysis] Support bitreverse in -demanded-bits pass 2017-04-13 16:44:25 +00:00
Assembler Allow DataLayout to specify addrspace for allocas. 2017-04-10 22:27:50 +00:00
Bindings
Bitcode Bitcode: Do not create FNENTRYs for aliases of functions. 2017-04-06 19:39:24 +00:00
BugPoint llvm/test/BugPoint/compile-custom.ll: Use %/s for its path not to be mis-escaped. 2017-04-13 11:40:32 +00:00
CodeGen [AMDGPU] set read_only access qualifier for pointers 2017-04-14 19:11:40 +00:00
DebugInfo [llvm-pdbdump] More advanced class definition dumping. 2017-04-12 23:18:21 +00:00
Examples
ExecutionEngine
Feature [GVNHoist] Re-enable GVNHoist by default 2017-04-11 14:36:30 +00:00
FileCheck
Instrumentation [Profile] PE binary coverage bug fix 2017-04-13 23:37:12 +00:00
Integer
JitListener
LTO Object, LTO: Add target triple to irsymtab and LTO API. 2017-04-14 02:55:06 +00:00
LibDriver
Linker [Linker] Provide callback for internalization 2017-03-13 18:08:11 +00:00
MC [AMDGPU][MC] Corrected ds_write_src2_* to require one offset instead of two. 2017-04-14 12:28:07 +00:00
Object [llvm-ar] errors go on stderr and not on stdout. 2017-04-05 14:52:17 +00:00
ObjectYAML [Test commit] Cleanup some whitespace in a test file 2017-04-14 18:43:57 +00:00
Other Remove readnone from invariant.group.barrier 2017-04-12 20:45:12 +00:00
SymbolRewriter
TableGen [globalisel][tablegen] Add experimental support for OperandWithDefaultOps, PredicateOperand, and OptionalDefOperand 2017-04-12 08:23:08 +00:00
ThinLTO/X86 llvm-lto2: Move the LTO::run() action behind a subcommand. 2017-04-11 18:12:00 +00:00
Transforms [InstCombine] Support folding a subtract with a constant LHS into a phi node 2017-04-14 19:20:12 +00:00
Unit
Verifier Verifier: Check some amdgpu calling convention restrictions 2017-04-04 18:43:11 +00:00
YAMLParser
tools [llvm-pdbdump] Recursively dump class layout. 2017-04-13 21:11:00 +00:00
.clang-format
CMakeLists.txt
TestRunner.sh
lit.cfg
lit.site.cfg.in