[PATCH] Added llvm.is.constant intrinsic

Renato Golin renato.golin at linaro.org
Wed Jun 25 05:47:24 PDT 2014


Thanks Janusz,

I'm adding Owen to review this patch, since it's not my area, but overall, the patch looks good.

About the tests, though the inline check is important, I was thinking something more elaborate.

Some examples that come to mind:

* static initializer
* generic function arguments
* function arguments where the function is static and only called one with a constant argument
* function arguments where the function is static and only called one with a variable argument
* expressions that will be simplified as constant because all variables were initialised with constants
* expressions that will NOT be simplified as constant because NOT all variables were initialised with constants

Those examples that *should* be constant and are not, should be marked as FIXME. Those examples that *should* NOT be constant and are, should be fixed before commit.

cheers,
--renato

================
Comment at: test/CodeGen/Generic/inline-is-constant.ll:4
@@ +3,3 @@
+; Expected outcome: @fun is inlined and @llvm.is.constant is resolved to TRUE
+; Without inlining @llvm.is.constant would resolve to FALSE.
+
----------------
a more robust way would be to have two run lines, one with O0, another with O3, and use FileCheck for the True/False results.

http://reviews.llvm.org/D4276






More information about the llvm-commits mailing list