[PATCH] D48323: Derive GEP index type from Data Layout (cont)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 19 07:54:03 PDT 2018


lebedev.ri 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());
----------------
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.


================
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"
----------------
Instcombine tests use `utils/update_test_checks.py`.
(And ideally (at least when committing) the diff should be a diff to the previous results)


Repository:
  rL LLVM

https://reviews.llvm.org/D48323





More information about the llvm-commits mailing list