mirror of
https://github.com/llvm/llvm-project.git
synced 2025-05-02 19:26:05 +00:00
Fix crasher in GVN due to my recent capture tracking changes.
llvm-svn: 145047
This commit is contained in:
parent
9a56882e53
commit
063ae5897c
@ -53,6 +53,9 @@ namespace {
|
|||||||
/// counts as capturing it or not.
|
/// counts as capturing it or not.
|
||||||
bool llvm::PointerMayBeCaptured(const Value *V,
|
bool llvm::PointerMayBeCaptured(const Value *V,
|
||||||
bool ReturnCaptures, bool StoreCaptures) {
|
bool ReturnCaptures, bool StoreCaptures) {
|
||||||
|
assert(!isa<GlobalValue>(V) &&
|
||||||
|
"It doesn't make sense to ask whether a global is captured.");
|
||||||
|
|
||||||
// TODO: If StoreCaptures is not true, we could do Fancy analysis
|
// TODO: If StoreCaptures is not true, we could do Fancy analysis
|
||||||
// to determine whether this store is not actually an escape point.
|
// to determine whether this store is not actually an escape point.
|
||||||
// In that case, BasicAliasAnalysis should be updated as well to
|
// In that case, BasicAliasAnalysis should be updated as well to
|
||||||
|
@ -375,7 +375,7 @@ MemoryDependenceAnalysis::getModRefInfo(const Instruction *Inst,
|
|||||||
// with a smarter AA in place, this test is just wasting compile time.
|
// with a smarter AA in place, this test is just wasting compile time.
|
||||||
if (!DT) return AliasAnalysis::ModRef;
|
if (!DT) return AliasAnalysis::ModRef;
|
||||||
const Value *Object = GetUnderlyingObject(MemLoc.Ptr, TD);
|
const Value *Object = GetUnderlyingObject(MemLoc.Ptr, TD);
|
||||||
if (!isIdentifiedObject(Object) || isa<GlobalVariable>(Object))
|
if (!isIdentifiedObject(Object) || isa<GlobalValue>(Object))
|
||||||
return AliasAnalysis::ModRef;
|
return AliasAnalysis::ModRef;
|
||||||
ImmutableCallSite CS(Inst);
|
ImmutableCallSite CS(Inst);
|
||||||
if (!CS.getInstruction()) return AliasAnalysis::ModRef;
|
if (!CS.getInstruction()) return AliasAnalysis::ModRef;
|
||||||
|
@ -26,6 +26,15 @@ define i8 @crash0({i32, i32} %A, {i32, i32}* %P) {
|
|||||||
ret i8 %Y
|
ret i8 %Y
|
||||||
}
|
}
|
||||||
|
|
||||||
|
;; No PR filed, crashed in CaptureTracker.
|
||||||
|
declare void @helper()
|
||||||
|
define void @crash1() {
|
||||||
|
tail call void @llvm.memcpy.p0i8.p0i8.i64(i8* undef, i8* undef, i64 undef, i32 1, i1 false) nounwind
|
||||||
|
%tmp = load i8* bitcast (void ()* @helper to i8*)
|
||||||
|
%x = icmp eq i8 %tmp, 15
|
||||||
|
ret void
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
;;===----------------------------------------------------------------------===;;
|
;;===----------------------------------------------------------------------===;;
|
||||||
;; Store -> Load and Load -> Load forwarding where src and dst are different
|
;; Store -> Load and Load -> Load forwarding where src and dst are different
|
||||||
|
Loading…
x
Reference in New Issue
Block a user