llvm-project/llvm/test/CodeGen/Generic
Sanjay Patel 3a8ea8609b [Intrinsics] define semantics for experimental fmax/fmin vector reductions
As discussed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-April/140729.html

This is hopefully the final remaining showstopper before we can remove
the 'experimental' from the reduction intrinsics.

No behavior was specified for the FP min/max reductions, so we have a
mess of different interpretations.

There are a few potential options for the semantics of these max/min ops.
I think this is the simplest based on current behavior/implementation:
make the reductions inherit from the existing llvm.maxnum/minnum intrinsics.
These correspond to libm fmax/fmin, and those are similar to the (now
deprecated?) IEEE-754 maxNum/minNum functions (NaNs are treated as missing
data). So the default expansion creates calls to libm functions.

Another option would be to inherit from llvm.maximum/minimum (NaNs propagate),
but most targets just crash in codegen when given those nodes because no
default expansion was ever implemented AFAICT.

We could also just assume 'nnan' semantics by default (we are already
assuming 'nsz' semantics in the maxnum/minnum intrinsics), but some targets
(AArch64, PowerPC) support the more defined behavior, so it doesn't make much
sense to not allow a tighter spec. Fast-math-flags (nnan) can be used to
loosen the semantics.

(Note that D67507 was proposed to update the LangRef to acknowledge the more
recent IEEE-754 2019 standard, but that patch seems to have stalled. If we do
update based on the new standard, the reduction instructions can seamlessly
inherit from whatever updates are made to the max/min intrinsics.)

