1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/test
Simon Pilgrim e0937686e0 [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183) (REAPPLIED)
As discussed on PR50183, we already fold to prefer 'select-of-idx' vs 'select-of-gep':

define <4 x i32>* @select0a(<4 x i32>* %a0, i64 %a1, i1 %a2, i64 %a3) {
  %gep0 = getelementptr inbounds <4 x i32>, <4 x i32>* %a0, i64 %a1
  %gep1 = getelementptr inbounds <4 x i32>, <4 x i32>* %a0, i64 %a3
  %sel = select i1 %a2, <4 x i32>* %gep0, <4 x i32>* %gep1
  ret <4 x i32>* %sel
}
-->
define <4 x i32>* @select1a(<4 x i32>* %a0, i64 %a1, i1 %a2, i64 %a3) {
  %sel = select i1 %a2, i64 %a1, i64 %a3
  %gep = getelementptr inbounds <4 x i32>, <4 x i32>* %a0, i64 %sel
  ret <4 x i32>* %gep
}

This patch adds basic handling for the 'fallthrough' cases where the gep idx == 0 has been folded away to the base address:

define <4 x i32>* @select0(<4 x i32>* %a0, i64 %a1, i1 %a2) {
  %gep = getelementptr inbounds <4 x i32>, <4 x i32>* %a0, i64 %a1
  %sel = select i1 %a2, <4 x i32>* %a0, <4 x i32>* %gep
  ret <4 x i32>* %sel
}
-->
define <4 x i32>* @select1(<4 x i32>* %a0, i64 %a1, i1 %a2) {
  %sel = select i1 %a2, i64 0, i64 %a1
  %gep = getelementptr inbounds <4 x i32>, <4 x i32>* %a0, i64 %sel
  ret <4 x i32>* %gep
}

Reapplied with a fix for the bpf "-bpf-disable-avoid-speculation" tests

Differential Revision: https://reviews.llvm.org/D105901
2021-07-14 12:21:01 +01:00
..
Analysis [X86] Implement smarter instruction lowering for FP_TO_UINT from f32/f64 to i32/i64 and vXf32/vXf64 to vXi32 for SSE2 and AVX2 by using the exact semantic of the CVTTPS2SI instruction. 2021-07-14 12:03:49 +01:00
Assembler [remangleIntrinsicFunction] Detect and resolve name clash 2021-07-13 11:21:12 +02:00
Bindings
Bitcode Revert "[DebugInfo] Enforce implicit constraints on distinct MDNodes" 2021-07-02 15:57:07 -07:00
BugPoint
CodeGen [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183) (REAPPLIED) 2021-07-14 12:21:01 +01:00
DebugInfo [DebugInfo] Correctly update dbg.values with duplicated location ops 2021-07-14 11:17:24 +01:00
Demangle [Clang] Introduce Swift async calling convention. 2021-07-09 11:50:10 -07:00
Examples [Orc] At CBindings for LazyRexports 2021-07-01 21:52:05 +02:00
ExecutionEngine [JITLink][ELF] Move ELF section and symbol parsing into ELFLinkGraphBuilder. 2021-06-29 09:59:49 +10:00
Feature [FunctionAttrs] Force old pm in test so it doens't behave differently depending on the configuration setting for this flag 2021-04-09 11:46:19 +02:00
FileCheck
Instrumentation [DebugInfo] Correctly update dbg.values with duplicated location ops 2021-07-14 11:17:24 +01:00
Integer
JitListener Revert "[NFC] remove explicit default value for strboolattr attribute in tests" 2021-05-24 19:43:40 +02:00
Linker
LTO
MachineVerifier CodeGen: Print/parse LLTs in MachineMemOperands 2021-06-30 16:54:13 -04:00
MC [AArch64][SME] Add matrix register definitions and parsing support 2021-07-14 08:25:49 +00:00
Object [llvm-readobj] Switch command line parsing from llvm::cl to OptTable 2021-07-12 10:14:42 -07:00
ObjectYAML
Other [NewPM][SimpleLoopUnswitch] Add option to not trivially unswitch 2021-07-13 16:09:42 -07:00
SafepointIRVerifier
Support [llvm-readobj] Switch command line parsing from llvm::cl to OptTable 2021-07-12 10:14:42 -07:00
SymbolRewriter
TableGen [TableGen] Allow identical MnemonicAliases with no predicate 2021-06-30 10:53:39 +01:00
ThinLTO/X86 [CSSPGO] Do not import pseudo probe desc in thinLTO 2021-07-13 18:26:36 -07:00
tools [CSSPGO][llvm-profgen] Allow multiple executable load segments. 2021-07-13 18:22:24 -07:00
Transforms [InstCombine] Fold (select C, (gep Ptr, Idx), Ptr) -> (gep Ptr, (select C, Idx, 0)) (PR50183) (REAPPLIED) 2021-07-14 12:21:01 +01:00
Unit
Verifier [OpaquePtr] Support VecOfAnyPtrsToElt intrinsics 2021-07-01 20:35:33 +02:00
YAMLParser
.clang-format
CMakeLists.txt [Orc] At CBindings for LazyRexports 2021-07-01 21:52:05 +02:00
lit.cfg.py [Orc] At CBindings for LazyRexports 2021-07-01 21:52:05 +02:00
lit.site.cfg.py.in Make lit configs relocatable again after c747b7d1d9a 2021-06-22 15:27:32 -04:00
TestRunner.sh