Commit Graph

195340 Commits

Author SHA1 Message Date
Kang Zhang a8e15ee04a [CodeGen] Support freeze expand for ppc_fp128
Summary:
The patch D29014 has added the new ISD::FREEZE and can deal with the
integer.
The patch D76980 has added SoftenFloatRes_FREEZE for float point.
But we still lack of expand for ppc_fp128, this will cause assertion for
some cases.
This patch is to support freeze expand for ppc_fp128.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78278
2020-04-20 07:27:41 +00:00
Craig Topper 53ee8fbc23 [CallSite removal][SCCP] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78470
2020-04-20 00:16:09 -07:00
Craig Topper e13c0b650a [CallSite removal][Analysis] Use CallBase instead of CallSite in SparsePropagation unit test. NFC 2020-04-19 22:39:24 -07:00
Craig Topper 4cf6d4ab48 [CallSite removal][CalledValuePropagation] Use CallBase instead of CallSite. NFC
Differential Revision: https://reviews.llvm.org/D78467
2020-04-19 22:05:40 -07:00
David Blaikie 12489b5474 llvm-dwarfdump: Fix UB (unsequenced writes) introduced in e0fd87cc64
Unsequenced write due to "x &= f()" where 'f()' modifies 'x'.

Detected by the llvm-clang-x86_64-expensive-checks-win buildbot.
Investigated/identified by Galina - thanks!
2020-04-19 21:35:04 -07:00
Max Kazantsev 204c0bbe7f [Test] Fix test failure: platform-dependent printout 2020-04-20 10:27:50 +07:00
Xiang1 Zhang 0980038a5e Handle CET for -exception-model sjlj
Summary:
In SjLj exception mode, the old landingpad BB will create a new landingpad BB and use indirect branch jump to the old landingpad BB in lowering.
So we should add 2 endbr for this exception model.

Reviewers: hjl.tools, craig.topper, annita.zhang, LuoYuanke, pengfei, efriedma

Reviewed By: LuoYuanke

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D77124
2020-04-20 11:13:40 +08:00
Bill Wendling edcfc391e1 [Object] Use BFD name for little-endian PowerPC64
Summary:
Little-endian PowerPC object files should report "elf64-powerpcle" instead of
"elf64-powerpc".

Reviewers: jhenderson, MaskRay, espindola, alexshap, rupprecht, #powerpc

Reviewed By: MaskRay

Subscribers: wuzish, emaste, nemanjai, shchenz, steven.zhang, llvm-commits

Tags: #llvm, #powerpc

Differential Revision: https://reviews.llvm.org/D78344
2020-04-19 20:10:05 -07:00
Max Kazantsev 80cd36ed63 [Test] Add a test showing how CFG analyses are invalidated after LV
It demonstrates that, even if LV does no actual vectorization and only
forms LCSSA, CFG analyses get dropped.
2020-04-20 09:38:49 +07:00
Shengchen Kan b78c3c89c2 [X86][MC][NFC] Reduce the parameters of functions in X86MCCodeEmitter(Part III)
Summary:
When we encode an instruction, we need to know the number of bytes being
emitted to determine the fixups in `X86MCCodeEmitter::emitImmediate`.
There are only two callers for `emitImmediate`: `emitMemModRMByte` and
`encodeInstruction`.

Before this patch, we kept track of the current byte being emitted
by passing a reference parameter `CurByte` across all the `emit*`
funtions, which is ugly and unnecessary. For example, we don't have any
fixups when emitting prefixes, so we don't need to track this value.

In this patch, we use `StartByte` to record the initial status of the
streamer, and use `OS.tell()` to get the current status of the streamer
when we need to know the number of bytes being emitted. On one hand,
this eliminates the parameter `CurByte` for most `emit*` functions, on
the other hand, this make things clear: Only pass the parameter when we
really need it.

Reviewers: craig.topper, pengfei, MaskRay

Reviewed By: craig.topper, MaskRay

Subscribers: hiraditya, llvm-commits, annita.zhang

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D78419
2020-04-20 10:03:41 +08:00
Craig Topper 4ecc8fb7eb [CallSite removal][WebAssembly] Replace CallSite with CallBase in WebAssemblyOptimizeReturned.
Differential Revision: https://reviews.llvm.org/D78451
2020-04-19 18:32:52 -07:00
Craig Topper 252873879e [CallSite removal][Analysis] Replace CallSite with CallBase in MemoryBuiltins. NFC
Differential Revision: https://reviews.llvm.org/D78449
2020-04-19 18:32:48 -07:00
Craig Topper dff18c79f2 [CallSite removal][Lint] Replace visitCallSite with visitCallBase. NFC
Drop visitCallInst/visitInvokeInst since the generic implementation
will delegate to visitCallBase. They appear to be from a time
before visitCallSite existed in the InstVisitor system.

