[llvm-commits] [llvm] r166578 - in /llvm/trunk: include/llvm/ include/llvm/Analysis/ include/llvm/Transforms/Utils/ lib/Analysis/ lib/CodeGen/ lib/CodeGen/AsmPrinter/ lib/CodeGen/SelectionDAG/ lib/Target/ lib/Target/ARM/ lib/Target/NVPTX/ lib/Tar

Chandler Carruth chandlerc at gmail.com
Thu Nov 1 02:57:16 PDT 2012


FYI, I've backed out this change and closed PR14233, adding the
testcase to the regression suite. See my email to llvm-dev for
details.

On Wed, Oct 31, 2012 at 6:13 PM, Nick Lewycky <nlewycky at google.com> wrote:
> On 24 October 2012 08:52, Micah Villmow <villmow at gmail.com> wrote:
>>
>> Author: mvillmow
>> Date: Wed Oct 24 10:52:52 2012
>> New Revision: 166578
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=166578&view=rev
>> Log:
>> Add in support for getIntPtrType to get the pointer type based on the
>> address space.
>> This checkin also adds in some tests that utilize these paths and updates
>> some of the
>> clients.
>>
>
> [...]
>
>>
>>        // Only do this transformation if the int is intptrty in size,
>> otherwise
>>        // there is a truncation or extension that we aren't modeling.
>> -      if (CE0->getOpcode() == Instruction::PtrToInt &&
>> -          CE0->getType() == IntPtrTy) {
>> -        Constant *C = CE0->getOperand(0);
>> -        Constant *Null = Constant::getNullValue(C->getType());
>> -        return ConstantFoldCompareInstOperands(Predicate, C, Null, TD,
>> TLI);
>> +      if (CE0->getOpcode() == Instruction::PtrToInt) {
>> +        IntPtrTy = TD->getIntPtrType(CE0->getOperand(0)->getType());
>
>
> What about when TD is null? See PR14233 for a crash caused by this, but
> while that could be fixed by passing the TD down don't forget that people
> can have modules with no TD at all.
>
>>
>> +        if (CE0->getType() == IntPtrTy) {
>> +          Constant *C = CE0->getOperand(0);
>> +          Constant *Null = Constant::getNullValue(C->getType());
>> +          return ConstantFoldCompareInstOperands(Predicate, C, Null, TD,
>> TLI);
>> +        }
>>        }
>>      }
>> -
>
>
> Nick
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



More information about the llvm-commits mailing list