llvm-project/llvm/lib
Piotr Padlewski c63b492bcd Simplify recursive launder.invariant.group and strip
Summary:
This patch is crucial for proving equality laundered/stripped
pointers. eg:

  bool foo(A *a) {
    return a == std::launder(a);
  }

Clang with -fstrict-vtable-pointers will emit something like:

    define dso_local zeroext i1 @_Z3fooP1A(%struct.A* %a) {
    entry:
      %c = bitcast %struct.A* %a to i8*
      %call = tail call i8* @llvm.launder.invariant.group.p0i8(i8* %c)
      %0 = bitcast %struct.A* %a to i8*
      %1 = tail call i8* @llvm.strip.invariant.group.p0i8(i8* %0)
      %2 = tail call i8* @llvm.strip.invariant.group.p0i8(i8* %call)
      %cmp = icmp eq i8* %1, %2
      ret i1 %cmp
    }

and because %2 can be replaced with @llvm.strip.invariant.group(%0)
and that %2 and %1 will produce the same value (because strip is readnone)
we can replace compare with true.

Reviewers: rsmith, hfinkel, majnemer, amharc, kuhar

Subscribers: llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D47423

llvm-svn: 336963
2018-07-12 23:55:20 +00:00
..
Analysis [InstCombine] Simplify isKnownNegation 2018-07-12 22:56:23 +00:00
AsmParser [AsmParser] Fix inconsistent declaration parameter name 2018-07-12 02:03:53 +00:00
BinaryFormat [WebAssembly] Move toString helpers to BinaryFormat 2018-05-14 22:42:07 +00:00
Bitcode [BitcodeReader] Infer the correct runtime preemption for GlobalValue 2018-07-09 16:52:05 +00:00
CodeGen Revert "(HEAD -> master, origin/master, arcpatch-D37582) CodeGen: Remove pipeline dependencies on StackProtector; NFC" 2018-07-12 19:27:01 +00:00
DebugInfo [DebugInfo] Fix getPreviousSibling after r336823 2018-07-11 19:09:37 +00:00
Demangle [demangler] Avoid alignment warning 2018-07-05 06:22:39 +00:00
ExecutionEngine Fix few typos in comments (write access test commit) 2018-07-12 06:41:41 +00:00
FuzzMutate [llvm-opt-fuzzer] Add irce to the fuzzing options 2018-03-20 11:32:13 +00:00
Fuzzer
IR [ThinLTO] Escape module paths when printing 2018-07-12 14:40:21 +00:00
IRReader LLParser: add an argument for overriding data layout and do not check alloca addr space 2018-01-30 22:32:39 +00:00
LTO [ThinLTO] Use std::map to get determistic imports files 2018-07-10 20:06:04 +00:00
LineEditor
Linker IRMover: Account for matching types present across modules 2018-06-20 16:50:56 +00:00
MC [DWARF v5] Generate range list tables into the .debug_rnglists section. No support for split DWARF 2018-07-12 18:18:21 +00:00
Object [llvm-readobj] Add -hex-dump (-x) option 2018-07-11 10:00:29 +00:00
ObjectYAML [llvm-readobj] Add experimental support for SHT_RELR sections 2018-06-28 21:07:34 +00:00
Option Re-revert "[Option] Fix PR37006 prefix choice in findNearest" 2018-05-19 16:21:01 +00:00
Passes [UnrollAndJam] New Unroll and Jam pass 2018-07-01 12:47:30 +00:00
ProfileData [NFC] Change sample profile format enum name SPF_Raw_Binary to SPF_Binary. 2018-06-12 05:53:49 +00:00
Support [Support] Harded JSON against invalid UTF-8. 2018-07-10 11:51:26 +00:00
TableGen [TableGen] Add missing std::moves to fix build failure. 2018-07-11 08:57:56 +00:00
Target [X86] Add AVX512 equivalents of some isel patterns so we get EVEX instructions. 2018-07-12 22:14:10 +00:00
Testing [LLVMTestingSupport] Add explicit linkage to LLVMSupport 2018-04-08 06:49:17 +00:00
ToolDrivers [COFF] Improve correctness of def parsing for GNU features 2018-05-09 09:21:53 +00:00
Transforms Simplify recursive launder.invariant.group and strip 2018-07-12 23:55:20 +00:00
WindowsManifest Convert line endings of lib/WindowsManifest/CMakeLists.txt to unix. 2018-04-07 04:28:08 +00:00
XRay [XRay] clarify error messages when parsing broken traces 2018-01-30 13:41:34 +00:00
CMakeLists.txt
LLVMBuild.txt