| #
adf5e0d9 |
| 25-Sep-2018 |
Mikael Holmen <[email protected]> |
Use TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness
Summary: For the loop that used MCRegAliasIterator this should be NFC.
For the loop that previously used MCSubRegIterator we sho
Use TRI->regsOverlap() in MachineBasicBlock::computeRegisterLiveness
Summary: For the loop that used MCRegAliasIterator this should be NFC.
For the loop that previously used MCSubRegIterator we should now detect more cases where the register is actually live out that we previously missed.
Reviewers: MatzeB, arsenm
Reviewed By: MatzeB
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D52410
llvm-svn: 342944
show more ...
|
| #
e5909431 |
| 20-Sep-2018 |
Aditya Nandakumar <[email protected]> |
Add the ability to register callbacks for removal and insertion of MachineInstrs
https://reviews.llvm.org/D52127
This patch adds the ability to watch for insertions/deletions of MachineInstructions
Add the ability to register callbacks for removal and insertion of MachineInstrs
https://reviews.llvm.org/D52127
This patch adds the ability to watch for insertions/deletions of MachineInstructions similar to MachineRegisterInfo.
llvm-svn: 342696
show more ...
|
|
Revision tags: llvmorg-7.0.0, llvmorg-7.0.0-rc3 |
|
| #
f2edba8e |
| 30-Aug-2018 |
Matt Arsenault <[email protected]> |
Don't count debug instructions towards neighborhood count
In computeRegisterLiveness, the max instructions to search was counting dbg_value instructions, which could potentially cause an observable
Don't count debug instructions towards neighborhood count
In computeRegisterLiveness, the max instructions to search was counting dbg_value instructions, which could potentially cause an observable codegen change from the presence of debug info.
llvm-svn: 341028
show more ...
|
| #
015a147c |
| 30-Aug-2018 |
Matt Arsenault <[email protected]> |
CodeGen: Make computeRegisterLiveness search forward first
If there is an unused def, this would previously report that the register was live. Check for uses first so that it is reported as dead if
CodeGen: Make computeRegisterLiveness search forward first
If there is an unused def, this would previously report that the register was live. Check for uses first so that it is reported as dead if never used.
llvm-svn: 341027
show more ...
|
| #
eba9e9a2 |
| 30-Aug-2018 |
Matt Arsenault <[email protected]> |
CodeGen: Make computeRegisterLiveness consider successors
If the end of the block is reached during the scan, check the live ins of the successors. This was already done in the other direction if th
CodeGen: Make computeRegisterLiveness consider successors
If the end of the block is reached during the scan, check the live ins of the successors. This was already done in the other direction if the block entry was reached.
llvm-svn: 341026
show more ...
|
|
Revision tags: llvmorg-7.0.0-rc2, llvmorg-7.0.0-rc1 |
|
| #
90358e1e |
| 13-Jul-2018 |
Chandler Carruth <[email protected]> |
[SLH] Introduce a new pass to do Speculative Load Hardening to mitigate Spectre variant #1 for x86.
There is a lengthy, detailed RFC thread on llvm-dev which discusses the high level issues. High le
[SLH] Introduce a new pass to do Speculative Load Hardening to mitigate Spectre variant #1 for x86.
There is a lengthy, detailed RFC thread on llvm-dev which discusses the high level issues. High level discussion is probably best there.
I've split the design document out of this patch and will land it separately once I update it to reflect the latest edits and updates to the Google doc used in the RFC thread.
This patch is really just an initial step. It isn't quite ready for prime time and is only exposed via debugging flags. It has two major limitations currently: 1) It only supports x86-64, and only certain ABIs. Many assumptions are currently hard-coded and need to be factored out of the code here. 2) It doesn't include any options for more fine-grained control, either of which control flow edges are significant or which loads are important to be hardened. 3) The code is still quite rough and the testing lighter than I'd like.
However, this is enough for people to begin using. I have had numerous requests from people to be able to experiment with this patch to understand the trade-offs it presents and how to use it. We would also like to encourage work to similar effect in other toolchains.
The ARM folks are actively developing a system based on this for AArch64. We hope to merge this with their efforts when both are far enough along. But we also don't want to block making this available on that effort.
Many thanks to the *numerous* people who helped along the way here. For this patch in particular, both Eric and Craig did a ton of review to even have confidence in it as an early, rough cut at this functionality.
Differential Revision: https://reviews.llvm.org/D44824
llvm-svn: 336990
show more ...
|
|
Revision tags: llvmorg-6.0.1, llvmorg-6.0.1-rc3, llvmorg-6.0.1-rc2 |
|
| #
d34e60ca |
| 14-May-2018 |
Nicola Zaghen <[email protected]> |
Rename DEBUG macro to LLVM_DEBUG. The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/
Rename DEBUG macro to LLVM_DEBUG. The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM - Manual change to APInt - Manually chage DOCS as regex doesn't match it.
In the transition period the DEBUG() macro is still present and aliased to the LLVM_DEBUG() one.
Differential Revision: https://reviews.llvm.org/D43624
llvm-svn: 332240
show more ...
|
| #
801bf7eb |
| 09-May-2018 |
Shiva Chen <[email protected]> |
[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 Mac
[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.
llvm-svn: 331844
show more ...
|
| #
432a3883 |
| 30-Apr-2018 |
Nico Weber <[email protected]> |
IWYU for llvm-config.h in llvm, additions.
See r331124 for how I made a list of files missing the include. I then ran this Python script:
for f in open('filelist.txt'): f = f.strip()
IWYU for llvm-config.h in llvm, additions.
See r331124 for how I made a list of files missing the include. I then ran this Python script:
for f in open('filelist.txt'): f = f.strip() fl = open(f).readlines()
found = False for i in xrange(len(fl)): p = '#include "llvm/' if not fl[i].startswith(p): continue if fl[i][len(p):] > 'Config': fl.insert(i, '#include "llvm/Config/llvm-config.h"\n') found = True break if not found: print 'not found', f else: open(f, 'w').write(''.join(fl))
and then looked through everything with `svn diff | diffstat -l | xargs -n 1000 gvim -p` and tried to fix include ordering and whatnot.
No intended behavior change.
llvm-svn: 331184
show more ...
|
|
Revision tags: llvmorg-6.0.1-rc1 |
|
| #
71a4c0ca |
| 10-Apr-2018 |
Krzysztof Parzyszek <[email protected]> |
[CodeGen] Fix printing bundles in MIR output
Delay printing the newline until after the opening bracket was printed, e.g. BUNDLE implicit-def $r1, implicit-def $r21, implicit $r1 { renamable $
[CodeGen] Fix printing bundles in MIR output
Delay printing the newline until after the opening bracket was printed, e.g. BUNDLE implicit-def $r1, implicit-def $r21, implicit $r1 { renamable $r1 = S2_asr_i_r renamable $r1, 1 renamable $r21 = A2_tfrsi 0 } instead of BUNDLE implicit-def $r1, implicit-def $r21, implicit $r1 { renamable $r1 = S2_asr_i_r renamable $r1, 1 renamable $r21 = A2_tfrsi 0 }
llvm-svn: 329719
show more ...
|
| #
19618fc6 |
| 10-Apr-2018 |
Chandler Carruth <[email protected]> |
[x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues.
The key idea is to lower COPY nodes populating EFLAGS by scanning the uses of EFLAGS and introducing dedicated
[x86] Introduce a pass to begin more systematically fixing PR36028 and similar issues.
The key idea is to lower COPY nodes populating EFLAGS by scanning the uses of EFLAGS and introducing dedicated code to preserve the necessary state in a GPR. In the vast majority of cases, these uses are cmovCC and jCC instructions. For such cases, we can very easily save and restore the necessary information by simply inserting a setCC into a GPR where the original flags are live, and then testing that GPR directly to feed the cmov or conditional branch.
However, things are a bit more tricky if arithmetic is using the flags. This patch handles the vast majority of cases that seem to come up in practice: adc, adcx, adox, rcl, and rcr; all without taking advantage of partially preserved EFLAGS as LLVM doesn't currently model that at all.
There are a large number of operations that techinaclly observe EFLAGS currently but shouldn't in this case -- they typically are using DF. Currently, they will not be handled by this approach. However, I have never seen this issue come up in practice. It is already pretty rare to have these patterns come up in practical code with LLVM. I had to resort to writing MIR tests to cover most of the logic in this pass already. I suspect even with its current amount of coverage of arithmetic users of EFLAGS it will be a significant improvement over the current use of pushf/popf. It will also produce substantially faster code in most of the common patterns.
This patch also removes all of the old lowering for EFLAGS copies, and the hack that forced us to use a frame pointer when EFLAGS copies were found anywhere in a function so that the dynamic stack adjustment wasn't a problem. None of this is needed as we now lower all of these copies directly in MI and without require stack adjustments.
Lots of thanks to Reid who came up with several aspects of this approach, and Craig who helped me work out a couple of things tripping me up while working on this.
Differential Revision: https://reviews.llvm.org/D45146
llvm-svn: 329657
show more ...
|
| #
e92f0cfe |
| 06-Apr-2018 |
Mandeep Singh Grang <[email protected]> |
[CodeGen] Change std::sort to llvm::sort in response to r327219
Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-det
[CodeGen] Change std::sort to llvm::sort in response to r327219
Summary: r327219 added wrappers to std::sort which randomly shuffle the container before sorting. This will help in uncovering non-determinism caused due to undefined sorting order of objects having the same key.
To make use of that infrastructure we need to invoke llvm::sort instead of std::sort.
Note: This patch is one of a series of patches to replace *all* std::sort to llvm::sort. Refer the comments section in D44363 for a list of all the required patches.
Reviewers: bogner, rnk, MatzeB, RKSimon
Reviewed By: rnk
Subscribers: JDevlieghere, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D45133
llvm-svn: 329435
show more ...
|
|
Revision tags: llvmorg-5.0.2, llvmorg-5.0.2-rc2, llvmorg-5.0.2-rc1 |
|
| #
10b31358 |
| 15-Mar-2018 |
Derek Schuff <[email protected]> |
[WebAssembly] Add DebugLoc information to WebAssembly block and loop.
Patch by Yury Delendik Differential Revision: https://reviews.llvm.org/D44448
llvm-svn: 327673
|
|
Revision tags: llvmorg-6.0.0 |
|
| #
e4fae4d5 |
| 26-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Don't omit any redundant information in -debug output
In r322867, we introduced IsStandalone when printing MIR in -debug output. The default behaviour for that was:
1) If any of MBB, MI,
[CodeGen] Don't omit any redundant information in -debug output
In r322867, we introduced IsStandalone when printing MIR in -debug output. The default behaviour for that was:
1) If any of MBB, MI, or MO are -debug-printed separately, don't omit any redundant information.
2) When -debug-printing a MF entirely, don't print any redundant information.
3) When printing MIR, don't print any redundant information.
I'd like to change 2) to:
2) When -debug-printing a MF entirely, don't omit any redundant information.
Differential Revision: https://reviews.llvm.org/D43337
llvm-svn: 326094
show more ...
|
|
Revision tags: llvmorg-6.0.0-rc3 |
|
| #
7f0f8bb4 |
| 19-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Fix tests breaking after r325505
llvm-svn: 325512
|
| #
68ced40a |
| 19-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
Revert "[CodeGen] Move printing '\n' from MachineInstr::print to MachineBasicBlock::print"
This reverts commit r324681.
llvm-svn: 325505
|
| #
3fbbdf31 |
| 15-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Separate MBB metadata from instructions in -debug printing
Add an empty line after 'liveins:', 'successors:', or '; predecessors:', the one that ends up to be the last one.
llvm-svn: 3252
[CodeGen] Separate MBB metadata from instructions in -debug printing
Add an empty line after 'liveins:', 'successors:', or '; predecessors:', the one that ends up to be the last one.
llvm-svn: 325258
show more ...
|
| #
1e002a2b |
| 15-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Print irreducible loop header weight as a MIR comment
Prefix it with '; ' to make it more MIR-compatible.
llvm-svn: 325251
|
| #
afad84e6 |
| 14-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Print predecessors, successors, then liveins in -debug printing
Reorder them to match MIR.
Predecessors are only comments, and they're not usually printed in MIR.
llvm-svn: 325166
|
| #
f6ed795d |
| 13-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Print bundled instructions using the MIR syntax in -debug output
Old syntax:
BUNDLE implicit-def %r0, implicit-def %r1, implicit %r2 * %r0 = SOME_OP %r2 * %r1 = ANOTHER_OP internal %r0
N
[CodeGen] Print bundled instructions using the MIR syntax in -debug output
Old syntax:
BUNDLE implicit-def %r0, implicit-def %r1, implicit %r2 * %r0 = SOME_OP %r2 * %r1 = ANOTHER_OP internal %r0
New syntax:
BUNDLE implicit-def %r0, implicit-def %r1, implicit %r2 { %r0 = SOME_OP %r2 %r1 = ANOTHER_OP internal %r0 }
llvm-svn: 325032
show more ...
|
| #
33979ce3 |
| 09-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Print predecessors as MIR comments in -debug output
Make -debug MBB headers more copy-pastable into mir files.
llvm-svn: 324769
|
| #
fb7b14f7 |
| 09-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Unify the syntax of MBB liveins in MIR and -debug output
Instead of:
Live Ins: %r0 %r1
print:
liveins: %r0, %r1 llvm-svn: 324694
|
| #
7d3dde3c |
| 09-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Don't compute BranchProbability for MBB::print
Avoid re-computing BP only to print successor probabilities in -debug printing.
llvm-svn: 324690
|
| #
a37e0096 |
| 09-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Only print successors when the list is not empty
Follow-up of r324685.
llvm-svn: 324686
|
| #
39ec2e95 |
| 09-Feb-2018 |
Francis Visoiu Mistrih <[email protected]> |
[CodeGen] Unify the syntax of MBB successors in MIR and -debug output
Instead of:
Successors according to CFG: %bb.6(0x12492492 / 0x80000000 = 14.29%)
print:
successors: %bb.6(0x12492492); %bb.6(
[CodeGen] Unify the syntax of MBB successors in MIR and -debug output
Instead of:
Successors according to CFG: %bb.6(0x12492492 / 0x80000000 = 14.29%)
print:
successors: %bb.6(0x12492492); %bb.6(14.29%) llvm-svn: 324685
show more ...
|