[llvm-commits] [llvm] r45073 - in /llvm/trunk: include/llvm/Support/CallSite.h lib/Transforms/Scalar/InstructionCombining.cpp lib/Transforms/Utils/InlineFunction.cpp lib/VMCore/Instructions.cpp test/CFrontend/2007-12-16-AsmNoUnwind.c test/Transforms/Inline/2007-04-15-InlineEH.ll test/Transforms/InstCombine/2007-12-16-AsmNoUnwind.ll

Chris Lattner clattner at apple.com
Sun Dec 16 13:16:09 PST 2007


On Dec 16, 2007, at 1:04 PM, Duncan Sands wrote:

> Hi Chris,
>
>>> Remove special casing of inline asm from the
>>> inliner.  There is a potential problem: the verifier
>>> rejects invokes of inline asm (not sure why).
>>
>> Please restore the inliner to not do this or change the verifier to
>> not reject it.  Right now you have broken the tree.
>
> I've reverted the inliner change for the moment.  I plan to change
> the verifier.

Thanks!

>>> +  if (isa<InlineAsm>(Callee) && !CS.isNoUnwind()) {
>>> +    // Inline asm calls cannot throw - mark them 'nounwind'.
>>> +    const ParamAttrsList *PAL = CS.getParamAttrs();
>>> +    uint16_t RAttributes = PAL ? PAL->getParamAttrs(0) : 0;
>>> +    RAttributes |= ParamAttr::NoUnwind;
>>> +
>>> +    ParamAttrsVector modVec;
>>> +    modVec.push_back(ParamAttrsWithIndex::get(0, RAttributes));
>>> +    PAL = ParamAttrsList::getModified(PAL, modVec);
>>> +    CS.setParamAttrs(PAL);
>>> +    Changed = true;
>>> +  }
>>
>> Should this go in a helper function?  Something like
>> CS.addAttribute(ParamAttr::NoUnwind)
>
> I would like to accumulate some more examples of fiddling with
> attributes before factorizing into helper functions, since it
> is not clear to me yet exactly what helpers would be best.

Ok, sounds great, thanks again Duncan,

-Chris



More information about the llvm-commits mailing list