1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/lib
Drew Wock 161d927dda [SeparateConstOffsetFromGEP] Fix: sext(a) + sext(b) -> sext(a + b) matches add and sub instructions with one another
During the SeparateConstOffsetFromGEP pass, signed extensions are distributed
to the values that feed into them and then later recombined. The recombination
stage is somewhat problematic- it doesn't differ add and sub instructions
from another when matching the sext(a) +/- sext(b) -> sext(a +/- b) pattern
in some instances.

An example- the IR contains:
%unextendedA
%unextendedB
%subuAuB = unextendedA - unextendedB
%extA = extend A
%extB = extend B
%addeAeB = extA + extB

The problematic optimization will transform that into:

%unextendedA
%unextendedB
%subuAuB = unextendedA - unextendedB
%extA = extend A
%extB = extend B
%addeAeB = extend subuAuB ; Obviously not semantically equivalent to the IR input.

This patch fixes that.

Patch by Drew Wock <drew.wock@sas.com>
Differential Revision: https://reviews.llvm.org/D65967
2020-01-17 12:22:52 -05:00
..
Analysis PointerLikeTypeTraits: Standardize NumLowBitsAvailable on static constexpr rather than anonymous enum 2020-01-16 15:30:50 -08:00
AsmParser [ThinLTO] Always import constants 2020-01-15 19:29:01 +03:00
BinaryFormat DWARFDebugLine.cpp: Format unknown line number standard opcodes 2020-01-15 10:45:50 -05:00
Bitcode [ThinLTO] Always import constants 2020-01-15 19:29:01 +03:00
Bitstream [Bitstream] Delete skipAbbreviatedField which duplicates readAbbreviatedField 2019-12-25 18:55:02 -08:00
CodeGen [SelectionDAG] ComputeKnownBits - assert we're computing the 0'th (difference) result for the SUB/SUBC cases 2020-01-17 13:53:57 +00:00
DebugInfo DWARFDebugLine.cpp: Format unknown line number standard opcodes 2020-01-15 10:45:50 -05:00
Demangle Revert "Add some missing includes to MicrosoftDemangle.cpp (PR44217)" 2019-12-04 11:10:07 -08:00
DWARFLinker [Dsymutil][Debuginfo][NFC] #3 Refactor dsymutil to separate DWARF optimizing part. 2020-01-13 23:33:25 +03:00
ExecutionEngine [ORC] Set setCloneToNewContextOnEmit on LLJIT's transform layer when needed. 2020-01-15 10:22:57 -08:00
Frontend [OpenMP] Use the OpenMPIRBuilder for omp parallel 2019-12-30 13:57:13 -06:00
Fuzzer
FuzzMutate [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
IR [IR] fix Constant::isElementWiseEqual() to allow for all undef elements compare 2020-01-17 08:31:16 -05:00
IRReader [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
LineEditor [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Linker [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
LTO remove an include that's unused after r347592 2020-01-16 12:49:54 -05:00
MC [AsmParser] Make generic directives and aliases case insensitive. 2020-01-17 11:02:56 +00:00
MCA [NFC] Fixes -Wrange-loop-analysis warnings 2020-01-01 20:01:37 +01:00
Object [MIPS][ELF] Use PC-relative relocations in .eh_frame when possible 2020-01-13 14:14:03 +00:00
ObjectYAML [Hexagon] Add ELF flags for Hexagon v66 to ELFYAML.cpp 2020-01-16 15:01:00 -06:00
Option [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Passes [GVN] add GVN parameters parsing to new pass manager 2020-01-16 23:53:46 +03:00
ProfileData [NFC] Fix trivial typos in comments 2020-01-06 10:50:26 +00:00
Remarks [Remarks] Allow empty temporary remark files 2019-11-22 15:58:12 -08:00
Support Revert "[Support] make report_fatal_error abort instead of exit" 2020-01-15 17:52:25 -08:00
TableGen [TableGen] Introduce an if/then/else statement. 2020-01-14 10:19:53 +00:00
Target [AArch64] Make AArch64 specific assembly directives case insensitive 2020-01-17 16:16:18 +00:00
Testing
TextAPI [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
ToolDrivers [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
Transforms [SeparateConstOffsetFromGEP] Fix: sext(a) + sext(b) -> sext(a + b) matches add and sub instructions with one another 2020-01-17 12:22:52 -05:00
WindowsManifest Revert "Temporarily revert "build: avoid hardcoding the libxml2 library name"" 2019-12-03 09:27:14 -08:00
XRay [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CMakeLists.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00
LLVMBuild.txt [Dsymutil][Debuginfo][NFC] Reland: Refactor dsymutil to separate DWARF optimizing part. #2. 2020-01-08 14:15:31 +03:00