[llvm-commits] [llvm] r165726 - in /llvm/trunk: include/llvm-c/ include/llvm/ include/llvm/Target/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/ExecutionEngine/ lib/ExecutionEngine/Interpreter/ lib/ExecutionEngine/JIT/ lib/Target/ lib/Target/ARM/ lib/Target/MBlaze/ lib/Target/MSP430/ lib/Target/NVPTX/ lib/Target/PowerPC/ lib/Target/X86/ lib/Transforms/InstCombine/ lib/Transforms/Instrumentation/ lib/Transforms/Scalar/ lib/Transforms/Utils/

Chris Lattner clattner at apple.com
Thu Oct 11 14:19:24 PDT 2012


On Oct 11, 2012, at 10:21 AM, Micah Villmow <villmow at gmail.com> wrote:

> Author: mvillmow
> Date: Thu Oct 11 12:21:41 2012
> New Revision: 165726
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=165726&view=rev
> Log:
> Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.

Hi Micah,

You've added this code to ExecutionEngine.cpp:

    case Instruction::PtrToInt: {
      GenericValue GV = getConstantValue(Op0);
      unsigned AS = cast<PtrToIntInst>(CE)->getPointerAddressSpace();
      uint32_t PtrWidth = TD->getPointerSizeInBits(AS);
      GV.IntVal = APInt(PtrWidth, uintptr_t(GV.PointerVal));

This is completely incorrect, because "CE" is a ConstantExpr, not an Instruction.  This error is repeated in several other places.  Please fix soon or revert the patch.

Was this patch reviewed?

-Chris





More information about the llvm-commits mailing list