Differential Revision: https://reviews.llvm.org/D78448
2020-04-19 18:32:40 -07:00
Craig Topper d7e2d937bc [X86] Add X86ISD nodes for PDEP and PEXT.
This will allow use to add DAG combines for these instructions.
2020-04-19 16:14:13 -07:00
Craig Topper 744eaa7a3f [CallSite removal][AMDGPU] Use CallBase instead of CallSite in AMDGPUFixFunctionBitcasts. NFC 2020-04-19 15:21:02 -07:00
Simon Pilgrim a938c7b9ed X86CallLowering.h - remove unnecessary ArrayRef.h include. NFC. 2020-04-19 21:25:10 +01:00
Simon Pilgrim 69062a1cf6 SectionMemoryManager.h - remove unnecessary StringRef.h include. NFC. 2020-04-19 21:25:10 +01:00
Nikita Popov f52e050757 [LVI] Use Optional instead of out parameter (NFC)
As suggested on D76788, this switches the LVI implementation to
return Optional<ValueLatticeElement> from various methods, instead
of passing in a ValueLatticeElement reference and returning a boolean.

Differential Revision: https://reviews.llvm.org/D78383
2020-04-19 21:17:43 +02:00
Florian Hahn a7aaadc135 [TTI] Clean up includes (NFC).
Remove some unnecessary includes, replace some with forward
declarations.

This also exposed a few places that were missing some includes.
2020-04-19 20:11:59 +01:00
Florian Hahn 32af48cdcf [IVDescriptors] Clean up includes.
Some includes are not required and forward declarations can be used
instead. This also exposed a few places that were not directly including
required files.
2020-04-19 20:07:47 +01:00
Florian Hahn 7a87e8f90b [LoopUtils] Clean up includes, use forward decls if appropriate (NFC).
Most of the includes in LoopUtils.h are not required in the header and
they can be replaced by forward declarations.

Unfortunately includes of TargetTransformInfo.h and IVDescriptors.h pull
in a bunch of additional things, but there is no easy way to get rid of
them at the moment I think.
2020-04-19 19:44:29 +01:00
Simon Pilgrim 330162c5a6 DependenceGraphBuilder.h - remove unused includes. NFC.
Replace with forward declarations.
2020-04-19 17:58:17 +01:00
Simon Pilgrim 8859c7f6eb X86MachineFunctionInfo.h - remove unused include. NFC. 2020-04-19 16:58:59 +01:00
Simon Pilgrim c27fdc84df X86InstrInfo.h - remove unused forward declarations. NFC. 2020-04-19 16:58:59 +01:00
Simon Pilgrim a156646443 X86DisassemblerDecoder.h - remove unused forward declaration. NFC. 2020-04-19 16:58:58 +01:00
Fangrui Song 041a3557f0 [CMake] Delete HAVE_SCHED_GETAFFINITY and HAVE_CPU_COUNT
sched_getaffinity (Linux specific) has been available

* in glibc since 2002-08-08 (commit 972e719e8154eec5f543b027e2a08dfa285d55d5)
* in musl since the initial check-in.
2020-04-19 08:50:23 -07:00
Sanjay Patel a2eb55de99 [InstSimplify] add tests for logic+icmp folds for nullptr; NFC
See discussion in D78430.
2020-04-19 10:42:08 -04:00
Sanjay Patel 720015e537 [x86] avoid build warning for enum mismatch; NFC
gcc may warn here because X86ISD::NodeType is specified as "unsigned",
but ISD::NodeType is a naked C enum (although passed as an "unsigned"
throughout SDAG).
2020-04-19 10:22:11 -04:00
Florian Hahn e01ae15066 [LAA] Remove unnecessary includes (NFC). 2020-04-19 15:16:29 +01:00
Simon Pilgrim 60765e911d X86MCTargetDesc.h - remove unnecessary includes and forward declarations. NFC. 2020-04-19 14:29:35 +01:00
Simon Pilgrim 18bf42a86c X86.h - remove unused forward declarations. NFC. 2020-04-19 14:28:52 +01:00
Simon Pilgrim 84aab8b772 X86SelectionDAGInfo.h - remove unnecessary includes and forward declarations. NFC. 2020-04-19 14:20:53 +01:00
Simon Pilgrim 44d91cac76 X86TargetTransformInfo.h - remove unnecessary includes. NFC. 2020-04-19 14:03:43 +01:00
David Green a0b1616359 [ARM] Regenerate tests. NFC 2020-04-19 13:45:39 +01:00
Simon Pilgrim e71dd7c011 [X86][SSE] getFauxShuffle - don't combine shuffles with small truncated scalars (PR45604)
getFauxShuffle attempts to combine INSERT_VECTOR_ELT(TRUNCATE/EXTEND(EXTRACT_VECTOR_ELT(x))) patterns into a target shuffle chain.

