aboutsummaryrefslogtreecommitdiff
path: root/llvm/unittests/Analysis/ValueTrackingTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-04-14Remove every uses of getGlobalContext() in LLVM (but the C API)Mehdi Amini1-1/+2
At the same time, fixes InstructionsTest::CastInst unittest: yes you can leave the IR in an invalid state and exit when you don't destroy the context (like the global one), no longer now. This is the first part of http://reviews.llvm.org/D19094 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 266379
2015-09-02[ValueTracking] Minor comment change in testJames Molloy1-2/+1
This test was updated in r246678 - fix a copypasta in a comment noticed post-commit. llvm-svn: 246679
2015-09-02[ValueTracking] Look through casts when both operands are casts.James Molloy1-0/+42
We only looked through casts when one operand was a constant. We can also look through casts when both operands are non-constant, but both are in fact the same cast type. For example: %1 = icmp ult i8 %a, %b %2 = zext i8 %a to i32 %3 = zext i8 %b to i32 %4 = select i1 %1, i32 %2, i32 %3 llvm-svn: 246678
2015-08-11Add support for floating-point minnum and maxnumJames Molloy1-0/+148
The select pattern recognition in ValueTracking (as used by InstCombine and SelectionDAGBuilder) only knew about integer patterns. This teaches it about minimum and maximum operations. matchSelectPattern() has been extended to return a struct containing the existing Flavor and a new enum defining the pattern's behavior when given one NaN operand. C minnum() is defined to return the non-NaN operand in this case, but the idiomatic C "a < b ? a : b" would return the NaN operand. ARM and AArch64 at least have different instructions for these different cases. llvm-svn: 244580