Chandler Carruth [Sat, 11 Oct 2014 05:28:30 +0000 (05:28 +0000)]
[SCEV] Fix one more caller blindly passing the latch to SCEV's
getSmallConstantTripCount even when it isn't the exiting block.
I missed this in my first audit, very sorry. This was found in LNT and
elsewhere. I don't have a test case, but it was completely obvious from
inspection that this was the problem. I'll see if I can reduce a test
case, but I'm not really hopeful, and the value seems quite low.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219562
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 11 Oct 2014 01:04:40 +0000 (01:04 +0000)]
Guard the definition of the stack tracing function with the same macros
that guard its usage. Without this, we can get unused function warnings
when backtraces are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219558
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Sat, 11 Oct 2014 00:55:18 +0000 (00:55 +0000)]
Add basic conditional branches in mips fast-isel
Summary: Implement the most basic form of conditional branches in Mips fast-isel.
Test Plan:
br1.ll
run 4 flavors of test-suite. mips32 r1/r2 and at -O0/O2
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, rfuhler
Differential Revision: http://reviews.llvm.org/D5583
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219556
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Sat, 11 Oct 2014 00:12:11 +0000 (00:12 +0000)]
[SCEV] Add some asserts to the recently improved trip count computation
routines and fix all of the bugs they expose.
I hit a test case that crashed even without these asserts due to passing
a non-exiting latch to the ExitingBlock parameter of the trip count
computation machinery. However, when I add the nice asserts, it turns
out we have plenty of coverage of these bugs, they just didn't manifest
in crashers.
The core problem seems to stem from an assumption that the latch *is*
the exiting block. While this is often true, and somewhat the "normal"
way to think about loops, it isn't necessarily true. The correct way to
call the trip count routines in a *generic* fashion (that is, without
a particular exit in mind) is to just use the loop's single exiting
block if it has one. The trip count can't be computed generically unless
it does. This works great for the loop vectorizer. The loop unroller
actually *wants* to select the latch when it has to chose between
multiple exits because for unrolling it is the latch trips that matter.
But if this is the desire, it needs to explicitly guard for non-exiting
latches and check for the generic trip count in that case.
I've added the asserts, and added convenience APIs for querying the trip
count generically that check for a single exit block. I've kept the APIs
consistent between computing trip count and trip multiples.
Thansk to Mark for the help debugging and tracking down the *right* fix
here!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219550
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Fri, 10 Oct 2014 23:07:09 +0000 (23:07 +0000)]
[MCJIT] Replace memcpy with readBytesUnaligned in RuntimeDyldMachOI386.
This should fix the failures of the MachO_i386_DynNoPIC_relocations.s test case
on MIPS hosts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219543
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Fri, 10 Oct 2014 23:00:21 +0000 (23:00 +0000)]
Return undef on FP <-> Int conversions that overflow (PR21330).
The LLVM Lang Ref states for signed/unsigned int to float conversions:
"If the value cannot fit in the floating point value, the results are undefined."
And for FP to signed/unsigned int:
"If the value cannot fit in ty2, the results are undefined."
This matches the C definitions.
The existing behavior pins to infinity or a max int value, but that may just
lead to more confusion as seen in:
http://llvm.org/bugs/show_bug.cgi?id=21130
Returning undef will hopefully lead to a less silent failure.
Differential Revision: http://reviews.llvm.org/D5603
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219542
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 10 Oct 2014 22:58:26 +0000 (22:58 +0000)]
Follow-up to r219534 to make symbolization more robust.
1) Explicitly provide important arguments to llvm-symbolizer,
not relying on defaults.
2) Be more defensive about symbolizer output.
This might fix weird failures on ninja-x64-msvc-RA-centos6 buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219541
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 22:16:07 +0000 (22:16 +0000)]
R600/SI: Change how DS offsets are printed
Match SC by using offset/offset0/offset1 and printing
in decimal.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219537
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 22:12:32 +0000 (22:12 +0000)]
R600/SI: Match read2/write2 stride 64 versions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219536
91177308-0d34-0410-b5e6-
96231b3b80d8
Alexey Samsonov [Fri, 10 Oct 2014 22:06:59 +0000 (22:06 +0000)]
Re-land r219354: Use llvm-symbolizer to symbolize LLVM/Clang crash dumps.
In fact, symbolization is now expected to work only on Linux and
FreeBSD/NetBSD, where we have dl_iterate_phdr and can learn the
main executable name without argv0 (it will be possible on BSD systems
after http://reviews.llvm.org/D5693 lands). #ifdef-out the code for
all the rest Unix systems.
Reviewed in http://reviews.llvm.org/D5610
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219534
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 22:01:59 +0000 (22:01 +0000)]
R600/SI: Add load / store machine optimizer pass.
Currently this only functions to match simple cases
where ds_read2_* / ds_write2_* instructions can be used.
In the future it might match some of the other weird
load patterns, such as direct to LDS loads.
Currently enabled only with a subtarget feature to enable
easier testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219533
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjoy Das [Fri, 10 Oct 2014 21:22:34 +0000 (21:22 +0000)]
This patch teaches ScalarEvolution to pick and use !range metadata.
It also makes it more aggressive in querying range information by
adding a call to isKnownPredicateWithRanges to
isLoopBackedgeGuardedByCond and isLoopEntryGuardedByCond.
phabricator: http://reviews.llvm.org/D5638
Reviewed by: atrick, hfinkel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219532
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 21:07:03 +0000 (21:07 +0000)]
[mips] Actually mark that the default case is unreachable as this switch
is over a subset of condition codes.
This fixes the -Werror build which warns about use of uninitialized
variables in the default case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219531
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 10 Oct 2014 20:46:28 +0000 (20:46 +0000)]
Implement floating point compare for mips fast-isel
Summary: Expand SelectCmp to handle floating point compare
Test Plan:
fpcmpa.ll
run 4 flavors of test-suite, mips32 r1/r2 O0/O2
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, rfuhler
Differential Revision: http://reviews.llvm.org/D5567
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219530
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 10 Oct 2014 18:46:21 +0000 (18:46 +0000)]
Revert "DebugInfo: Ensure that all debug location scope chains from instructions within a function, lead to the function itself."
This invariant is violated (& the assertions fire) on some Objective C++
in the test-suite. Reverting while I investigate.
This reverts commit r219215.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219523
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 10 Oct 2014 18:33:51 +0000 (18:33 +0000)]
llvm-ar: Start adding support for mri scripts.
I was quiet surprised to find this feature being used. Fortunately the uses
I found look fairly simple. In fact, they are just a very verbose version
of the regular ar commands.
Start implementing it then by parsing the script and setting the command
variables as if we had a regular command line.
This patch adds just enough support to create an empty archive and do a bit
of error checking. In followup patches I will implement at least addmod
and addlib.
From the description in the manual, even the more general case should not
be too hard to implement if needed. The features that don't map 1:1 to
the simple command line are
* Reading from multiple archives.
* Creating multiple archives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219521
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 17:44:47 +0000 (17:44 +0000)]
R600/SI: Disable copying of SCC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219519
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 10 Oct 2014 17:39:51 +0000 (17:39 +0000)]
implement integer compare in mips fast-isel
Summary: implement SelectCmp (integer compare ) in mips fast-isel
Test Plan:
icmpa.ll
also ran 4 test-suite flavors mips32 r1/r2 O0/O2
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, rfuhler, mcrosier
Differential Revision: http://reviews.llvm.org/D5566
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219518
91177308-0d34-0410-b5e6-
96231b3b80d8
Mark Heffernan [Fri, 10 Oct 2014 17:39:11 +0000 (17:39 +0000)]
This patch de-pessimizes the calculation of loop trip counts in
ScalarEvolution in the presence of multiple exits. Previously all
loops exits had to have identical counts for a loop trip count to be
considered computable. This pessimization was implemented by calling
getBackedgeTakenCount(L) rather than getExitCount(L, ExitingBlock)
inside of ScalarEvolution::getSmallConstantTripCount() (see the FIXME
in the comments of that function). The pessimization was added to fix
a corner case involving undefined behavior (pr/16130). This patch more
precisely handles the undefined behavior case allowing the pessimization
to be removed.
ControlsExit replaces IsSubExpr to more precisely track the case where
undefined behavior is expected to occur. Because undefined behavior is
tracked more precisely we can remove MustExit from ExitLimit. MustExit
was used to track the case where the limit was computed potentially
assuming undefined behavior even if undefined behavior didn't necessarily
occur.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219517
91177308-0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Fri, 10 Oct 2014 17:34:30 +0000 (17:34 +0000)]
Add couple of missing 'override' keyword. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219516
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 10 Oct 2014 17:21:15 +0000 (17:21 +0000)]
[PowerPC] Reduce names from Power8Vector to P8Vector
Per Hal Finkel's review, improving typability of some variable names.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219514
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 10 Oct 2014 17:06:20 +0000 (17:06 +0000)]
[MiSched] Fix a logic error in tryPressure()
Fixes a logic error in the MachineScheduler found by Steve Montgomery (and
confirmed by Andy). This has gone unfixed for months because the fix has been
found to introduce some small performance regressions. However, Andy has
recommended that, at this point, we fix this to avoid further dependence on the
incorrect behavior (and then follow-up separately on any regressions), and I
agree.
Fixes PR18883.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219512
91177308-0d34-0410-b5e6-
96231b3b80d8
Reed Kotler [Fri, 10 Oct 2014 17:00:46 +0000 (17:00 +0000)]
Implement floating point to integer conversion in mips fast-isel
Summary: Add the ability to convert 64 or 32 bit floating point values to integer in mips fast-isel
Test Plan:
fpintconv.ll
ran 4 flavors of test-suite with no errors, misp32 r1/r2 O0/O2
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits, rfuhler, mcrosier
Differential Revision: http://reviews.llvm.org/D5562
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219511
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 10 Oct 2014 16:59:52 +0000 (16:59 +0000)]
Simplify a few uses of DwarfDebug::SPMap
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219510
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Fri, 10 Oct 2014 16:05:32 +0000 (16:05 +0000)]
Reorder functions in WinCodeViewLineTables.cpp [NFC]
This helps read the comments and understand the code in a natural order
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219508
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 10 Oct 2014 15:51:10 +0000 (15:51 +0000)]
[dwarfdump] Prettyprint DW_AT_APPLE_property_attribute bitfield values.
This change depends on the ApplePropertyString helper that I sent spearately.
Not sure how you want this tested: as a tool test by adding a binary to dump, or as an llvm test starting from an IR file?
Reviewers: dblaikie, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5689
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219507
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Fri, 10 Oct 2014 15:51:02 +0000 (15:51 +0000)]
[dwarfdump] Resolve also variable specifications/abstract_origins.
DW_AT_specification and DW_AT_abstract_origin resolving was only performed
on subroutine DIEs because it used the getSubroutineName method. Introduce
a more generic getName() and use it to dump the reference attributes.
Testcases have been updated to check the printed names instead of the offsets
except when the name could be ambiguous.
Reviewers: dblaikie, samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5625
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219506
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 10 Oct 2014 15:32:50 +0000 (15:32 +0000)]
Reduce double set lookups. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219505
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Fri, 10 Oct 2014 15:09:28 +0000 (15:09 +0000)]
[PowerPC] Add feature for Power8 vector extensions
The current VSX feature for PowerPC specifies availability of the VSX
instructions added with the 2.06 architecture version. With 2.07, the
architecture adds new instructions to both the Category:Vector and
Category:VSX instruction sets. Additionally, unaligned vector storage
operations have improved performance.
This patch adds a feature to provide access to the new instructions
and performance capabilities of Power8. For compatibility with GCC,
the feature is controlled via a new -mpower8-vector switch, and the
feature causes the __POWER8_VECTOR__ builtin define to be generated by
the preprocessor.
There is a companion patch for cfe being committed at the same time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219501
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 10 Oct 2014 14:37:30 +0000 (14:37 +0000)]
[mips][microMIPS] Implement ADDIUSP instruction
Differential Revision: http://reviews.llvm.org/D5084
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219500
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 10 Oct 2014 14:02:44 +0000 (14:02 +0000)]
[mips][microMIPS] Implement JR16 instruction
Differential Revision: http://reviews.llvm.org/D5062
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219498
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 10 Oct 2014 13:45:34 +0000 (13:45 +0000)]
[mips][microMIPS] Implement ADDIUS5 instruction
Differential Revision: http://reviews.llvm.org/D5049
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219495
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 10 Oct 2014 13:31:18 +0000 (13:31 +0000)]
ps][microMIPS] Implement JRC instruction
Differential Revision: http://reviews.llvm.org/D5045
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219494
91177308-0d34-0410-b5e6-
96231b3b80d8
Zoran Jovanovic [Fri, 10 Oct 2014 13:22:28 +0000 (13:22 +0000)]
[mips][microMIPS] Implement JALRS16 instruction
Differential Revision: http://reviews.llvm.org/D5027
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219493
91177308-0d34-0410-b5e6-
96231b3b80d8
Timur Iskhodzhanov [Fri, 10 Oct 2014 12:52:58 +0000 (12:52 +0000)]
Fix a small typo, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219492
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Fri, 10 Oct 2014 10:18:12 +0000 (10:18 +0000)]
APInt: Unfold return expressions so RVO can work.
Saves a couple of expensive deep copies. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219487
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 08:27:22 +0000 (08:27 +0000)]
[ADT] Add an (ADL-friendly) abs free function for APFloat that returns
by value having cleared the sign bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219485
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 08:27:19 +0000 (08:27 +0000)]
Don't use an unqualified 'abs' function call with a builtin type.
This is dangerous for numerous reasons. The primary risk here is with
floating point or double types where if the wrong header files are
included in a strange order this can implicitly convert to integers and
then call the C abs function on the integers. There is a secondary risk
that even impacts integers where if the namespace the code is written in
ever defines an abs overload for types within that namespace the global
abs will be hidden. The correct form is to call std::abs or write 'using
std::abs' for builtin types (and only the latter is correct in any
generic context).
I've also added the requisite header to be a bit more explicit here.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219484
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 10 Oct 2014 06:59:05 +0000 (06:59 +0000)]
Add tests for r219479.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219480
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 10 Oct 2014 06:58:11 +0000 (06:58 +0000)]
Object, COFF: Relax aux symbols for section definitions
We, I suppose naïvely, believed the COFF specification with regard to
auxiliary symbol records which defined sections: they specified that the
symbol value should be zero. However, dumpbin and MinGW's objdump do
not consider the symbol value as a restriction. Relaxing this allows us
to properly dump MinGW linked executables.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219479
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 10 Oct 2014 06:39:29 +0000 (06:39 +0000)]
Sink the per-CU part of DwarfDebug::finishSubprogramDefinitions into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219477
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 10 Oct 2014 06:39:26 +0000 (06:39 +0000)]
Sink most of DwarfDebug::constructAbstractSubprogramScopeDIE down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219476
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 05:21:32 +0000 (05:21 +0000)]
Add minnum / maxnum to APFloat
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219475
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 05:14:12 +0000 (05:14 +0000)]
[ADT] Replace the logb implementation with the simpler and much closer
to what we actually want ilogb implementation. This makes everything
*much* easier to deal with and is actually what we want when using it
anyways.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219474
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 04:54:30 +0000 (04:54 +0000)]
[ADT] Add the scalbn function for APFloat.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219473
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Fri, 10 Oct 2014 04:17:04 +0000 (04:17 +0000)]
[ADT] Implement the 'logb' functionality for APFloat. This is necessary
to implement complex division in the constant folder of Clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219471
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Fri, 10 Oct 2014 03:56:24 +0000 (03:56 +0000)]
[LVI] Revert the remainder of "r218231 - Add two thresholds lvi-overdefined-BB-threshold and lvi-overdefined-threshold"
Some of r218231 was reverted with the code that used it in r218971, but not all
of it. This removes the rest (which is now dead).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219469
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Fri, 10 Oct 2014 03:09:38 +0000 (03:09 +0000)]
Avoid unnecessary map lookup/insertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219466
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Fri, 10 Oct 2014 02:15:04 +0000 (02:15 +0000)]
Add isInfinity to ConstantFP
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219463
91177308-0d34-0410-b5e6-
96231b3b80d8
Arnold Schwaighofer [Fri, 10 Oct 2014 01:27:02 +0000 (01:27 +0000)]
SimplifyCFG: Don't convert phis into selects if we could remove undef behavior
instead
We used to transform this:
define void @test6(i1 %cond, i8* %ptr) {
entry:
br i1 %cond, label %bb1, label %bb2
bb1:
br label %bb2
bb2:
%ptr.2 = phi i8* [ %ptr, %entry ], [ null, %bb1 ]
store i8 2, i8* %ptr.2, align 8
ret void
}
into this:
define void @test6(i1 %cond, i8* %ptr) {
%ptr.2 = select i1 %cond, i8* null, i8* %ptr
store i8 2, i8* %ptr.2, align 8
ret void
}
because the simplifycfg transformation into selects would happen to happen
before the simplifycfg transformation that removes unreachable control flow
(We have 'unreachable control flow' due to the store to null which is undefined
behavior).
The existing transformation that removes unreachable control flow in simplifycfg
is:
/// If BB has an incoming value that will always trigger undefined behavior
/// (eg. null pointer dereference), remove the branch leading here.
static bool removeUndefIntroducingPredecessor(BasicBlock *BB)
Now we generate:
define void @test6(i1 %cond, i8* %ptr) {
store i8 2, i8* %ptr.2, align 8
ret void
}
I did not see any impact on the test-suite + externals.
rdar://
18596215
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219462
91177308-0d34-0410-b5e6-
96231b3b80d8
Rafael Espindola [Fri, 10 Oct 2014 00:48:13 +0000 (00:48 +0000)]
Fix gcc warning in gold-plugin.cpp.
Patch by Markus Trippelsdorf!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219459
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Fri, 10 Oct 2014 00:17:57 +0000 (00:17 +0000)]
obj2yaml, COFF: Handle long section names
Long section names are represented as a slash followed by a numeric
ASCII string. This number is an offset into a string table.
Print the appropriate entry in the string table instead of the less
enlightening /4.
N.B. yaml2obj already does the right thing, this test exercises both
sides of the (de-)serialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219458
91177308-0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Thu, 9 Oct 2014 23:26:15 +0000 (23:26 +0000)]
[ADT] Add basic operator overloads for arithmetic to APFloat to make
code using it more readable.
Also add a copySign static function that works more like the standard
function by accepting the value and sign-carying value as arguments.
No interesting logic here, but tests added to cover the basic API
additions and make sure they do something plausible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219453
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 9 Oct 2014 21:26:35 +0000 (21:26 +0000)]
Improve sqrt estimate algorithm (fast-math)
This patch changes the fast-math implementation for calculating sqrt(x) from:
y = 1 / (1 / sqrt(x))
to:
y = x * (1 / sqrt(x))
This has 2 benefits: less code / faster code and one less estimate instruction
that may lose precision.
The only target that will be affected (until http://reviews.llvm.org/D5658 is approved)
is PPC. The difference in codegen for PPC is 2 less flops for a single-precision sqrtf
or vector sqrtf and 4 less flops for a double-precision sqrt.
We also eliminate a constant load and extra register usage.
Differential Revision: http://reviews.llvm.org/D5682
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219445
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 9 Oct 2014 21:24:46 +0000 (21:24 +0000)]
delete function names from comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219444
91177308-0d34-0410-b5e6-
96231b3b80d8
Sanjay Patel [Thu, 9 Oct 2014 21:23:39 +0000 (21:23 +0000)]
delete function name from comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219443
91177308-0d34-0410-b5e6-
96231b3b80d8
Frederic Riss [Thu, 9 Oct 2014 20:43:04 +0000 (20:43 +0000)]
Add ApplePropertyString dump helper to Dwarf.{h|cpp}.
Reviewers: dblaikie
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5688
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219442
91177308-0d34-0410-b5e6-
96231b3b80d8
Samuel Antao [Thu, 9 Oct 2014 20:42:56 +0000 (20:42 +0000)]
Fix bug in GPR to FPR moves in PPC64LE.
The current implementation of GPR->FPR register moves uses a stack slot. This mechanism writes a double word and reads a word. In big-endian the load address must be displaced by 4-bytes in order to get the right value. In little endian this is no longer required. This patch fixes the issue and adds LE regression tests to fast-isel-conversion which currently expose this problem.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219441
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 20:36:27 +0000 (20:36 +0000)]
Remove unused parameter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219440
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 20:26:15 +0000 (20:26 +0000)]
Sink DwarfDebug::createAndAddScopeChildren down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219437
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 20:21:36 +0000 (20:21 +0000)]
Sink DwarfDebug::constructSubprogramScopeDIE down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219436
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Thu, 9 Oct 2014 20:06:29 +0000 (20:06 +0000)]
[Reassociate] Don't canonicalize X - undef to X + (-undef).
Phabricator Revision: http://reviews.llvm.org/D5674
PR21205
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219434
91177308-0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Thu, 9 Oct 2014 19:50:39 +0000 (19:50 +0000)]
Remove a compiler bug workaround from 2007. The affected versions of gcc are long gone.
NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219433
91177308-0d34-0410-b5e6-
96231b3b80d8
Hal Finkel [Thu, 9 Oct 2014 19:48:12 +0000 (19:48 +0000)]
Revert "[BasicAA] Revert "Revert r218714 - Make better use of zext and sign information.""
This reverts commit r219135 -- still causing miscompiles in SPEC it seems...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219432
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 9 Oct 2014 19:15:18 +0000 (19:15 +0000)]
Remove unused field from Operand
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219430
91177308-0d34-0410-b5e6-
96231b3b80d8
Matt Arsenault [Thu, 9 Oct 2014 19:15:15 +0000 (19:15 +0000)]
Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219429
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 9 Oct 2014 19:06:00 +0000 (19:06 +0000)]
R600/SI: Legalize CopyToReg during instruction selection
The instruction emitter will crash if it encounters a CopyToReg
node with a non-register operand like FrameIndex.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219428
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 9 Oct 2014 18:36:59 +0000 (18:36 +0000)]
[PBQP] Add missing headers from r219421.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219425
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 18:24:28 +0000 (18:24 +0000)]
Sink DwarfDebug::createScopeChildrenDIE down into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219422
91177308-0d34-0410-b5e6-
96231b3b80d8
Lang Hames [Thu, 9 Oct 2014 18:20:51 +0000 (18:20 +0000)]
[PBQP] Replace PBQPBuilder with composable constraints (PBQPRAConstraint).
This patch removes the PBQPBuilder class and its subclasses and replaces them
with a composable constraints class: PBQPRAConstraint. This allows constraints
that are only required for optimisation (e.g. coalescing, soft pairing) to be
mixed and matched.
This patch also introduces support for target writers to supply custom
constraints for their targets by overriding a TargetSubtargetInfo method:
std::unique_ptr<PBQPRAConstraints> getCustomPBQPConstraints() const;
This patch should have no effect on allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219421
91177308-0d34-0410-b5e6-
96231b3b80d8
Tom Stellard [Thu, 9 Oct 2014 18:09:15 +0000 (18:09 +0000)]
R600/SI: Legalize INSERT_SUBREG instructions during PostISelFolding
LLVM assumes INSERT_SUBREG will always have register operands, so
we need to legalize non-register operands, like FrameIndexes, to
avoid random assertion failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219420
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 17:56:39 +0000 (17:56 +0000)]
Sink DwarfDebug.cpp::constructVariableDIE into DwarfCompileUnit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219419
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 17:56:36 +0000 (17:56 +0000)]
Move DwarfUnit::constructVariableDIE down to DwarfCompileUnit, since it's only needed there.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219418
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Thu, 9 Oct 2014 17:51:35 +0000 (17:51 +0000)]
[PPC64] VSX indexed-form loads use wrong instruction format
The VSX instruction definitions for lxsdx, lxvd2x, lxvdsx, and lxvw4x
incorrectly use the XForm_1 instruction format, rather than the
XX1Form instruction format. This is likely a pasto when creating
these instructions, which were based on lvx and so forth. This patch
uses the correct format.
The existing reformatting test (test/MC/PowerPC/vsx.s) missed this
because the two formats differ only in that XX1Form has an extension
to the target register field in bit 31. The tests for these
instructions used a target register of 7, so the default of 0 in bit
31 for XForm_1 didn't expose a problem. For register numbers 32-63
this would be noticeable. I've changed the test to use higher
register numbers to verify my change is effective.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219416
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 17:08:42 +0000 (17:08 +0000)]
Sink DwarfDebug::constructLexicalScopeDIE into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219414
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 17:08:38 +0000 (17:08 +0000)]
Missing reformatting
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219413
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 16:50:53 +0000 (16:50 +0000)]
Sink DwarfDebug::constructInlinedScopeDIE into DwarfCompileUnit
This introduces access to the AbstractSPDies map from DwarfDebug so
DwarfCompileUnit can access it. Eventually this'll sink down to
DwarfFile, but it'll still be generically accessible - not much
encapsulation to provide it. (constructInlinedScopeDIE could stay
further up, in DwarfFile to avoid exposing this - but I don't think
that's particularly better)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219411
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrea Di Biagio [Thu, 9 Oct 2014 12:41:49 +0000 (12:41 +0000)]
[InstCombine] Fix wrong folding of constant comparisons involving ashr and negative values.
This patch fixes a bug in method InstCombiner::FoldCmpCstShrCst where we
wrongly computed the distance between the highest bits set of two negative
values.
This fixes PR21222.
Differential Revision: http://reviews.llvm.org/D5700
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219406
91177308-0d34-0410-b5e6-
96231b3b80d8
Kevin Qin [Thu, 9 Oct 2014 10:13:27 +0000 (10:13 +0000)]
[AArch64] Enable partial & runtime unrolling on cortex-a57.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219401
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 9 Oct 2014 08:42:31 +0000 (08:42 +0000)]
Object, COFF: Move the VirtualSize/SizeOfRawData logic to getSectionSize
While getSectionContents was updated to do the right thing,
getSectionSize wasn't. Move the logic to getSectionSize and leverage it
from getSectionContents.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219391
91177308-0d34-0410-b5e6-
96231b3b80d8
Robert Khasanov [Thu, 9 Oct 2014 08:38:48 +0000 (08:38 +0000)]
[AVX512] Extended avx512_binop_rm for AVX512VL subsets.
Added avx512_binop_rm_vl multiclass for VL subset
Added encoding tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219390
91177308-0d34-0410-b5e6-
96231b3b80d8
David Majnemer [Thu, 9 Oct 2014 07:49:28 +0000 (07:49 +0000)]
Object, COFF: Cap the section contents to min(VirtualSize, SizeOfRawData)
It is not useful to return the data beyond VirtualSize it's less than
SizeOfRawData.
An implementation detail of COFF requires the section size to be rounded
up to a multiple of FileAlignment; this means that SizeOfRawData is not
representative of how large the section is. Instead, we should cap it
to VirtualSize when this occurs as it represents the true size of the
section.
Note that this is only relevant in executable files because this
rounding doesn't occur in object files (and VirtualSize is always zero).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219388
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 06:28:06 +0000 (06:28 +0000)]
Remove more calls to getSubtargetImpl from the schedulers and
remove cached or unnecessary TargetMachines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219387
91177308-0d34-0410-b5e6-
96231b3b80d8
Bob Wilson [Thu, 9 Oct 2014 05:43:30 +0000 (05:43 +0000)]
Use triple's isiOS() and isOSDarwin() methods.
These methods are already used in lots of places. This makes things more
consistent. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219386
91177308-0d34-0410-b5e6-
96231b3b80d8
Rui Ueyama [Thu, 9 Oct 2014 02:16:38 +0000 (02:16 +0000)]
Object: Add range iterators for COFF import/export table
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219383
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 01:59:35 +0000 (01:59 +0000)]
Remove unused argument to CreateTargetScheduleState and change
the TargetMachine to a TargetSubtargetInfo since everything
we wanted is off of that.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219382
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 01:59:31 +0000 (01:59 +0000)]
Remove uses of getSubtargetImpl from ResourcePriorityQueue and
replace them with calls off of the MachineFuncton.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219381
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 01:35:29 +0000 (01:35 +0000)]
Remove the uses of getSubtargetImpl from InstrEmitter and remove
the now unused TargetMachine variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219379
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 01:35:27 +0000 (01:35 +0000)]
Use the subtarget on the dag to get TargetFrameLowering rather
than off the target machine.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219378
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Thu, 9 Oct 2014 00:57:31 +0000 (00:57 +0000)]
Remove uses of the TargetMachine from FunctionLoweringInfo
via caching TargetLowering and using the MachineFunction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219375
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 00:21:42 +0000 (00:21 +0000)]
Push DwarfDebug::attachRangesOrLowHighPC down into DwarfCompileUnit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219372
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Thu, 9 Oct 2014 00:11:39 +0000 (00:11 +0000)]
Sink DwarfDebug::addScopeRangeList down into DwarfCompileUnit
(& add a few accessors/make a couple of things public for this - it's a
bit of a toss-up, but I think I prefer it this way, keeping some more of
the meaty code down in DwarfCompileUnit - if only to make for smaller
implementation files, etc)
I think we could simplify range handling a bit if we removed the range
lists from each unit and just put a single range list on DwarfDebug,
similar to address pooling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219370
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 8 Oct 2014 23:38:40 +0000 (23:38 +0000)]
Remove unnecessary include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219368
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 8 Oct 2014 23:38:39 +0000 (23:38 +0000)]
Use both the cached TLI and the subtarget off of the DAG in
the DAG combiner.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219367
91177308-0d34-0410-b5e6-
96231b3b80d8
Eric Christopher [Wed, 8 Oct 2014 23:38:33 +0000 (23:38 +0000)]
Remove getSubtargetImpl calls from FastISel, we can get it from
the MachineFunction where it's already cached.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219366
91177308-0d34-0410-b5e6-
96231b3b80d8
Robin Morisset [Wed, 8 Oct 2014 23:30:45 +0000 (23:30 +0000)]
Fix typo in comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219365
91177308-0d34-0410-b5e6-
96231b3b80d8
David Blaikie [Wed, 8 Oct 2014 23:30:05 +0000 (23:30 +0000)]
Sink DwarfUnit::addSectionDelta into DwarfCompileUnit, the only place it's needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219364
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 8 Oct 2014 23:25:39 +0000 (23:25 +0000)]
[AVX512] Rename AVX512_masking* to AVX512_maskable*
No functional change.
This is the current AVX512_maskable multiclass hierarchy:
maskable_custom
/ \
/ \
maskable_common maskable_in_asm
/ \
/ \
maskable maskable_3src
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219363
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 8 Oct 2014 23:25:37 +0000 (23:25 +0000)]
[AVX512] Intrinsics for vextract*x4
This adds the Pat<>'s for the intrinsics. These are necessary because we
don't lower these intrinsics to SDNodes but match them directly. See the
rational in the previous commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219362
91177308-0d34-0410-b5e6-
96231b3b80d8
Adam Nemet [Wed, 8 Oct 2014 23:25:33 +0000 (23:25 +0000)]
[AVX512] Add asm-only support for vextract*x4 masking variants
These derive from the new asm-only masking definitions.
Unfortunately I wasn't able to find a ISel pattern that we could legally
generate for the masking variants. The problem is that since the destination
is v4* we would need VK4 register classes and v4i1 value types to express the
masking. These are however not legal types/classes in AVX512f but only in VL,
so things get complicated pretty quickly. We can revisit this question later
if we have a more pressing need to express something like this.
So the ISel patterns are empty for the masking instructions and the next patch
will add Pat<>s instead to match the intrinsics calls with instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219361
91177308-0d34-0410-b5e6-
96231b3b80d8