> URL: http://llvm.org/viewvc/llvm-project?rev=45073&view=rev
> Log:
> Make instcombine promote inline asm calls to 'nounwind'
> calls.

Nice.

>  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.

> +++ llvm/trunk/lib/Transforms/Scalar/InstructionCombining.cpp Sun  
> Dec 16 09:51:49 2007
> @@ -7972,6 +7972,19 @@
>       }
>   }
>
> +  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)

?

-Chris
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to