x86 sees a regression here on 'nnan' tests because we have underlying,
longstanding bugs in FMF creation/propagation. Those need to be fixed apart
from this change (for example: https://llvm.org/PR35538). The expansion
sequence before this patch may not have been correct.

Differential Revision: https://reviews.llvm.org/D87391
2020-09-12 09:10:28 -04:00
..
MIRDebugify [MachineDebugify] Insert synthetic DBG_VALUE instructions 2020-04-22 17:03:39 -07:00
MIRStripDebug Check output in test/CodeGen/Generic/MIRStripDebug/no-metadata-present.mir, NFC 2020-07-13 15:15:49 -07:00
2002-04-14-UnexpectedUnsignedType.ll
2002-04-16-StackFrameSizeAlignment.ll
2003-05-27-phifcmpd.ll
2003-05-27-useboolinotherbb.ll
2003-05-27-usefsubasbool.ll
2003-05-28-ManyArgs.ll
2003-05-30-BadFoldGEP.ll
2003-05-30-BadPreselectPhi.ll
2003-07-06-BadIntCmp.ll
2003-07-07-BadLongConst.ll
2003-07-08-BadCastToBool.ll
2003-07-29-BadConstSbyte.ll
2004-05-09-LiveVarPartialRegister.ll
2005-01-18-SetUO-InfLoop.ll
2005-04-09-GlobalInPHI.ll
2005-10-18-ZeroSizeStackObject.ll
2005-10-21-longlonggtu.ll
2005-12-01-Crash.ll
2005-12-12-ExpandSextInreg.ll
2006-01-12-BadSetCCFold.ll
2006-01-18-InvalidBranchOpcodeAssert.ll
2006-02-12-InsertLibcall.ll
2006-03-01-dagcombineinfloop.ll
2006-04-26-SetCCAnd.ll
2006-04-28-Sign-extend-bool.ll
2006-05-06-GEP-Cast-Sink-Crash.ll
2006-06-12-LowerSwitchCrash.ll
2006-06-13-ComputeMaskedBitsCrash.ll
2006-06-28-SimplifySetCCCrash.ll
2006-07-03-schedulers.ll
2006-08-30-CoalescerCrash.ll
2006-09-02-LocalAllocCrash.ll
2006-09-06-SwitchLowering.ll
2006-10-27-CondFolding.ll
2006-10-29-Crash.ll
2006-11-20-DAGCombineCrash.ll
2007-01-15-LoadSelectCycle.ll
2007-02-25-invoke.ll
2007-04-08-MultipleFrameIndices.ll
2007-04-13-SwitchLowerBadPhi.ll
2007-04-17-lsr-crash.ll
2007-04-27-InlineAsm-X-Dest.ll
2007-04-27-LargeMemObject.ll
2007-04-30-LandingPadBranchFolding.ll
2007-05-03-EHTypeInfo.ll
2007-05-15-InfiniteRecursion.ll
2007-12-17-InvokeAsm.ll
2007-12-31-UnusedSelector.ll
2008-01-25-dag-combine-mul.ll
2008-01-30-LoadCrash.ll
2008-02-04-Ctlz.ll
2008-02-04-ExtractSubvector.ll
2008-02-20-MatchingMem.ll
2008-02-25-NegateZero.ll
2008-02-26-NegatableCrash.ll
2008-08-07-PtrToInt-SmallerInt.ll
2009-03-17-LSR-APInt.ll
2009-03-29-SoftFloatVectorExtract.ll
2009-04-10-SinkCrash.ll
2009-04-28-i128-cmp-crash.ll
2009-11-16-BadKillsCrash.ll
2010-07-27-DAGCombineCrash.ll
2010-11-04-BigByval.ll
2010-ZeroSizedArg.ll
2011-01-06-BigNumberCrash.ll
2011-07-07-ScheduleDAGCrash.ll
2012-06-08-APIntCrash.ll
2013-03-20-APFloatCrash.ll
2014-02-05-OpaqueConstants.ll
APIntLoadStore.ll
APIntParam.ll
APIntSextParam.ll
APIntZextParam.ll
BasicInstrs.ll
ConstantExprLowering.ll
DbgValueAggregate.ll Migrate function attribute "no-frame-pointer-elim-non-leaf" to "frame-pointer"="non-leaf" as cleanups after D56351 2019-12-24 16:05:15 -08:00
ForceStackAlign.ll
MachineBranchProb.ll Rename ExpandISelPseudo->FinalizeISel, delay register reservation 2019-06-19 00:25:39 +00:00
PBQP.ll
add-with-overflow-24.ll
add-with-overflow-128.ll
add-with-overflow.ll
addr-label.ll
annotate.ll
asm-large-immediate.ll
assume.ll
badCallArgLRLLVM.ll
badFoldGEP.ll
badarg6.ll
bool-to-double.ll
bswap.ll
builtin-expect.ll
call-ret0.ll
call-ret42.ll
call-void.ll
call2-ret0.ll
cast-fp.ll
cfi-sections.ll Migrate function attribute "no-frame-pointer-elim" to "frame-pointer"="all" as cleanups after D56351 2019-12-24 15:57:33 -08:00
constindices.ll
crash.ll
csw-debug-assert.ll [NFC] Add missing REQUIRES clause to a test 2020-03-18 16:35:10 +03:00
dag-combine-crash.ll
dag-combine-ossfuzz-crash.ll [DAGCombiner] Fix for oss-fuzz bug 2018-04-17 07:22:34 +00:00
dbg_value.ll
div-neg-power-2.ll
donothing.ll
dwarf-md5.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
dwarf-source.ll Remove lit feature object-emission 2020-02-10 15:57:56 -06:00
edge-bundles-blockIDs.ll
empty-insertvalue.ll
empty-load-store.ll
empty-phi.ll
exception-handling.ll
expand-experimental-reductions.ll [Intrinsics] define semantics for experimental fmax/fmin vector reductions 2020-09-12 09:10:28 -04:00
externally_available.ll
fast-math-flags.ll [LLParser] Delete temp CallInst when error occurs 2020-06-16 11:41:25 +08:00
fastcall.ll
fneg-fabs.ll [IR] Add a dedicated FNeg IR Instruction 2018-11-13 18:15:47 +00:00
fp-to-int-invalid.ll
fp_to_int.ll
fpoperations.ll [FPEnv] Intrinsic llvm.roundeven 2020-05-26 19:24:58 +07:00
fpowi-promote.ll
fwdtwice.ll
global-ret0.ll
hello.ll
i128-addsub.ll
i128-arith.ll
icmp-illegal.ll
inline-asm-mem-clobber.ll
inline-asm-special-strings.ll
intrinsics.ll Implement strip.invariant.group 2018-07-02 04:49:30 +00:00
invalid-memcpy.ll
isunord.ll
lit.local.cfg [lit] Delete empty lines at the end of lit.local.cfg NFC 2019-06-17 09:51:07 +00:00
live-debug-label.ll [CodeGen] Fix bugs in LiveDebugVariables when debug labels are generated. 2019-01-18 07:17:09 +00:00
llc-start-stop-instance-errors.ll Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
llc-start-stop.ll Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
llvm-ct-intrinsics.ll
multiple-return-values-cross-block-with-invoke.ll
negintconst.ll
nested-select.ll
no-target.ll
opt-codegen-no-target-machine.ll Revert "Revert "Reland "[Support] make report_fatal_error `abort` instead of `exit`""" 2020-02-13 10:16:06 -08:00
overflow.ll
overloaded-intrinsic-name.ll [Tests] Be consistent w/definition of statepoint-example 2020-08-14 20:45:48 -07:00
pr2625.ll
pr3288.ll
pr12507.ll
pr24662.ll
pr33094.ll
print-add.ll
print-after.ll
print-arith-fp.ll
print-arith-int.ll
print-int.ll
print-mul-exp.ll [AVR] Remove unneeded XFAILs from the Generic CodeGen tests 2019-01-20 11:16:58 +00:00
print-mul.ll [AVR] Remove unneeded XFAILs from the Generic CodeGen tests 2019-01-20 11:16:58 +00:00
print-shift.ll [AVR] Remove unneeded XFAILs from the Generic CodeGen tests 2019-01-20 11:16:58 +00:00
ptr-annotate.ll
ret0.ll
ret42.ll
select-cc.ll [AVR] Remove unneeded XFAILs from the Generic CodeGen tests 2019-01-20 11:16:58 +00:00
select.ll
selection-dag-determinism.ll Fix nondeterminism introduced in r353954 2019-03-26 12:18:08 +00:00
shift-int64.ll
stacksave-restore.ll
storetrunc-fp.ll
switch-lower-feature.ll
switch-lower.ll
trap.ll
undef-phi.ll
v-split.ll
vector-casts.ll
vector-constantexpr.ll
vector-identity-shuffle.ll
vector.ll
zero-sized-array.ll