PR45604 identified an issue where the scalar was truncated to a size smaller than the destination vector element and then zero extended back, which requires the upper bits to be zero'd which we don't currently do.

To avoid the bug I've added an early out in these truncation cases, a future commit should allow us to handle this by inserting the necessary SM_SentinelZero padding.
2020-04-19 13:35:22 +01:00
Sanjay Patel cceb630a07 [x86] use vector instructions to lower more FP->int->FP casts
This is an enhancement to D77895 to avoid another
round-trip from XMM->GPR->XMM. This time we handle
the case of starting/ending with an f64 and casting
to signed i32 as the intermediate value.

It's a bit more involved than I initially assumed
because we need to use target-specific opcodes to
represent the non-standard cast ops.

Differential Revision: https://reviews.llvm.org/D78362
2020-04-19 08:33:17 -04:00
Sanjay Patel bef6e67e95 [VectorCombine] transform bitcasted shuffle to wider elements
bitcast (shuf V, MaskC) --> shuf (bitcast V), MaskC'

This is the widen shuffle elements enhancement to D76727.
It builds on the analysis and simplifications in
D77881 and rG6a7e958a423e.

The phase ordering tests show that we can simplify inverse
shuffles across a binop in both directions (widen/narrow or
narrow/widen) now.

There's another potential transform visible in some of the
remaining TODOs - move a bitcasted operand of a shuffle
after the shuffle.

Differential Revision: https://reviews.llvm.org/D78371
2020-04-19 08:24:38 -04:00
Sanjay Patel 02b070ed49 [InstSimplify] add tests for logic-of-icmp with min/max constant; NFC
See PR45510:
https://bugs.llvm.org/show_bug.cgi?id=45510

We had partial coverage for some of these patterns, so removing duplicate tests
with the complete set in the new test file.
2020-04-19 08:24:38 -04:00
Simon Pilgrim d6db919bee [X86][SSE] Add test case for PR45604 2020-04-19 13:13:54 +01:00
Simon Pilgrim 46de0d5fe9 SelectionDAGBuilder.h - remove unused includes + forward declarations. NFC.
Replace SelectionDAG.h include with SelectionDAG forward declaration.
2020-04-19 12:38:41 +01:00
Simon Pilgrim 9559557014 X86InstrFMA3Info.h - remove unnecessary includes. NFC.
There were a number of cpp files explicitly relying on X86InstrFMA3Info.h to include the X86.h header - so I've had to add it locally.
2020-04-19 12:17:56 +01:00
Simon Pilgrim 032738d17e InstrEmitter.h - reduce SelectionDAG.h include to SelectionDAGNodes.h include.
Add SDDbgLabel/TargetLowering forward declarations.
Add the full SelectionDAG.h include to InstrEmitter.cpp.
2020-04-19 11:52:31 +01:00
Simon Pilgrim d49646e6de X86AsmPrinter.h - cleanup includes and forward declarations. NFC.
Reduce X86Subtarget.h/MCCodeEmitter.h/TargetMachine.h includes to forward declarations
Add explicit X86Subtarget.h/TargetMachine.h includes to X86AsmPrinter.cpp/X86MCInstLower.cpp
Remove unused MCSymbol forward declaration
2020-04-19 11:38:50 +01:00
Simon Pilgrim cbd790a443 DebugHandlerBase.h - reduce MachineInstr.h include to DebugLoc.h include.
We were only including MachineInstr.h for DebugLoc.h. This exposes an implicit include dependency in BTFDebug.h where I've had to add the MachineInstr.h include.
2020-04-19 11:14:01 +01:00
Simon Pilgrim 9308dffc21 BuildLibCalls.h - remove unnecessary TargetLibraryInfo forward declaration. NFC
We already have to include the TargetLibraryInfo.h header.
2020-04-19 11:14:00 +01:00
Simon Pilgrim c96ca71a9f TypeBasedAliasAnalysis.h - replace InstrTypes.h include with forward declaration. NFC. 2020-04-19 11:13:59 +01:00
Benjamin Kramer ff54d1c897 Remove remaining callers of CreateShuffleVector with unsigned indices and mark it as deprecated
No functionality change intended.
2020-04-19 11:48:28 +02:00
Simon Pilgrim 59b0e015fc OMPConstants.h - replace StringRef.h include with forward declaration. NFC. 2020-04-19 10:29:48 +01:00
Florian Hahn 6ba0695c60 [ValueLattice] Add struct for merge options.
This makes it easier to extend the merge options in the future and also
reduces the risk of accidentally setting a wrong option.

Reviewers: efriedma, nikic, reames, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D78368
2020-04-19 09:03:16 +01:00
Craig Topper 2a58271158 [CallSite removal][PtrUseVisitor] Use visitCallBase instead of visitCallSite. NFC 2020-04-18 23:15:12 -07:00