summaryrefslogtreecommitdiffstats
path: root/llvm/test/Transforms/InferAddressSpaces/NVPTX
diff options
context:
space:
mode:
authorMichael Liao <michael.hliao@gmail.com>2019-05-10 14:57:42 +0000
committerMichael Liao <michael.hliao@gmail.com>2019-05-10 14:57:42 +0000
commitb284414a1bf1be379cd28c8a10075f0d5238d18d (patch)
treec59866b197761748b3c4eb83a449c4b1d4b6f2fb /llvm/test/Transforms/InferAddressSpaces/NVPTX
parent37dc0ced7a104852d433f0e6012dc800d52e2438 (diff)
downloadbcm5719-llvm-b284414a1bf1be379cd28c8a10075f0d5238d18d.tar.gz
bcm5719-llvm-b284414a1bf1be379cd28c8a10075f0d5238d18d.zip
[InferAddressSpaces] Enhance the handling of cosntexpr.
Summary: - Constant expressions may not be added in strict postorder as the forward instruction scan order. Thus, for a constant express (CE0), if its operand (CE1) is used in an previous instruction, they are not in postorder. However, different from `cloneInstructionWithNewAddressSpace`, `cloneConstantExprWithNewAddressSpace` doesn't bookkeep uninferred instructions for later resolving. That results in failure of inferring constant address. - This patch adds the support to infer constant expression operand recursively, since there won't be loop, if that operand is another constant expression. Reviewers: arsenm Subscribers: jholewinski, jvesely, wdng, nhaehnle, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61760 llvm-svn: 360431
Diffstat (limited to 'llvm/test/Transforms/InferAddressSpaces/NVPTX')
-rw-r--r--llvm/test/Transforms/InferAddressSpaces/NVPTX/clone_constexpr.ll2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/test/Transforms/InferAddressSpaces/NVPTX/clone_constexpr.ll b/llvm/test/Transforms/InferAddressSpaces/NVPTX/clone_constexpr.ll
index 1b324062057..53dff196d32 100644
--- a/llvm/test/Transforms/InferAddressSpaces/NVPTX/clone_constexpr.ll
+++ b/llvm/test/Transforms/InferAddressSpaces/NVPTX/clone_constexpr.ll
@@ -11,7 +11,7 @@ $g1 = comdat any
; CHECK: %idxprom.i = zext i32 %x0 to i64
; CHECK: %arrayidx.i = getelementptr %struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 %idxprom.i
; CHECK: tail call void @f1(i32* %arrayidx.i, i32 undef) #0
-; CHECK: %x1 = load i32, i32* getelementptr (%struct.S, %struct.S* addrspacecast (%struct.S addrspace(3)* @g1 to %struct.S*), i64 0, i32 0, i64 0), align 4
+; CHECK: %x1 = load i32, i32 addrspace(3)* getelementptr inbounds (%struct.S, %struct.S addrspace(3)* @g1, i64 0, i32 0, i64 0), align 4
; CHECK: %L.sroa.0.0.insert.ext.i = zext i32 %x1 to i64
; CHECK: tail call void @f2(i64* null, i64 %L.sroa.0.0.insert.ext.i) #0
; CHECK: ret void
OpenPOWER on IntegriCloud