350 Commits

Author SHA1 Message Date
Marcello Maggioni
95a064c8ac Move LiveRangeCalc header to publicily available position. NFC
Differential Revision: https://reviews.llvm.org/D69078

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@375075 91177308-0d34-0410-b5e6-96231b3b80d8
2019-10-17 03:12:51 +00:00
Amara Emerson
4818f426ab Add an operand to memory intrinsics to denote the "tail" marker.
We need to propagate this information from the IR in order to be able to safely
do tail call optimizations on the intrinsics during legalization. Assuming
it's safe to do tail call opt without checking for the marker isn't safe because
the mem libcall may use allocas from the caller.

This adds an extra immediate operand to the end of the intrinsics and fixes the
legalizer to handle it.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@373140 91177308-0d34-0410-b5e6-96231b3b80d8
2019-09-28 05:33:21 +00:00
Amara Emerson
9a368b2132 [GlobalISel] Introduce a G_DYN_STACKALLOC opcode to represent dynamic allocas.
This just adds the opcode and verifier, it will be used to replace existing
dynamic alloca handling in a subsequent patch.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369833 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-24 02:25:56 +00:00
Daniel Sanders
57a8129407 Apply llvm-prefer-register-over-unsigned from clang-tidy to LLVM
Summary:
This clang-tidy check is looking for unsigned integer variables whose initializer
starts with an implicit cast from llvm::Register and changes the type of the
variable to llvm::Register (dropping the llvm:: where possible).

Partial reverts in:
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
X86FixupLEAs.cpp - Some functions return unsigned and arguably should be MCRegister
X86FrameLowering.cpp - Some functions return unsigned and arguably should be MCRegister
HexagonBitSimplify.cpp - Function takes BitTracker::RegisterRef which appears to be unsigned&
MachineVerifier.cpp - Ambiguous operator==() given MCRegister and const Register
PPCFastISel.cpp - No Register::operator-=()
PeepholeOptimizer.cpp - TargetInstrInfo::optimizeLoadInstr() takes an unsigned&
MachineTraceMetrics.cpp - MachineTraceMetrics lacks a suitable constructor

Manual fixups in:
ARMFastISel.cpp - ARMEmitLoad() now takes a Register& instead of unsigned&
HexagonSplitDouble.cpp - Ternary operator was ambiguous between unsigned/Register
HexagonConstExtenders.cpp - Has a local class named Register, used llvm::Register instead of Register.
PPCFastISel.cpp - PPCEmitLoad() now takes a Register& instead of unsigned&

Depends on D65919

Reviewers: arsenm, bogner, craig.topper, RKSimon

Reviewed By: arsenm

Subscribers: RKSimon, craig.topper, lenary, aemerson, wuzish, jholewinski, MatzeB, qcolombet, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, wdng, nhaehnle, sbc100, jgravelle-google, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, javed.absar, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, MaskRay, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, tpr, PkmX, jocewei, jsji, Petar.Avramovic, asbirlea, Jim, s.egerton, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369041 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-15 19:22:08 +00:00
Matt Arsenault
ddb638f48f GlobalISel: Add more verifier checks for G_SHUFFLE_VECTOR
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368705 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 15:52:21 +00:00
Matt Arsenault
1dcdc32963 GlobalISel: Change representation of shuffle masks
Currently shufflemasks get emitted as any other constant, and you end
up with a bunch of virtual registers of G_CONSTANT with a
G_BUILD_VECTOR. The AArch64 selector then asserts on anything that
doesn't fit this pattern. This isn't an ideal representation, and
should avoid legalization and have fewer opportunities for a
representational error.

