llvm-project/llvm/lib/CodeGen/GlobalISel
Jessica Paquette 02187ed45a [GlobalISel] Combine G_SELECTs of the form (cond ? x : x) into x
When we find something like this:

```
%a:_(s32) = G_SOMETHING ...
...
%select:_(s32) = G_SELECT %cond(s1), %a, %a
```

We can remove the select and just replace it entirely with `%a` because it's
always going to result in `%a`.

Same if we have

```
%select:_(s32) = G_SELECT %cond(s1), %a, %b
```

where we can deduce that `%a == %b`.

This implements the following cases:

- `%select:_(s32) = G_SELECT %cond(s1), %a, %a` -> `%a`

- `%select:_(s32) = G_SELECT %cond(s1), %a, %some_copy_from_a` -> `%a`

- `%select:_(s32) = G_SELECT %cond(s1), %a, %b` -> `%a` when `%a` and `%b`
   are defined by identical instructions

This gives a few minor code size improvements on CTMark at -O3 for AArch64.

Differential Revision: https://reviews.llvm.org/D76523
2020-03-23 16:46:03 -07:00
..
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
CSEInfo.cpp [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE 2020-02-18 14:54:57 -08:00
CSEMIRBuilder.cpp [CodeGen] Make use of MachineInstrBuilder::getReg 2020-01-23 13:38:13 +00:00
CallLowering.cpp [GlobalISel][CallLowering] Use stripPointerCasts(). 2020-02-10 15:43:57 -08:00
Combiner.cpp [gicombiner] Add the run-time rule disable option 2019-10-17 00:37:04 +00:00
CombinerHelper.cpp [GlobalISel] Combine G_SELECTs of the form (cond ? x : x) into x 2020-03-23 16:46:03 -07:00
GISelChangeObserver.cpp [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE 2020-02-18 14:54:57 -08:00
GISelKnownBits.cpp GlobalISel: Add computeKnownBitsForTargetInstr 2020-03-23 15:02:30 -04:00
GlobalISel.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
IRTranslator.cpp [GlobalISel] Add generic opcodes for saturating add/subtract 2020-03-23 15:16:45 +00:00
InstructionSelect.cpp [ARM64] Debug info for structure argument missing DW_AT_location 2020-01-29 10:56:23 +01:00
InstructionSelector.cpp GlobalISel: Remove unused function argument 2020-02-14 15:57:39 -08:00
LLVMBuild.txt Make GlobalISel depend on SelectionDAG after D63169 2019-06-22 01:30:17 +00:00
LegalityPredicates.cpp GlobalISel: Add alignment to LegalityQuery MMOs 2019-02-14 22:41:09 +00:00
LegalizeMutations.cpp GlobalISel: Try to make legalize rules more useful for vectors 2019-02-07 17:25:51 +00:00
Legalizer.cpp [GlobalISel]: Fix some non determinism exposed in CSE due to not notifying observers about mutations + add verification for CSE 2020-02-18 14:54:57 -08:00
LegalizerHelper.cpp [GlobalISel] support widen unmerge if WideTy > SrcTy 2020-03-23 09:16:45 +01:00
LegalizerInfo.cpp GlobalISel: Add observer argument to legalizeIntrinsic 2020-01-29 18:33:45 -05:00
Localizer.cpp Revert "Revert "[GlobalISel][Localizer] Enable intra-block localization of already-local uses."" 2020-03-06 21:35:08 -08:00
MachineIRBuilder.cpp [GlobalISel] Add generic opcodes for saturating add/subtract 2020-03-23 15:16:45 +00:00
RegBankSelect.cpp GlobalISel: Fix naming variables "brank" instead of "bank" 2019-12-24 10:36:54 -05:00
RegisterBank.cpp Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes" 2020-03-20 11:02:50 +01:00
RegisterBankInfo.cpp Revert "[TableGen][GlobalISel] Account for HwMode in RegisterBank register sizes" 2020-03-20 11:02:50 +01:00
Utils.cpp GlobalISel: Move some legalizer functions to utils 2020-03-04 16:40:00 -05:00