[PATCH] D127268: [DirectX][Fail crash in DXILPrepareModule pass when input has typed ptr.
Xiang Li via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 7 21:11:36 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG12ca031b0d1b: [DirectX][Fail crash in DXILPrepareModule pass when input has typed ptr. (authored by python3kgae).
Changed prior to commit:
https://reviews.llvm.org/D127268?vs=435024&id=435042#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127268/new/
https://reviews.llvm.org/D127268
Files:
llvm/lib/Target/DirectX/DXILPrepare.cpp
llvm/test/CodeGen/DirectX/typed_ptr.ll
Index: llvm/test/CodeGen/DirectX/typed_ptr.ll
===================================================================
--- /dev/null
+++ llvm/test/CodeGen/DirectX/typed_ptr.ll
@@ -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
+}
Index: llvm/lib/Target/DirectX/DXILPrepare.cpp
===================================================================
--- llvm/lib/Target/DirectX/DXILPrepare.cpp
+++ llvm/lib/Target/DirectX/DXILPrepare.cpp
@@ -127,7 +127,7 @@
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127268.435042.patch
Type: text/x-patch
Size: 962 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220608/7fbda2a9/attachment.bin>
More information about the llvm-commits
mailing list