[llvm-commits] Patch for pr11798: Emit _fltused during FastISel

Anton Korobeynikov anton at korobeynikov.info
Mon Feb 20 23:39:55 PST 2012


> I factored the logic to MachineModuleInfo, since that's where the
> calls...WithFloatingPointArguments state is kept. Attached is the
> revised patch.
I don't think that this routine should be in the common code...
However, I do not see the proper place right now. Maybe Eli knows :)

The comments wrt patch:

1. Use the same code style as all other routines in the file.

> +  FunctionType *FT = dyn_cast<FunctionType>(
> +    I->getCalledValue()->getType()->getContainedType(0));
This definitely looks wrong. What if you're doing indirect call? This
way I->getCalledValue() will return GlobalValue, not Function.

3. +  assert(FT);
Use cast instead of dyn_cast + assert. Also, when doing assert provide
meaningful assertion messages.

4 +  if (FT->isVarArg() &&
+      !callsExternalVAFunctionWithFloatingPointArguments()) {
Just early exit here

5. +      for (po_iterator<Type*> i = po_begin(T), e = po_end(T);
Should we traverse the whole Type tree here? Should fltused be emitted
even if we e.g. passing point to struct contaning float?

Also... is is possible somehow shorten
"setCallsExternalVAFunctionWithFloatingPointArguments".... ?

With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University

More information about the llvm-commits mailing list