[DirectX][Fail crash in DXILPrepareModule pass when input has typed ptr.
Check supportsTypedPointers instead of hasSetOpaquePointersValue when query if has typed ptr. Reviewed By: beanz Differential Revision: https://reviews.llvm.org/D127268
This commit is contained in:
parent
e14d04909d
commit
12ca031b0d
|
@ -127,7 +127,7 @@ public:
|
|||
continue;
|
||||
}
|
||||
// Only insert bitcasts if the IR is using opaque pointers.
|
||||
if (!M.getContext().hasSetOpaquePointersValue())
|
||||
if (M.getContext().supportsTypedPointers())
|
||||
continue;
|
||||
|
||||
// Emtting NoOp bitcast instructions allows the ValueEnumerator to be
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
; RUN: opt -S -dxil-prepare < %s | FileCheck %s
|
||||
target triple = "dxil-unknown-unknown"
|
||||
|
||||
; Make sure not crash when has typed ptr.
|
||||
; CHECK:@test
|
||||
|
||||
define i64 @test(i64* %p) {
|
||||
%v = load i64, i64* %p
|
||||
ret i64 %v
|
||||
}
|
Loading…
Reference in New Issue