[GISel]: Add GISelKnownBits analysis
authorAditya Nandakumar <aditya_nandakumar@apple.com>
Tue, 6 Aug 2019 17:18:29 +0000 (17:18 +0000)
committerAditya Nandakumar <aditya_nandakumar@apple.com>
Tue, 6 Aug 2019 17:18:29 +0000 (17:18 +0000)
commitc8ac029d0ae27b8fd392f216d471ba2730be7fd1
treecdbbd4ce7ecf2285af86068004b82f89ee5b0503
parent3a4d5ed232dc9f002045a7f89d3bc1f4be5e9e0c
[GISel]: Add GISelKnownBits analysis

https://reviews.llvm.org/D65698

This adds a KnownBits analysis pass for GISel. This was done as a
pass (compared to static functions) so that we can add other features
such as caching queries(within a pass and across passes) in the future.
This patch only adds the basic pass boiler plate, and implements a lazy
non caching knownbits implementation (ported from SelectionDAG). I've
also hooked up the AArch64PreLegalizerCombiner pass to use this - there
should be no compile time regression as the analysis is lazy.

llvm-svn: 368065
16 files changed:
llvm/include/llvm/CodeGen/GlobalISel/CombinerHelper.h
llvm/include/llvm/CodeGen/GlobalISel/GISelKnownBits.h [new file with mode: 0644]
llvm/include/llvm/CodeGen/TargetLowering.h
llvm/include/llvm/InitializePasses.h
llvm/lib/CodeGen/GlobalISel/CMakeLists.txt
llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp [new file with mode: 0644]
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/Target/AArch64/AArch64PreLegalizerCombiner.cpp
llvm/test/CodeGen/AArch64/GlobalISel/gisel-commandline-option.ll
llvm/unittests/CodeGen/GlobalISel/CMakeLists.txt
llvm/unittests/CodeGen/GlobalISel/CSETest.cpp
llvm/unittests/CodeGen/GlobalISel/GISelMITest.h
llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp [new file with mode: 0644]
llvm/unittests/CodeGen/GlobalISel/LegalizerHelperTest.cpp
llvm/unittests/CodeGen/GlobalISel/MachineIRBuilderTest.cpp