[PATCH] D48323: Derive GEP index type from Data Layout (cont)
Elena Demikhovsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 19 23:09:37 PDT 2018
delena added inline comments.
================
Comment at: lib/Transforms/InstCombine/InstCombineCasts.cpp:1735
Value *P = Builder.CreateZExtOrTrunc(CI.getOperand(0), Ty);
return new IntToPtrInst(P, CI.getType());
----------------
lebedev.ri wrote:
> I realize that it is existing behaviour, but this creates new extra instruction,
> and does not check for uses of previous instruction.
> This is not good for instcombine, although i suppose this is a very special case.
>
> You //might// want to check that there are tests that verify this behavior, or add such tests.
It shouldn't create an extra instruction. I fixed incompatibility between IntPtrType and expected type of the source.
The current version just entered to an endless loop, because the IntPtrType is the index type and not the pointer type.
================
Comment at: test/Transforms/InstCombine/ptr-int-cast_custom_gep.ll:1
+; RUN: opt < %s -instcombine -S | FileCheck %s
+target datalayout = "E-p:40:64:64:32-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128"
----------------
lebedev.ri wrote:
> Instcombine tests use `utils/update_test_checks.py`.
> (And ideally (at least when committing) the diff should be a diff to the previous results)
I can generate. I just took the original code and changed it.
Repository:
rL LLVM
https://reviews.llvm.org/D48323
More information about the llvm-commits
mailing list