mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-12-23 12:08:25 +00:00
Teach ValueTracking how to look through GlobalAliases. GlobalAliases are
not folded in the constant folder because the constant folder doesn't simplify ConstantExpr operands. llvm-svn: 81864
This commit is contained in:
parent
ccdb00720e
commit
78b99e3761
@ -16,6 +16,7 @@
|
||||
#include "llvm/Constants.h"
|
||||
#include "llvm/Instructions.h"
|
||||
#include "llvm/GlobalVariable.h"
|
||||
#include "llvm/GlobalAlias.h"
|
||||
#include "llvm/IntrinsicInst.h"
|
||||
#include "llvm/LLVMContext.h"
|
||||
#include "llvm/Operator.h"
|
||||
@ -105,6 +106,17 @@ void llvm::ComputeMaskedBits(Value *V, const APInt &Mask,
|
||||
KnownOne.clear();
|
||||
return;
|
||||
}
|
||||
// A weak GlobalAlias is totally unknown. A non-weak GlobalAlias has
|
||||
// the bits of its aliasee.
|
||||
if (GlobalAlias *GA = dyn_cast<GlobalAlias>(V)) {
|
||||
if (GA->mayBeOverridden()) {
|
||||
KnownZero.clear(); KnownOne.clear();
|
||||
} else {
|
||||
ComputeMaskedBits(GA->getAliasee(), Mask, KnownZero, KnownOne,
|
||||
TD, Depth+1);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
KnownZero.clear(); KnownOne.clear(); // Start out not knowing anything.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user