Rather than invent a new shuffle mask operand type, similar to what
ShuffleVectorSDNode does, just track the original IR Constant mask
operand. I don't completely like the idea of adding another link to
the IR, but MIR is already quite dependent on IR constants already,
and this will allow sharing the shuffle mask utility functions with
the IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368704 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-13 15:34:38 +00:00
Daniel Sanders
2d2b63fa73 [globalisel] Add G_SEXT_INREG
Summary:
Targets often have instructions that can sign-extend certain cases faster
than the equivalent shift-left/arithmetic-shift-right. Such cases can be
identified by matching a shift-left/shift-right pair but there are some
issues with this in the context of combines. For example, suppose you can
sign-extend 8-bit up to 32-bit with a target extend instruction.
  %1:_(s32) = G_SHL %0:_(s32), i32 24 # (I've inlined the G_CONSTANT for brevity)
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
would reasonably combine to:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 25
which no longer matches the special case. If your shifts and extend are
equal cost, this would break even as a pair of shifts but if your shift is
more expensive than the extend then it's cheaper as:
  %2:_(s32) = G_SEXT_INREG %0:_(s32), i32 8
  %3:_(s32) = G_ASHR %2:_(s32), i32 1
It's possible to match the shift-pair in ISel and emit an extend and ashr.
However, this is far from the only way to break this shift pair and make
it hard to match the extends. Another example is that with the right
known-zeros, this:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 24
  %3:_(s32) = G_MUL %2:_(s32), i32 2
can become:
  %1:_(s32) = G_SHL %0:_(s32), i32 24
  %2:_(s32) = G_ASHR %1:_(s32), i32 23

All upstream targets have been configured to lower it to the current
G_SHL,G_ASHR pair but will likely want to make it legal in some cases to
handle their faster cases.

To follow-up: Provide a way to legalize based on the constant. At the
moment, I'm thinking that the best way to achieve this is to provide the
MI in LegalityQuery but that opens the door to breaking core principles
of the legalizer (legality is not context sensitive). That said, it's
worth noting that looking at other instructions and acting on that
information doesn't violate this principle in itself. It's only a
violation if, at the end of legalization, a pass that checks legality
without being able to see the context would say an instruction might not be
legal. That's a fairly subtle distinction so to give a concrete example,
saying %2 in:
  %1 = G_CONSTANT 16
  %2 = G_SEXT_INREG %0, %1
is legal is in violation of that principle if the legality of %2 depends
on %1 being constant and/or being 16. However, legalizing to either:
  %2 = G_SEXT_INREG %0, 16
or:
  %1 = G_CONSTANT 16
  %2:_(s32) = G_SHL %0, %1
  %3:_(s32) = G_ASHR %2, %1
depending on whether %1 is constant and 16 does not violate that principle
since both outputs are genuinely legal.

Reviewers: bogner, aditya_nandakumar, volkan, aemerson, paquette, arsenm

Subscribers: sdardis, jvesely, wdng, nhaehnle, rovka, kristof.beyls, javed.absar, hiraditya, jrtc27, atanasyan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368487 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-09 21:11:20 +00:00
Daniel Sanders
c7a3c5c5d1 Finish moving TargetRegisterInfo::isVirtualRegister() and friends to llvm::Register as started by r367614. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367633 91177308-0d34-0410-b5e6-96231b3b80d8
2019-08-01 23:27:28 +00:00
Djordje Todorovic
7936dfdc22 Reland "[LiveDebugValues] Emit the debug entry values"
Emit replacements for clobbered parameters location if the parameter
has unmodified value throughout the funciton. This is basic scenario
where we can use the debug entry values.

