summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InstCombine/fcmp.ll
Commit message (Collapse)AuthorAgeFilesLines
* [NFC][InstCombine] Add unary FNeg tests to fcmp.llCameron McInally2019-05-311-0/+118
| | | | llvm-svn: 362234
* Revert "Temporarily Revert "Add basic loop fusion pass.""Eric Christopher2019-04-171-0/+463
| | | | | | | | The reversion apparently deleted the test/Transforms directory. Will be re-reverting again. llvm-svn: 358552
* Temporarily Revert "Add basic loop fusion pass."Eric Christopher2019-04-171-463/+0
| | | | | | | | As it's causing some bot failures (and per request from kbarton). This reverts commit r358543/ab70da07286e618016e78247e4a24fcb84077fda. llvm-svn: 358546
* [InstCombine] propagate FMF for fcmp+fabs foldsSanjay Patel2018-11-071-12/+12
| | | | | | | By morphing the instruction rather than deleting and creating a new one, we retain fast-math-flags and potentially other metadata (profile info?). llvm-svn: 346331
* [InstCombine] peek through fabs() when checking isnan()Sanjay Patel2018-11-071-4/+2
| | | | | | | | | That should be the end of the missing cases for this fold. See earlier patches in this series: rL346321 rL346324 llvm-svn: 346327
* [InstCombine] add tests for isnan(fabs(X)); NFCSanjay Patel2018-11-071-0/+22
| | | | llvm-svn: 346325
* [InstCombine] add folds for fcmp Pred fabs(X), 0.0Sanjay Patel2018-11-071-4/+2
| | | | | | | | Similar to rL346321, we had folds for the ordered versions of these compares already, so add the unordered siblings for completeness. llvm-svn: 346324
* [InstCombine] add tests for more fcmp+fabs preds; NFCSanjay Patel2018-11-071-0/+22
| | | | llvm-svn: 346323
* [InstCombine] add fold for fabs(X) u< 0.0Sanjay Patel2018-11-071-2/+1
| | | | | | | | | | | | | | The sibling fold for 'oge' --> 'ord' was already here, but this half was missing. The result of fabs() must be positive or nan, so asking if the result is negative or nan is the same as asking if the result is nan. This is another step towards fixing: https://bugs.llvm.org/show_bug.cgi?id=39475 llvm-svn: 346321
* [InstCombine] add test for fcmp+fabs; NFCSanjay Patel2018-11-071-0/+20
| | | | llvm-svn: 346320
* [InstCombine] add FMF to fcmp to show failure to propagate; NFCSanjay Patel2018-11-071-7/+7
| | | | llvm-svn: 346317
* [InstCombine] allow vector types for fcmp+fpext foldSanjay Patel2018-11-061-2/+1
| | | | llvm-svn: 346245
* [InstCombine] add vector test for fcmp+fpext; NFCSanjay Patel2018-11-061-8/+19
| | | | llvm-svn: 346243
* [InstCombine] propagate fast-math-flags when folding fcmp+fpext, part 2Sanjay Patel2018-11-061-1/+1
| | | | llvm-svn: 346242
* [InstCombine] propagate fast-math-flags when folding fcmp+fpextSanjay Patel2018-11-061-1/+1
| | | | llvm-svn: 346240
* [InstCombine] adjust tests to show dropping FMF; NFCSanjay Patel2018-11-061-2/+2
| | | | llvm-svn: 346239
* [InstCombine] propagate fast-math-flags when folding fcmp+fneg, part 2Sanjay Patel2018-11-061-2/+2
| | | | llvm-svn: 346238
* [InstCombine] adjust tests to show dropping FMF; NFCSanjay Patel2018-11-061-4/+4
| | | | | | Also, remove some stale FIXME comments ( rL346234 ). llvm-svn: 346236
* [InstCombine] propagate fast-math-flags when folding fcmp+fnegSanjay Patel2018-11-061-2/+2
| | | | | | | | | | This is another part of solving PR39475: https://bugs.llvm.org/show_bug.cgi?id=39475 This might be enough to fix that particular issue, but as noted with the FIXME, we're still dropping FMF on other folds around here. llvm-svn: 346234
* [InstCombine] add tests for FMF propagation failure; NFCSanjay Patel2018-11-061-0/+24
| | | | llvm-svn: 346232
* [InstCombine] canonicalize -0.0 to +0.0 in fcmpSanjay Patel2018-11-051-1/+1
| | | | | | | | | | | | | | | | | As stated in IEEE-754 and discussed in: https://bugs.llvm.org/show_bug.cgi?id=38086 ...the sign of zero does not affect any FP compare predicate. Known regressions were fixed with: rL346097 (D54001) rL346143 The transform will help reduce pattern-matching complexity to solve: https://bugs.llvm.org/show_bug.cgi?id=39475 ...as well as improve CSE and codegen (a zero constant is almost always easier to produce than 0x80..00). llvm-svn: 346147
* [InstCombine] refactor fabs+fcmp fold; NFCSanjay Patel2018-10-311-160/+60
| | | | | | | Also, remove/replace/minimize/enhance the tests for this fold. The code drops FMF, so it needs more tests and at least 1 fix. llvm-svn: 345734
* [InstCombine] Without infinites, fold (C / X) < 0.0 --> (X < 0)Sanjay Patel2018-09-271-10/+5
| | | | | | | | | | | | | | | | | | | | When C is not zero and infinites are not allowed (C / X) > 0 is a sign test. Depending on the sign of C, the predicate must be swapped. E.g.: foo(double X) { if ((-2.0 / X) <= 0) ... } => foo(double X) { if (X >= 0) ... } Patch by: @marels (Martin Elshuber) Differential Revision: https://reviews.llvm.org/D51942 llvm-svn: 343228
* [InstCombine] add tests for FP sign-bit cmp optimization with fdiv; NFCSanjay Patel2018-09-271-0/+96
| | | | | | | These are baseline tests for D51942. Patch by: @marels (Martin Elshuber) llvm-svn: 343222
* [PatternMatch] define m_FNeg using m_FSubSanjay Patel2018-04-051-5/+2
| | | | | | | | | Using cstfp_pred_ty in the definition allows us to match vectors with undef elements. This replicates the change for m_Not from D44076 / rL326823 and continues towards making all pattern matchers allow undef elements in vectors. llvm-svn: 329303
* [InstCombine] add vector and vector undef tests for FP folds; NFCSanjay Patel2018-04-051-77/+123
| | | | llvm-svn: 329294
* [InstCombine] remove duplicate test; NFCSanjay Patel2017-04-091-12/+0
| | | | | | I moved this test to 'not.ll' in r299824 but accidentally added a copy here. llvm-svn: 299828
* [InstCombine] auto-generate better checks; NFCSanjay Patel2017-04-091-72/+143
| | | | | | Also, move a test next to its sibling to eliminate a file with just one test. llvm-svn: 299824
* InstCombine: fix fold "fcmp x, undef" to account for NaNMehdi Amini2015-03-091-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | Summary: See the two test cases. ; Can fold fcmp with undef on one side by choosing NaN for the undef ; Can fold fcmp with undef on both side ; fcmp u_pred undef, undef -> true ; fcmp o_pred undef, undef -> false ; because whatever you choose for the first undef ; you can choose NaN for the other undef Reviewers: hfinkel, chandlerc, majnemer Reviewed By: majnemer Subscribers: majnemer, llvm-commits Differential Revision: http://reviews.llvm.org/D7617 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 231626
* Fix fcmp + fabs instcombines when using the intrinsicMatt Arsenault2015-01-081-0/+82
| | | | | | | This was only handling the libcall. This is another example of why only the intrinsic should ever be used when it exists. llvm-svn: 225465
* Update Transforms tests to use CHECK-LABEL for easier debugging. No ↵Stephen Lin2013-07-141-16/+16
| | | | | | | | | | | | | | | | | | | | | | functionality change. This update was done with the following bash script: find test/Transforms -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_]*\):\( *\)@$FUNC\([( ]*\)\$/;\1\2-LABEL:\3@$FUNC(/g" $TEMP done mv $TEMP $NAME fi done llvm-svn: 186268
* Enable some additional constant folding for PPCDoubleDouble.Ulrich Weigand2012-10-301-2/+1
| | | | | | This fixes Clang :: CodeGen/complex-builtints.c on PowerPC. llvm-svn: 167013
* InstCombine: Fix a crasher when encountering a function pointer.Benjamin Kramer2012-08-181-0/+8
| | | | llvm-svn: 162180
* InstCombine: Add a couple of fabs identities for comparing with 0.0.Benjamin Kramer2012-08-181-0/+82
| | | | llvm-svn: 162174
* float comparison to double 'zero' constant can just be a float 'zero.'Jim Grosbach2011-09-301-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | InstCombine was incorrectly considering the conversion of the constant zero to be unsafe. We want to transform: define float @bar(float %x) nounwind readnone optsize ssp { %conv = fpext float %x to double %cmp = fcmp olt double %conv, 0.000000e+00 %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } Into: define float @bar(float %x) nounwind readnone optsize ssp { %cmp = fcmp olt float %x, 0.000000e+00 ; <---- This %conv1 = zext i1 %cmp to i32 %conv2 = sitofp i32 %conv1 to float ret float %conv2 } rdar://10215914 llvm-svn: 140869
* InstCombine: APFloat can't perform arithmetic on PPC double doubles, don't ↵Benjamin Kramer2011-03-311-0/+9
| | | | | | | | even try. Thanks Eli! llvm-svn: 128676
* InstCombine: Fix transform to use the swapped predicate.Benjamin Kramer2011-03-311-1/+1
| | | | | | Thanks Frits! llvm-svn: 128628
* InstCombine: fold fcmp (fneg x), (fneg y) -> fcmp x, yBenjamin Kramer2011-03-311-0/+9
| | | | llvm-svn: 128627
* InstCombine: fold fcmp pred (fneg x), C -> fcmp swap(pred) x, -CBenjamin Kramer2011-03-311-0/+8
| | | | llvm-svn: 128626
* InstCombine: Shrink "fcmp (fpext x), C" to "fcmp x, C" if C can be ↵Benjamin Kramer2011-03-311-0/+23
| | | | | | | | losslessly converted to the type of x. Fixes PR9592. llvm-svn: 128625
* InstCombine: fold fcmp (fpext x), (fpext y) -> fcmp x, y.Benjamin Kramer2011-03-311-0/+11
llvm-svn: 128624
OpenPOWER on IntegriCloud