summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/X86FoldTablesEmitter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* X86FoldTablesEmitter - fix static analyzer potential invalid iterator ↵Simon Pilgrim2019-11-061-3/+3
| | | | warning. NFCI.
* [X86] Make the X86FoldTablesEmitter functional again. Fix the spacing in the ↵Craig Topper2019-06-011-24/+37
| | | | | | | | | output to make it easier to diff. Fix a few other formatting issues in the manual table. And remove some old FIXMEs. llvm-svn: 362287
* [X86] Add ADD8ri_DB and ADD8rr_DB to the autogenerated load folding table.Craig Topper2019-03-181-0/+3
| | | | | | | | | These were added in r355423. We only use the autogenerated table to assist with the maintenance of the manual table. These entries are alreayd in the manual table. llvm-svn: 356357
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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. llvm-svn: 351636
* [X86] More additions to the load folding tables based on the autogenerated ↵Craig Topper2018-06-161-4/+6
| | | | | | | | tables. Including more additions for NotMemoryFoldable to remove some entries from the autogenerated table. llvm-svn: 334898
* [X86] Mark all instructions that have masked store semantics with ↵Craig Topper2018-06-131-16/+2
| | | | | | | | NotMemoryFoldable. Remove dependency on SchedRW from memory table autogenerator. Previously we were whitelisting in instructions based on their SchedRW value. With the masked store instructions explicitly removed via NotMemoryFoldable, we don't seem to need this check anymore. llvm-svn: 334563
* [X86] Don't add stores to the autogenerated load folding tables if the ↵Craig Topper2018-06-121-1/+2
| | | | | | | | register and memory operands have different widths. This can cause the amount of the memory written to be changed which would be bad. llvm-svn: 334480
* [X86] Update folding table generator to properly detect RMW arithmetic ↵Craig Topper2018-06-121-2/+4
| | | | | | | | | | instructions. The RMW instructions are detected by reading the SchedRW data, but the RMW instructions have had their SchedRW changed in recent months. This broke the expectation. We probably should fix this to use the mayLoad/mayStore flags if possible. llvm-svn: 334478
* [X86] Enforce agreement of AdSize field when autogenerating load folding ↵Craig Topper2018-06-121-0/+1
| | | | | | table entries. llvm-svn: 334473
* X86FoldTableEntry - avoid unnecessary std::string creation. NFCI.Simon Pilgrim2018-04-111-3/+3
| | | | llvm-svn: 329860
* Fix a bunch of typoes. NFCFangrui Song2018-03-301-1/+1
| | | | llvm-svn: 328907
* [X86] Added support for nocf_check attribute for indirect Branch TrackingOren Ben Simhon2018-03-171-0/+2
| | | | | | | | | | | | | | | X86 Supports Indirect Branch Tracking (IBT) as part of Control-Flow Enforcement Technology (CET). IBT instruments ENDBR instructions used to specify valid targets of indirect call / jmp. The `nocf_check` attribute has two roles in the context of X86 IBT technology: 1. Appertains to a function - do not add ENDBR instruction at the beginning of the function. 2. Appertains to a function pointer - do not track the target function of this pointer by adding nocf_check prefix to the indirect-call instruction. This patch implements `nocf_check` context for Indirect Branch Tracking. It also auto generates `nocf_check` prefixes before indirect branchs to jump tables that are guarded by range checks. Differential Revision: https://reviews.llvm.org/D41879 llvm-svn: 327767
* [X86] Don't put any EVEX_B instructions in the tablegen generated load ↵Craig Topper2018-01-071-2/+3
| | | | | | | | folding tables. EVEX_B means different things for memory and register forms. The instructions should not be considered equivalent. llvm-svn: 321954
* Remove redundant includes from utils/TableGen.Michael Zolotukhin2017-12-131-1/+0
| | | | llvm-svn: 320632
* Fix warnings discovered by rL317076. [-Wunused-private-field]NAKAMURA Takumi2017-11-011-2/+1
| | | | llvm-svn: 317091
* Fix LLDB build for Android.Eugene Zemtsov2017-10-091-1/+1
| | | | | | | | Currently libstdc++ on Android doesn't support std::to_string(). Differential Revision: https://reviews.llvm.org/D38701 llvm-svn: 315246
* [X86][TableGen] Recommitting the X86 memory folding tables TableGen backend ↵Ayman Musa2017-10-081-0/+663
| | | | | | | | | | | | | | | | | | | | | | | | | | while disabling it by default. After the original commit ([[ https://reviews.llvm.org/rL304088 | rL304088 ]]) was reverted, a discussion in llvm-dev was opened on 'how to accomplish this task'. In the discussion we concluded that the best way to achieve our goal (which is to automate the folding tables and remove the manually maintained tables) is: # Commit the tablegen backend disabled by default. # Proceed with an incremental updating of the manual tables - while checking the validity of each added entry. # Repeat previous step until we reach a state where the generated and the manual tables are identical. Then we can safely remove the manual tables and include the generated tables instead. # Schedule periodical (1 week/2 weeks/1 month) runs of the pass: - if changes appear (new entries): - make sure the entries are legal - If they are not, mark them as illegal to folding - Commit the changes (if there are any). CMake flag added for this purpose is "X86_GEN_FOLD_TABLES". Building with this flags will run the pass and emit the X86GenFoldTables.inc file under build/lib/Target/X86/ directory which is a good reference for any developer who wants to take part in the effort of completing the current folding tables. Differential Revision: https://reviews.llvm.org/D38028 llvm-svn: 315173
* [x86] Revert the X86FoldTablesEmitter due to more miscompiles.Chandler Carruth2017-06-061-732/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In testing, we've found yet another miscompile caused by the new tables. And this one is even less clear how to fix (we could teach it to fold a 16-bit load instead of the 32-bit load it wants, or block folding entirely). Also, the approach to excluding instructions seems increasingly to not scale well. I have left a more detailed analysis on the review log for the original patch (https://reviews.llvm.org/D32684) along with suggested path forward. I will land an additional test case that I wrote which covers the code that was miscompiling (folding into the output of `pextrw`) in a subsequent commit to keep this a pure revert. For each commit reverted here, I've restricted the revert to the non-test code touching the x86 fold table emission until the last commit where I did revert the test updates. This means the *new* test cases added for `insertps` and `xchg` remain untouched (and continue to pass). Reverted commits: r304540: [X86] Don't fold into memory operands into insertps in the ... r304347: [TableGen] Adapt more places to getValueAsString now ... r304163: [X86] Don't fold away the memory operand of an xchg. r304123: Don't capture a temporary std::string in a StringRef. r304122: Resubmit "[X86] Adding new LLVM TableGen backend that ..." Original commit was in r304088, and after a string of fixes was reverted previously in r304121 to fix build bots, and then re-landed in r304122. llvm-svn: 304762
* [X86] Don't fold into memory operands into insertps in the generated folding ↵Benjamin Kramer2017-06-021-0/+5
| | | | | | | | | | | | tables. insertps behaves differently, the register form selects from an input register based on the immediate operand while the memory form just loads the given address. We have custom code to change the immediate in cases where that's legal, so completely remove insertps from the generated tables. llvm-svn: 304540
* [TableGen] Adapt more places to getValueAsString now returning a StringRef ↵Craig Topper2017-05-311-2/+2
| | | | | | instead of a std::string. llvm-svn: 304347
* [X86] Don't fold away the memory operand of an xchg.Benjamin Kramer2017-05-291-1/+8
| | | | | | | | | | xchg with a mem operand has different locking semantics. If we unfold it into a xchg r,r we will loose the implicit lock. Likewise we never want to fold a register xchg into a memory one as it would be a lot slower. This triggers during LLVM selfhost. llvm-svn: 304163
* Don't capture a temporary std::string in a StringRef.Zachary Turner2017-05-291-1/+1
| | | | | | This fixes the breakages in llvm-tblgen. llvm-svn: 304123
* Resubmit "[X86] Adding new LLVM TableGen backend that generates the X86 ↵Zachary Turner2017-05-291-0/+720
| | | | | | | | | | | | | backend memory folding tables." This was reverted due to buildbot breakages and I was not familiar with this code to investigate it. But while trying to get a useful backtrace for the author, it turns out the fix was very obvious. Resubmitting this patch as is, and will submit the fix in a followup so that the fix is not hidden in the larger CL. llvm-svn: 304122
* Revert "[X86] Adding new LLVM TableGen backend that generates the X86 ↵Zachary Turner2017-05-291-720/+0
| | | | | | | | | | | | | backend memory folding tables." This reverts commit 28cb1003507f287726f43c771024a1dc102c45fe as well as all subsequent followups. llvm-tblgen currently segfaults with this change, and it seems it has been broken on the bots all day with no fixes in preparation. See, for example: http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/ llvm-svn: 304121
* [TableGen][X86] Fix formatting I accidentally messed up in r304099. NFCCraig Topper2017-05-281-1/+1
| | | | llvm-svn: 304115
* [TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFCCraig Topper2017-05-281-1/+2
| | | | llvm-svn: 304100
* [TableGen][X86] Mark a couple global tables as const. NFCCraig Topper2017-05-281-2/+2
| | | | llvm-svn: 304099
* [TableGen][X86] Improve formatting of the fold table output by indenting the ↵Craig Topper2017-05-281-2/+2
| | | | | | body of the table and adding blank lines between tables. NFC llvm-svn: 304098
* [TableGen][X86] Add an llvm_unreachable to a switch so we get an error if we ↵Craig Topper2017-05-281-0/+1
| | | | | | need expansion in the future. llvm-svn: 304097
* [TableGen][X86] Remove unnecessary std::string creations. NFCCraig Topper2017-05-281-4/+4
| | | | llvm-svn: 304096
* [TableGen][X86] Replace a global std::vector with a regular array. ↵Craig Topper2017-05-281-2/+2
| | | | | | llvm::find works on arrays, just need to use std::end to check the result. llvm-svn: 304095
* [TableGen][X86] getValueAsString returns a std::string not a StringRef. ↵Craig Topper2017-05-281-1/+1
| | | | | | Capture it that way to avoid a StringRef to a temporary. llvm-svn: 304093
* [X86] Adding new LLVM TableGen backend that generates the X86 backend memory ↵Ayman Musa2017-05-281-0/+718
folding tables. X86 backend holds huge tables in order to map between the register and memory forms of each instruction. This TableGen Backend automatically generated all these tables with the appropriate flags for each entry. Differential Revision: https://reviews.llvm.org/D32684 llvm-svn: 304088
OpenPOWER on IntegriCloud