[PATCH] D157740: [WIP] [InstCombine] Fold icmp into phi beyond the same BB.
Biplob Mishra via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 23 12:18:55 PDT 2023
bipmis added inline comments.
================
Comment at: compiler-rt/test/dfsan/conditional_callbacks.c:101
int tainted_cond = ((DataI * DataJ) != 1);
+ dfsan_set_label(LabelIJ, &tainted_cond, sizeof(tainted_cond));
assert(dfsan_get_label(tainted_cond) == LabelIJ);
----------------
browneee wrote:
> Thanks nikic and bipmis for checking this change with me :)
>
> The point of the test is that tainted_cond should have taint labels propagated from above. This change would invalidate this test, and break the behavior this is testing for.
>
> I wonder, what is the IR for `((DataI * DataJ) != 1)` before and after this change? I suspect this is where the taint label is being lost.
>
Ok Thanks for explaining it.
Let me discuss the IR for the original conditional_callbacks.c before and after the change.
I see the DataI and DataJ are obtained from argv as expected and same in both cases. The result calculation is completely avoided in the mod patch. The phi of the result values is also avoided. Instead it is converted to an i1 cmp based on the value check of DataJ==2.
{F28800923}
//The error I encounter with this is :
/home/bipmis01/llvm_30may/llvm-project/compiler-rt/test/dfsan/conditional_callbacks.c:79:12: error: CHECK: expected string not found in input
// CHECK: Label 1 used as condition
<stdin>:1:1: note: scanning from here
conditional_callbacks.c.tmp: /home/bipmis01/llvm_30may/llvm-project/compiler-rt/test/dfsan/conditional_callbacks.c:35: void my_dfsan_conditional_callback(dfsan_label, dfsan_origin): Assertion `Label == LabelI' failed.//
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D157740/new/
https://reviews.llvm.org/D157740
More information about the llvm-commits
mailing list