[all-commits] [llvm/llvm-project] 32b6e9: [DomTree] Accept Value as Def (NFC)
Nikita Popov via All-commits
all-commits at lists.llvm.org
Thu Oct 22 09:37:25 PDT 2020
Branch: refs/heads/master
Home: https://github.com/llvm/llvm-project
Commit: 32b6e9a450fff59690a3a7c828524c176d8b855e
https://github.com/llvm/llvm-project/commit/32b6e9a450fff59690a3a7c828524c176d8b855e
Author: Nikita Popov <nikita.ppv at gmail.com>
Date: 2020-10-22 (Thu, 22 Oct 2020)
Changed paths:
M llvm/include/llvm/IR/Dominators.h
M llvm/lib/IR/Dominators.cpp
M llvm/unittests/IR/DominatorTreeTest.cpp
Log Message:
-----------
[DomTree] Accept Value as Def (NFC)
Non-instruction defs like arguments, constants or global values
always dominate all instructions/uses inside the function. This
case currently needs to be treated separately by the caller, see
https://reviews.llvm.org/D89623#inline-832818 for an example.
This patch makes the dominator tree APIs accept a Value instead of
an Instruction and always returns true for the non-Instruction case.
A complication here is that BasicBlocks are also Values. For that
reason we can't support the dominates(Value *, BasicBlock *)
variant, as it would conflict with dominates(BasicBlock *, BasicBlock *),
which has different semantics. For the other two APIs we assert
that the passed value is not a BasicBlock.
Differential Revision: https://reviews.llvm.org/D89632
More information about the All-commits
mailing list