Commit Graph

152544 Commits

Author SHA1 Message Date
Dehao Chen
7b5ab7f124 Refactor the build{Module|Function}SimplificationPipeline to expose optimization phase.
Summary: This is in preparation of https://reviews.llvm.org/D36052

Reviewers: chandlerc, davidxl, tejohnson

Reviewed By: chandlerc

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309500 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-30 04:55:39 +00:00
David Blaikie
4cf772e1b7 DebugInfo: Provide option for explicitly specifying the name of the DWP file
If you've archived the DWP file somewhere it's probably useful to be
able to just tell llvm-symbolizer where it is when you're symbolizing
stack traces from the binary.

This only provides a mechanism for specifying a single DWP file, good if
you're symbolizing a program with a single DWP file, but it's likely if
the program is dynamically linked that you might have a DWP for each
dynamic library - in which case this feature won't help (at least as
it's surfaced in llvm-symbolizer for now) - in theory it could be
extended to specify a collection of DWP files that could all be
consulted for split CU hash resolution.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309498 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-30 01:34:08 +00:00
Sam Elliott
2567d81a06 Migrate PGOMemOptSizeOpt to use new OptimizationRemarkEmitter Pass
Summary:
Fixes PR33790.

This patch still needs a yaml-style test, which I shall write tomorrow

Reviewers: anemet

Reviewed By: anemet

Subscribers: anemet, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309497 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-30 00:35:33 +00:00
Florian Hahn
cfed1ba7aa [AArch64] Tie source and destination operands for AESMC/AESIMC.
Summary:
Most CPUs implementing AES fusion require instruction pairs of the form
    AESE Vn, _
    AESMC Vn, Vn
and
    AESD Vn, _
    AESIMC Vn, Vn

The constraint is added to AES(I)MC instructions which use the result of
an AES(E|D) instruction by using AES(I)MCTrr pseudo instructions, which
constraint source and destination registers to be the same.

A nice side effect of this change is that now all possible pairs are
scheduled back-to-back on the exynos-m1 for the misched-fusion-aes.ll
test case.

I had to update aes_load_store. The version I added initially was very
reduced and with the new constraint, AESE/AESMC could not be scheduled
back-to-back. I updated the test to be more realistic and still expose
the same scheduling problem as the initial test case.

Reviewers: t.p.northover, rengolin, evandro, kristof.beyls, silviu.baranga

Reviewed By: t.p.northover, evandro

Subscribers: aemerson, javed.absar, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309495 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 20:35:28 +00:00
Florian Hahn
b7c4c52105 [AArch64] Use 8 bytes as preferred function alignment on Cortex-A53.
Summary:
This change gives a 0.25% speedup on execution time, a 0.82% improvement
in benchmark scores and a 0.20% increase in binary size on a Cortex-A53.
These numbers are the geomean results on a wide range of benchmarks from
the test-suite and a range of proprietary suites.

Reviewers: t.p.northover, aadg, silviu.baranga, mcrosier, rengolin

Reviewed By: rengolin

Subscribers: grimar, davide, aemerson, rengolin, javed.absar, kristof.beyls, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309494 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 20:04:54 +00:00
Saleem Abdulrasool
bc4ee245ef MC: simplify internal function call parameter
Rather than passing along most of the parameters, pass a reference to
the MCDWARFrameInfo instead.  This makes it easier to pass additional
information about the frame to the checks.  We need to keep the extra
constructor for the Key around to allow the construction of the null and
tombstone keys.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309493 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 20:03:02 +00:00
Saleem Abdulrasool
1a57e42f2a MC: account for the return column in the CIE key
If the return column is different, we cannot coalesce the CIE across the
FDEs.  Add that to the key calculation.  This ensures that we emit a
separate CIE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309492 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 20:03:00 +00:00
Hiroshi Inoue
48392177ef Fix test failure without X86 backend
move test/Transforms/SimplifyCFG/disable-lookup-table.ll into test/Transforms/SimplifyCFG/X86/disable-lookup-table.ll to avoid test failure when X86 backend is not enabled



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309487 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 15:03:31 +00:00
Simon Pilgrim
e4f6153167 [SelectionDAG][X86] CombineBT - more aggressively determine demanded bits
This patch is in 2 parts:

1 - replace combineBT's use of SimplifyDemandedBits (hasOneUse only) with SelectionDAG::GetDemandedBits to more aggressively determine the lower bits used by BT.