([12/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@365444 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-09 08:36:34 +00:00
Matt Arsenault
860def304b GlobalISel: Verify G_MERGE_VALUES operand sizes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364822 91177308-0d34-0410-b5e6-96231b3b80d8
2019-07-01 18:01:35 +00:00
Djordje Todorovic
3aa859711c [MachineFunction] Base support for call site info tracking
Add an attribute into the MachineFunction that tracks call site info.

([8/13] Introduce the debug entry values.)

Co-authored-by: Ananth Sowda <asowda@cisco.com>
Co-authored-by: Nikola Prica <nikola.prica@rt-rk.com>
Co-authored-by: Ivan Baev <ibaev@cisco.com>

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@364506 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-27 07:48:06 +00:00
Matt Arsenault
5b56cc85b0 Rename ExpandISelPseudo->FinalizeISel, delay register reservation
This allows targets to make more decisions about reserved registers
after isel. For example, now it should be certain there are calls or
stack objects in the frame or not, which could have been introduced by
legalization.

Patch by Matthias Braun

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363757 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-19 00:25:39 +00:00
Matt Arsenault
6f81a49f5c GlobalISel: Verify intrinsics
I keep using the wrong instruction when manually writing tests. This
really needs to check the number of operands, but I don't see an easy
way to do that right now.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363579 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-17 17:01:32 +00:00
Amara Emerson
3cc39d23bb [GlobalISel] Add a G_BRJT opcode.
This is a branch opcode that takes a jump table pointer, jump table index and an
index into the table to do an indirect branch.

We pass both the table pointer and JTI to allow targets like ARM64 to more
easily use the existing jump table compression optimization without having to
walk up the block to find a paired G_JUMP_TABLE.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363434 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-14 17:55:48 +00:00
Amara Emerson
dae5d38e98 [GlobalISel] Add a G_JUMP_TABLE opcode.
This opcode generates a pointer to the address of the jump table
specified by the source operand, which is a jump table index.

It will be used in conjunction with an upcoming G_BRJT opcode to support
jump table codegen with GlobalISel.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@363096 91177308-0d34-0410-b5e6-96231b3b80d8
2019-06-11 19:58:06 +00:00
Amara Emerson
aee02187cb Add a getSizeInBits() accessor to MachineMemOperand. NFC.
Cleans up a bunch of places where we do getSize() * 8.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@358617 91177308-0d34-0410-b5e6-96231b3b80d8
2019-04-17 22:21:05 +00:00
Matt Arsenault
00d0757296 GlobalISel: Verify g_insert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354342 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-19 16:10:16 +00:00
Matt Arsenault
c86376b897 GlobalISel: Fix inadequate verification of g_build_vector
Testing based on the total size of the elements failed to catch a few
invalid scenarios, so explicitly check the number of elements/operands
and types.

This failed to catch situations like
<4 x s16> = G_BUILD_VECTOR s32, s32 since the total size added
up. This also would fail to catch an implicit conversion between
pointers and scalars.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@354139 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-15 15:24:34 +00:00
Matt Arsenault
45f5ca3e2d GlobalISel: Verify G_EXTRACT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353759 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-11 22:12:43 +00:00
Matt Arsenault
5677af7c59 GlobalISel: Verify G_GEP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353209 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 20:04:12 +00:00
Matt Arsenault
05338a60a7 GlobalISel: Fix verifier crashing on non-register operands
Also correct the wording of error on subregisters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353128 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-05 00:53:22 +00:00
Matt Arsenault
7c4ac52d75 GlobalISel: Enforce operand types for constants
A number of of tests were using imm operands, not cimm. Since CSE
relies on the exact ConstantInt* pointer used, and implicit
conversions are generally evil, also enforce the bitsize of the types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353113 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 23:29:31 +00:00
Matt Arsenault
3bcad46609 GlobalISel: Verify g_select
Factor the common vector element consistency check many instructions
need out, although this makes the error messages worse.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353112 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 23:29:16 +00:00
Matt Arsenault
be7b21ece2 MachineVerifier: Move verification of G_* instructions to function
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@353111 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-04 23:29:11 +00:00
Matt Arsenault
cb7fe9bbb3 GlobalISel: Verify memory size for load/store
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352578 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30 01:10:42 +00:00
Matt Arsenault
79e1cb59f5 GlobalISel: Verify pointer casts
Not sure if the old AArch64 tests should be just
deleted or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352562 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29 23:29:00 +00:00
Matt Arsenault
50de4990f0 GlobalISel: Verify load/store has a pointer input
I expected this to be automatically verified, but it seems
nothing uses that the type index was declared as a "ptype"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352319 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-27 15:57:23 +00:00
Amara Emerson
171d728596 Re-apply "r351584: "GlobalISel: Verify g_zextload and g_sextload""
I reverted it originally due to a bot failing. The underlying bug has been fixed
as of r352311.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@352312 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-27 11:34:41 +00:00
Matt Arsenault
730b10c319 GlobalISel: Disallow vectors for G_CONSTANT/G_FCONSTANT
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351853 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22 18:53:41 +00:00
Matt Arsenault
b771a49ffa GlobalISel: Fix out of bounds crashes in verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351769 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22 00:29:37 +00:00
Chandler Carruth
6b547686c5 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 08:50:56 +00:00
Amara Emerson
b3cf54ea95 Revert r351584: "GlobalISel: Verify g_zextload and g_sextload"
This new assertion triggered on the AArch64 GlobalISel bots. Reverting while it's being investigated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351617 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-19 00:36:11 +00:00
Matt Arsenault
5570b07022 GlobalISel: Verify G_BITCAST
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351594 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 21:04:59 +00:00
Matt Arsenault
34b76d05a1 GlobalISel: Verify G_ICMP/G_FCMP vector types
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351591 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 20:49:17 +00:00
Matt Arsenault
04c7d10f65 GlobalISel: Verify g_zextload and g_sextload
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@351584 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-18 20:17:37 +00:00
Hiroshi Inoue
7a9527e0eb [NFC] fix trivial typos in comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350690 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-09 05:11:10 +00:00
Florian Hahn
55534df34f [MachineVerifier] Include offending register in allocatable live-in error msg.
This patch adds a convenience report() method for physical registers and
uses it to print the offending register with the 'MBB has allocatable
live-in' error.

Reviewers: MatzeB, rtereshin, dsanders

Reviewed By: dsanders

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@350630 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08 15:16:23 +00:00
Amara Emerson
e7dca1ec05 [GlobalISel] Restrict G_MERGE_VALUES capability and replace with new opcodes.
This patch restricts the capability of G_MERGE_VALUES, and uses the new
G_BUILD_VECTOR and G_CONCAT_VECTORS opcodes instead in the appropriate places.

This patch also includes AArch64 support for selecting G_BUILD_VECTOR of <4 x s32>
and <2 x s64> vectors.

Differential Revisions: https://reviews.llvm.org/D53629

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348788 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-10 18:44:58 +00:00
Amara Emerson
922f82fa41 [GlobalISel] Introduce G_BUILD_VECTOR, G_BUILD_VECTOR_TRUNC and G_CONCAT_VECTOR opcodes.
These opcodes are intended to subsume some of the capability of G_MERGE_VALUES,
as it was too powerful and thus complex to add deal with throughout the GISel
pipeline.

G_BUILD_VECTOR creates a vector value from a sequence of uniformly typed
scalar values. G_BUILD_VECTOR_TRUNC is a special opcode for handling scalar
operands which are larger than the destination vector element type, and
therefore does an implicit truncate.

G_CONCAT_VECTOR creates a vector by concatenating smaller, uniformly typed,
vectors together.

These will be used in a subsequent commit. This commit just adds the initial
infrastructure.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348430 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-05 23:53:30 +00:00
Matt Arsenault
f5961147fd Fix typo in verifier error message
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@345083 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-23 21:23:52 +00:00
Daniel Sanders
b95f965d7b [machineverifier] Detect PHI's that are preceeded by non-PHI's
If present, PHI nodes must appear before non-PHI nodes in a basic block. The
register allocator relies on this and will fail to eliminate PHI's that do not
meet this requirement.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343731 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-03 22:05:31 +00:00
Daniel Sanders
8f3aebf19b [globalisel][verifier] Run the MachineVerifier from IRTranslator onwards
-verify-machineinstrs inserts the MachineVerifier after every MachineInstr-based
pass. However, GlobalISel creates MachineInstr-based passes earlier than DAGISel
and the corresponding verifiers are not being added. This patch fixes that.

If GlobalISel triggers the fallback path then the MIR can be left in a bad
state that is going to be cleared by ResetMachineFunctions. In this situation
verifying between GlobalISel passes will prevent the fallback path from
recovering from this. As a result, we bail out of verifying a function if the
FailedISel attribute is present.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@343613 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-02 17:56:58 +00:00
Bjorn Pettersson
32a3289434 [MachineVerifier] Relax checkLivenessAtDef regarding dead subreg defs
Summary:
Consider an instruction that has multiple defs of the same
vreg, but defining different subregs:
  %7.sub1:rc, dead %7.sub2:rc = inst

Calling checkLivenessAtDef for the live interval associated
with %7 incorrectly reported "live range continues after a
dead def". The live range for %7 has a dead def at the slot
index for "inst" even if the live range continues (given that
there are later uses of %7.sub1).

This patch adjusts MachineVerifier::checkLivenessAtDef
to allow dead subregister definitions, unless we are checking
a subrange (when tracking subregister liveness).

A limitation is that we do not detect the situation when the
live range continues past an instruction that defines the
full virtual register by multiple dead subreg defines.

I also removed some dead code related to physical register
in checkLivenessAtDef. Wwe only call that method for virtual
registers, so I added an assertion instead.

Reviewers: kparzysz

Reviewed By: kparzysz

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@342618 91177308-0d34-0410-b5e6-96231b3b80d8
2018-09-20 06:59:18 +00:00
Matt Arsenault
9b313de7bb MachineVerifier: Fix assert on implicit virtreg use
If the liveness of a physical register was invalid, this
was attempting to iterate the subregisters of all register
uses of the instruction, which would assert when it
encountered an implicit virtual register operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@340763 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-27 17:40:09 +00:00
Krzysztof Parzyszek
5ede58d7d7 [MachineVerifier] Check if predecessor is jointly dominated by undefs
Each use of a value should be jointly dominated by the union of defs and
undefs. It can happen that it will only be jointly dominated by undefs,
and that is still legal. Make sure that the verifier is aware of that.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339924 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-16 19:13:28 +00:00
Fangrui Song
af7b1832a0 Remove trailing space
sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338293 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-30 19:41:25 +00:00
Fangrui Song
7d88286b7c [CodeGen] Fix inconsistent declaration parameter name
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337200 91177308-0d34-0410-b5e6-96231b3b80d8
2018-07-16 18:51:40 +00:00
Mikael Holmen
b16b4ba59a [DebugInfo] Make sure all DBG_VALUEs' reguse operands have IsDebug property
Summary:
In some cases, these operands lacked the IsDebug property, which is meant to signal that
they should not affect codegen. This patch adds a check for this property in the
MachineVerifier and adds it where it was missing.

This includes refactorings to use MachineInstrBuilder construction functions instead of
manually setting up the intrinsic everywhere.

Patch by: JesperAntonsson

Reviewers: aprantl, rnk, echristo, javed.absar

Reviewed By: aprantl

Subscribers: qcolombet, sdardis, nemanjai, JDevlieghere, atanasyan, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@335214 91177308-0d34-0410-b5e6-96231b3b80d8
2018-06-21 10:03:34 +00:00
Heejin Ahn
5b752cf527 [WebAssembly] Add Wasm personality and isScopedEHPersonality()
Summary:
- Add wasm personality function
- Re-categorize the existing `isFuncletEHPersonality()` function into
two different functions: `isFuncletEHPersonality()` and
`isScopedEHPersonality(). This becomes necessary as wasm EH uses scoped
EH instructions (catchswitch, catchpad/ret, and cleanuppad/ret) but not
outlined funclets.
- Changed some callsites of `isFuncletEHPersonality()` to
`isScopedEHPersonality()` if they are related to scoped EH IR-level
stuff.

Reviewers: majnemer, dschuff, rnk

Subscribers: jfb, sbc100, jgravelle-google, eraman, JDevlieghere, sunfish, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@332667 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-17 20:52:03 +00:00
Shiva Chen
24abe71d71 [DebugInfo] Examine all uses of isDebugValue() for debug instructions.
Because we create a new kind of debug instruction, DBG_LABEL, we need to
check all passes which use isDebugValue() to check MachineInstr is debug
instruction or not. When expelling debug instructions, we should expel
both DBG_VALUE and DBG_LABEL. So, I create a new function,
isDebugInstr(), in MachineInstr to check whether the MachineInstr is
debug instruction or not.

This patch has no new test case. I have run regression test and there is
no difference in regression test.

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

Patch by Hsiangkai Wang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@331844 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-09 02:42:00 +00:00