2 - update SelectionDAG::GetDemandedBits to support ANY_EXTEND - if the demanded bits are only in the non-extended portion, then peek through and demand from the source value and then ANY_EXTEND that if we found a match.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309486 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 14:50:25 +00:00
Tobias Grosser
92f74f20bf [tests] Do not emity binary bitcode to stdout in RegionInfo tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309485 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 09:58:43 +00:00
Michal Gorny
a405cd45b7 [OCaml] Pass -D/-UNDEBUG through to ocamlc
Detect [/-][DU]NDEBUG in CMAKE_C_FLAGS* and pass them through to ocamlc.
This is necessary because their value might affect visibility of dump
functions in LLVM and ocamlc uses its own compiler and flags by default.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309483 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 08:10:24 +00:00
Dehao Chen
cb5fd996a0 Update the test to make windows bot pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309482 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 07:01:25 +00:00
Michal Gorny
f2e6bc5c83 [OCaml] Install dynamic libraries in 'stubdirs' directory
Install the OCaml dynamic libraries in the 'stubdirs' directory rather
than the llvm subdirectory in order to fix running executables created
by ocamlc. Otherwise, the executables fail to run being unable to locate
the libraries (unless the LLVM directory is explicitly added to
LD_LIBRARY_PATH).

The staging directories are not altered since they work for our
development setup anyway, and installing into two directories would
unnecessarily make the code more complex.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309481 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 06:46:45 +00:00
Sanjoy Das
10db1a7378 [SCEV] Change an early exit to an assert; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309480 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 05:32:47 +00:00
Dehao Chen
e175948484 update the test file that was omitted in r309478.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309479 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 04:11:20 +00:00
Dehao Chen
04fe17a734 Refine the PGOOpt and SamplePGOSupport handling.
Summary:
Now that SamplePGOSupport is part of PGOOpt, there are several places that need tweaking:
1. AddDiscriminator pass should *not* be invoked at ThinLTOBackend (as it's already invoked in the PreLink phase)
2. addPGOInstrPasses should only be invoked when either ProfileGenFile or ProfileUseFile is non-empty.
3. SampleProfileLoaderPass should only be invoked when SampleProfileFile is non-empty.
4. PGOIndirectCallPromotion should only be invoked in ProfileUse phase, or in ThinLTOBackend of SamplePGO.

Reviewers: chandlerc, tejohnson, davidxl

Reviewed By: chandlerc

Subscribers: sanjoy, mehdi_amini, eraman, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309478 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 04:10:24 +00:00
Tom Stellard
39aff8ce5a AMDGPU: Remove deadcode from AMDGPUInstPrinter
Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309477 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 03:56:53 +00:00
Tom Stellard
0e72c5217b AMDGPU: Move INDIRECT_BASE_ADDR definition out of common files
Summary: This is only used by R600.

Reviewers: arsenm

Reviewed By: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, tpr, llvm-commits, t-tye

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309476 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 03:44:07 +00:00
Jessica Paquette
38e69b8dcf [MachineOutliner] NFC: Change IsTailCall to a call class + frame class
This commit

- Removes IsTailCall and replaces it with a target-defined unsigned
- Refactors getOutliningCallOverhead and getOutliningFrameOverhead so that they don't use IsTailCall
- Adds a call class + frame class classification to OutlinedFunction and Candidate respectively

This accomplishes a couple things.

Firstly, we don't need the notion of *tail call* in the general outlining algorithm.

Secondly, we now can have different "outlining classes" for each candidate within a set of candidates.
This will make it easy to add new ways to outline sequences for certain targets and dynamically choose
an appropriate cost model for a sequence depending on the context that that sequence lives in.

Ultimately, this should get us closer to being able to do something like, say avoid saving the link
register when outlining AArch64 instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309475 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 02:55:46 +00:00
NAKAMURA Takumi
4ea03c9bbc lit::shtest-format.py: Make write-bad-encoding.py py3-aware.
Traceback (most recent call last):
    File "llvm/utils/lit/tests/Inputs/shtest-format/external_shell/write-bad-encoding.py", line 5, in <module>
      sys.stdout.write(b"a line with bad encoding: \xc2.")

sys.stdout.write doesn't accept bytes but sys.stdout.buffer.write accepts.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309473 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 02:52:56 +00:00
Matt Arsenault
1ab1e79a01 AMDGPU: Make areMemAccessesTriviallyDisjoint more aware of segment flat
Checking the encoding is insufficient since now there can
be global or scratch instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309472 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 01:26:21 +00:00
Matt Arsenault
27eee9a0e2 AMDGPU: Teach isLegalAddressingMode about global_* instructions
Also refine the flat check to respect flat-for-global feature,
and constant fallback should check global handling, not
specifically MUBUF.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309471 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 01:12:31 +00:00
Matt Arsenault
d74d012b62 AMDGPU: Start selecting global instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309470 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 01:03:53 +00:00
Eugene Zelenko
ab637ccbc0 [Hexagon] Fix some Clang-tidy modernize-use-using and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309469 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:56:56 +00:00
Alexander Shaposhnikov
b5b38546f9 [llvm] Update MachOObjectFile::exports interface
This diff removes the second argument of the method MachOObjectFile::exports.
In all in-tree uses this argument is equal to "this" and 
without this argument the interface seems to be cleaner.

Test plan: make check-all


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309462 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-29 00:30:45 +00:00
Eli Friedman
44234f0b0a Fix update_llc_test_checks.py ARM parsing
When I tried running the script, the ARM regex parser could not parse
my code. It failed because the .Lfunc_end line has a comment at the
end of it, so this commit removes the newline at the end of the regex.

Patch by Joel Galenson!

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309457 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 23:58:24 +00:00
Tobias Edler von Koch
c99ec6347b [LTO] llvm-lto2: Add option to load sample profile
Summary:
This exposes LTO's Conf.SampleProfile as a command line option
(-lto-sample-profile-file) for testing via the llvm-lto2 utility.

Reviewers: pcc, danielcdh

Subscribers: mehdi_amini, inglorion, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309456 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 23:43:22 +00:00
Adrian Prantl
b2a9fcdbed Remove the unused offset field from LiveDebugValues (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309455 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 23:25:51 +00:00
Adrian Prantl
24019d6a43 Remove the unused offset field from LiveDebugVariables (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309451 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 23:06:50 +00:00
Adrian Prantl
4df9b5f8fb Remove the unused offset from DBG_VALUE (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309450 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 23:00:45 +00:00
Adrian Prantl
30ac8d28e3 Remove the unused DBG_VALUE offset parameter from GlobalISel (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309449 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:46:20 +00:00
Adrian Prantl
e29c97eccc Update the Go bindings for r309426 (remove offset from llvm.dbg.value)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309448 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:44:44 +00:00
Farhana Aleen
3912b267e3 Added tests for i8 interleaved-load-pattern of stride=4, VF=(8, 16, 32).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309447 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:43:34 +00:00
Adrian Prantl
9a729b3c67 Remove the unused DBG_VALUE offset parameter from RegAllocFast (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309446 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:36:55 +00:00
Sumanth Gundapaneni
2286bba978 Add documentation for the attribute "no-jump-tables"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309445 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:26:22 +00:00
Sumanth Gundapaneni
0857e7fe7b [SimplifyCFG] Make the no-jump-tables attribute also disable switch lookup tables
Differential Revision: https://reviews.llvm.org/D35579


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309444 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:25:40 +00:00
Kostya Serebryany
dfa17126d8 [libFuzzer] improve support for inline-8bit-counters (make it more correct and faster)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309443 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 22:00:56 +00:00
Krzysztof Parzyszek
8c277c70f9 [Hexagon] Formatting changes, NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309442 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 21:52:21 +00:00
Easwaran Raman
0e9b0bc63d [Inliner] Do not apply any bonus for cold callsites.
Summary:
Inlining threshold is increased by application of bonuses when the
callee has a single reachable basic block or is rich in vector
instructions. Similarly, inlining cost is reduced by applying a large
bonus when the last call to a static function is considered for
inlining. This patch disables the application of these bonuses when the
callsite or the callee is cold. The intention here is to prevent a large
cold callsite from being inlined to a non-cold caller that could prevent
the caller from being inlined. This is especially important when the
cold callsite is a last call to a static since the associated bonus is
very high.

Reviewers: chandlerc, davidxl

Subscribers: danielcdh, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309441 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 21:47:36 +00:00
Adrian Prantl
0521b1a7f6 Remove the unused dbg.value offset from SelectionDAG (NFC)
Followup to r309426.
rdar://problem/33580047

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309436 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 21:27:35 +00:00
Reid Kleckner
954b684b7f [lit] Use a %{python} substitution to avoid relying on python being on PATH
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309434 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 21:13:47 +00:00
Reid Kleckner
6cb6f95df4 [lit] Remove stale test inputs before running check-lit
This should fix googletest-format test failures on the clang modules
buildbots, which have a stale copy of the OneTest script in the build
directory.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309432 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 21:00:57 +00:00
Adrian Prantl
abecca79fb Reword sentence in LangRef
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309431 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 20:44:29 +00:00
Adrian Prantl
5d0334a48c Remove the obsolete offset parameter from @llvm.dbg.value
There is no situation where this rarely-used argument cannot be
substituted with a DIExpression and removing it allows us to simplify
the DWARF backend. Note that this patch does not yet remove any of
the newly dead code.

rdar://problem/33580047
Differential Revision: https://reviews.llvm.org/D35951

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309426 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 20:21:02 +00:00
Alexey Bataev
2976ab9c15 [SLP] Allow vectorization of the instruction from the same basic blocks only, NFC.
Summary:
After some changes in SLP vectorizer we missed some additional checks to
limit the instructions for vectorization. We should not perform analysis
of the instructions if the parent of instruction is not the same as the
parent of the first instruction in the tree or it was analyzed already.

Subscribers: mzolotukhin

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309425 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 20:11:16 +00:00
Reid Kleckner
71a1ea82c0 Fix conditional tail call branch folding when both edges are the same
The conditional tail call logic did the wrong thing when both
destinations of a conditional branch were the same:

BB#1: derived from LLVM BB %entry
    Live Ins: %EFLAGS
    Predecessors according to CFG: BB#0
        JE_1 <BB#5>, %EFLAGS<imp-use,kill>
        JMP_1 <BB#5>

BB#5: derived from LLVM BB %sw.epilog
    Predecessors according to CFG: BB#1
        TCRETURNdi64 <ga:@mergeable_conditional_tailcall>, 0, ...

We would fold the JE_1 to a TCRETURNdi64cc, and then remove our BB#5
successor. Then BB#5 would be deleted as it had no predecessors, leaving
a dangling "JMP_1 <BB#5>" reference behind to cause assertions later.

This patch checks that both conditional branch destinations are
different before doing the transform. The standard branch folding logic
is able to remove both the JMP_1 and the JE_1, and for my test case we
end up forming a better conditional tail call later.

Fixes PR33980

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309422 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 19:48:40 +00:00
Matt Arsenault
69aaec6591 AMDGPU: Look through a bitcast user of an out argument
This allows handling of a lot more of the interesting
cases in Blender. Most of the large functions unlikely
to be inlined have this pattern.

This is a special case for what clang emits for OpenCL 3
element vectors. Annoyingly, these are emitted as
<3 x elt>* pointers, but accessed as <4 x elt>* operations.
This also needs to handle cases where a struct containing
a single vector is used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309419 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 19:06:16 +00:00
Chad Rosier
c1d5445ac5 [Value Tracking] Refactor icmp comparison logic into helper. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309417 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 18:47:43 +00:00
Matt Arsenault
acac0ef9e7 AMDGPU: Add pass to replace out arguments
It is better to return arguments directly in registers
if we are making a call rather than introducing expensive
stack usage. In one of sample compile from one of
Blender's many kernel variants, this fires on about
~20 different functions. Future improvements may be to
recognize simple cases where the pointer is indexing a small
array. This also fails when the store to the out argument
is in a separate block from the return, which happens in
a few of the Blender functions. This should also probably
be using MemorySSA which might help with that.

I'm not sure this is correct as a FunctionPass, but
MemoryDependenceAnalysis seems to not work with
a ModulePass.

I'm also not sure where it should run.I think it should
run  before DeadArgumentElimination, so maybe either
EP_CGSCCOptimizerLate or EP_ScalarOptimizerLate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309416 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 18:40:05 +00:00
Hiroshi Yamauchi
5398f502a2 [LVI] Constant-propagate a zero extension of the switch condition value through case edges
Summary:
LazyValueInfo currently computes the constant value of the switch condition through case edges, which allows the constant value to be propagated through the case edges.

But we have seen a case where a zero-extended value of the switch condition is used past case edges for which the constant propagation doesn't occur.

This patch adds a small logic to handle such a case in getEdgeValueLocal().

This is motivated by the Python 2.7 eval loop in PyEval_EvalFrameEx() where the lack of the constant propagation causes longer live ranges and more spill code than necessary.

With this patch, we see that the code size of PyEval_EvalFrameEx() decreases by ~5.4% and a performance test improves by ~4.6%.




Reviewers: wmi, dberlin, sanjoy

Reviewed By: sanjoy

Subscribers: davide, davidxl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@309415 91177308-0d34-0410-b5e6-96231b3b80d8
2017-07-28 18:35:25 +00:00